gabriel-farache opened a new issue, #526:
URL: https://github.com/apache/incubator-kie-kogito-docs/issues/526
Document and give example of how a JSON string shall be formatted in `data`
field when using data in context and jq expression
```
transition:
nextState: WaitForSaveTransformationCompletionEvent
produceEvents:
- eventRef: saveTransformationEvent
data: '{"gitRepo":".repositoryURL", "branch": ".targetBranch",
"token": ".token", "workspaceId": ".workspaceId", "projectId": ".projectId",
"transformId": ".transformId ", "workflowCallerId": "$WORKFLOW.instanceId"}'
```
was not working as the `data` was not parsed as expected when publishing
event:
```
ProcessInstanceDataEvent {specVersion=1.0,
id='338d205f-c266-42c5-9187-bd988dd1f756', source=/process/m2k,
type='save-transformation', time=2024-01-30T08:48:05.895695548Z,
subject='null', dataContentType='null', dataSchema=null,
data={"gitRepo":".repositoryURL","branch":".targetBranch","token":".token","workspaceId":".workspaceId","projectId":".projectId","transformId":".transformId
","workflowCallerId":"$WORKFLOW.instanceId"},
kogitoProcessInstanceId='6311bf4e-c490-4473-8e22-bba027730530',
kogitoRootProcessInstanceId='null', kogitoProcessId='m2k',
kogitoRootProcessId='null', kogitoAddons='null', kogitoIdentity='null',
extensionAttributes={kogitoproctype=SW,
kogitoprocinstanceid=6311bf4e-c490-4473-8e22-bba027730530,
kogitoprocist=Active, kogitoprocversion=1.0, kogitoprocid=m2k}}
```
Instead the `data` string shall be:
```
data: "{gitRepo:.repositoryURL|sub(\"http(s)?://\";\"ssh://\"), branch:
.targetBranch, token: .token, workspaceId: .workspaceId, projectId: .projectId,
transformId: .transformId, workflowCallerId: $WORKFLOW.instanceId}"
```
When published:
```
ProcessInstanceDataEvent {specVersion=1.0,
id='293b7596-1253-4c98-ac12-4e9825f01bce', source=/process/m2k,
type='save-transformation', time=2024-01-30T13:24:14.595998574Z,
subject='null', dataContentType='null', dataSchema=null,
data={"gitRepo":"ssh://bitbucket.org/gfarache31/m2k-test","branch":"aaaaaaasssss","token":null,"workspaceId":"b93980cb-3943-4223-9441-8694c098eeb9","projectId":"9b305fe3-d441-48ce-b01b-d314e86e14ec","transformId":"723dce89-c25c-4c7b-9ef3-842de92e6fe6","workflowCallerId":"7ddb5193-bedc-4942-a857-596b31f377ed"},
kogitoProcessInstanceId='7ddb5193-bedc-4942-a857-596b31f377ed',
kogitoRootProcessInstanceId='null', kogitoProcessId='m2k',
kogitoRootProcessId='null', kogitoAddons='null', kogitoIdentity='null',
extensionAttributes={kogitoproctype=SW,
kogitoprocinstanceid=7ddb5193-bedc-4942-a857-596b31f377ed,
kogitoprocist=Active, kogitoprocversion=1.0, kogitoprocid=m2k}}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]