-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
False
-
-
2022 Week 08-10 (from Feb 21), 2022 Week 11-13 (from Mar 14)
When using a function with just a single argument, path to remote call is generated correctly based on the following definition:
{ "name": "ansibleAction", "functionRef": { "refName": "triggerAnsible", "arguments": { "id": "7" } } }
This resolves to /api/v2/job_templates/7/launch/
If arguments are changed to the definition below, then the expect id param fails to be resolved:
{ "name": "ansibleAction", "functionRef": { "refName": "triggerAnsible", "arguments": { "id": "7", "data": { "extra_vars": { "kogito_id": "$CONTEXT.workflowInstanceId" } } } } }
This resolves to /api/v2/job_templates//launch/
In the generated method, jobTemplatesJobTemplatesLaunchCreate, the parameter JsonNode id value is:
{"extra_vars": {"kogito_id":"$CONTEXT.workflowInstanceId"}}
Solution
Support for function arguments of the form
"arguments": { "<anyName>": {"leftElement": "${.fahrenheit}", "rightElement": "${.subtractValue}"}}
has been removed, since it was not aligned with editor tools and spec examples
The preferred way to specify request parameters is
"arguments": { "leftElement": "${.fahrenheit}", "rightElement": "${.subtractValue}"}
The arguments in the json object will be used as path parameter, body parameter, query parameter or header parameter as specified in the open api spec operation (currently we are only supporting path and body parameter, header and query will be added with https://issues.redhat.com/browse/KOGITO-6895).
We are also supporting (for those expression languages, like jq, that can generate a json object as result of expression evaluation) a string containing an expression
"arguments": "${{ leftElement: .fahrenheit, rightElement: .subtractValue}}"
The result of the expression will be use as body of the request. Therefore, the request musts not have any parameter that is not a body one (not path, query or header param)
- incorporates
-
KOGITO-6406 Allow REST functions to have host and port values resolved at runtime
- Resolved
- is related to
-
KOGITO-6313 Self-Healing systems use case with Ansible and Serverless Workflow
- Resolved
-
KOGITO-6895 Suppor for header and query parameters
- Resolved
-
KOGITO-6896 Support OAUTH2 (Client and Password flows only) in RestWorkItemHandler
- Resolved