Inject dynamic data in Serverless workflow

62 views
Skip to first unread message

Pablo

unread,
Sep 12, 2023, 4:28:02 AM9/12/23
to Kogito development mailing list
Hi,
I'm trying to define a serverless workflow, where in some states i may add dynamic data.
I used "inject" type state to add to data field some new parameters to the json message, but it seems I cannot inject data such as referenced fields.
Example. Pay attention only to $.{} fields, as they are already part of the previous message shared among states. I'm also interested in using conditions to decide data.
Is it possible?
Best regards and thanks in advance

{

"name": "InjectTask",

"type": "inject",

"data": {

"version": "0.0.1.0",

"id": "-",

"timestamp": "$.time",

"ker": "robot",

"message": "task",

"data": {

"taskID":"${WORKFLOW.instanceId}",

"taskType":"moveTo",

"taskStatus":"pending",

"priority":"none",

"startTime":"${.time}",

"endTime":" ",

"startLocation":" ",

"endLocation":"${.room}"}

},

"transition": "WaitForResult"


},

Ricardo Zanini

unread,
Sep 12, 2023, 10:32:15 AM9/12/23
to kogito-de...@googlegroups.com
Hi Pablo!

The inject state is for static data only [1]. Why not use action data filters [2] in the operation state and add a jq expression to model the data the way you need using "toStateData"?

Cheers!

--
Zanini


--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/ab15e59d-6edf-455e-b526-3a367a2875fbn%40googlegroups.com.

Pablo

unread,
Sep 26, 2023, 8:22:22 AM9/26/23
to Kogito development mailing list
Hi Ricardo,
can I use fields form the whole cloudevent structure  with data filters or just fields inside data field?
BR
Reply all
Reply to author
Forward
0 new messages