eclipse / dirigible

Eclipse Dirigible™ Project
https://www.dirigible.io
Eclipse Public License 2.0
267 stars 90 forks source link

Create camel custom component for Dirigible JavaScript/TypeScript execution #4400

Open iliyan-velichkov opened 1 month ago

iliyan-velichkov commented 1 month ago

Currently, when you want to execute a Dirigible JavaScript/TypeScript code, you have to add two camel steps. One which sets parameter called resource with script file path for value and another step which calls our dedicated class org.eclipse.dirigible.components.engine.camel.invoke.Invoker. For example:

Screenshot 2024-10-24 at 12 30 03

        - setProperty:
            id: setProperty-5681
            description: Set resource property
            name: resource
            expression:
              simple:
                id: simple-2782
                expression: call-dirigible-js-two-steps/handler.ts
        - to:
            id: to-9e30
            description: Execute JS
            uri: class
            parameters:
              beanName: org.eclipse.dirigible.components.engine.camel.invoke.Invoker

This is not quite convenient especially in more complex Camel scenarios. It is more complex for modeling and requires to know the name of the parameter and the class.

Research and implement our own Dirigible step so that we can execute code using simple step.

iliyan-velichkov commented 1 month ago

Implementation: https://github.com/eclipse/dirigible/pull/4383