-
Epic
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
SWF Camel Autocomplete
-
False
-
None
-
False
-
25% To Do, 0% In Progress, 75% Done
-
---
-
---
-
-
-
2023 Week 06-08 (from Feb 6), 2023 Week 09-11 (from Feb 27), 2023 Week 12-14 (from Mar 20), 2023 Week 15-17 (from Apr 10), 2023 Week 24-26 (from Jun 12), 2023 Week 18-20 (from May 1), 2023 Week 21-23 (from May 22)
To add supportability to Camel Routes within the same Workflow project, it would be a significant enhancement to the editors to add autocomplete as we do for openapi/ansible and so forth.
The approach for this first iteration is to have a Camel function definition like this:
"functions": [ { "name": "callSoap", "type": "custom", "operation": "camel:direct:numberToWords" } ],
The scheme camel: means that this is a Camel function. After that, we have the Camel endpoint. In this first iteration, only direct is supported. So the endpoint format should be camel:direct:<unique-endpoint-id>.
To find the endpoints, the editor should look for the XML/YAML files within the project in the src/main/resources/routes. This path won't change. If it's not there, the engine won't load it.
The editor then must parse these files and add to autocomplete these routes for the user to make the calls.
This is an example of a Camel Route in XML format:
<?xml version="1.0" encoding="UTF-8"?> <!-- might look like that we are using Spring, but we are not. The XML DSL is derived from there, though --> <routes xmlns="http://camel.apache.org/schema/spring"> <route id="sendSoapMessage"> <from uri="direct:numberToWords"/> <!-- Converting our body to the type expected by the SOAP interface --> <bean beanType="java.math.BigInteger" method="valueOf"/> <setHeader name="operationName"> <constant>NumberToWords</constant> </setHeader> <toD uri="cxf://{{com.dataaccess.webservicesserver.url}}?serviceClass=com.dataaccess.webservicesserver.NumberConversionSoapType&wsdlURL=/wsdl/numberconversion.wsdl"/> </route> </routes>
The http://camel.apache.org/schema/spring has an XSD in this URI. We can use it to parse/validate the route. YAML should be supported too.
Another option for users is to declare the Routes in Java classes, but this can be skipped for the editor for now, unless we want to parse Java files too
When referring to the function in the state, this is how it looks like:
{ "functionRef": { "refName": "callSoap", "arguments": { "body": "${ .number }" } } }
The editor should validate the arguments. It can either be 0 or 1.
You can see a user's project example here:
https://github.com/ricardozanini/kogito-addons-quarkus-camel/tree/main/example
- depends on
-
KOGITO-8351 Add Camel Routes integration to Serverless Workflow
- Resolved