dfiai commented on issue #3337: URL: https://github.com/apache/incubator-kie-kogito-runtimes/issues/3337#issuecomment-1865925209
Thank you for your prompt response! I have incorporated the callback example from the [kogito-examples repository](https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/resources/callback.sw.json) and included a second callback(Identically mirroring the initial callback). ```json { "id": "callback", "version": "1.0", "name": "Workflow Callback example", "description": "An example of how to use callback state", "errors": [ { "name": "execution error", "code": "java.util.concurrent.CompletionException" } ], "start": "waitForEvent", "events": [ { "name": "resumeEvent", "source": "", "type": "resume" }, { "name": "waitEvent", "source": "", "type": "wait" } ], "functions": [ { "name": "printInstanceId", "type": "custom", "operation": "service:java:org.kie.kogito.examples.PrintService::printKogitoProcessId" } ], "states": [ { "name": "waitForEvent", "type": "callback", "action": { "name": "publishAction", "eventRef": { "triggerEventRef": "resumeEvent", "data": "{move: \"This is the initial data in the model\"}" } }, "eventRef": "waitEvent", "eventDataFilter": { "data": ".result", "toStateData": ".move" }, "onErrors": [ { "errorRef": "execution error", "end": true } ], "transition": "waitForEvent 2" }, { "name": "waitForEvent 2", "type": "callback", "action": { "name": "publishAction", "eventRef": { "triggerEventRef": "resumeEvent", "data": "{move: \"This is the initial data in the model\"}" } }, "eventRef": "waitEvent", "eventDataFilter": { "data": ".result", "toStateData": ".move" }, "onErrors": [ { "errorRef": "execution error", "end": true } ], "transition": "finish" }, { "name": "finish", "type": "operation", "actions": [ { "name": "printInstanceId", "functionRef": { "refName": "printInstanceId" } } ], "end": true } ] } ``` From what I observe in AbstractQuarkusCloudEventReceiver, there are two consumers, and when the first event arrives, both callbacks are unexpectedly completed.  And there are unexpected lines in the logs after process completed:  In build artifacts we can see that 2 consumers and producers were generated  I've attempted various approaches to address the issue, including adding non-event states, reordering them, assigning each callback its own eventRef, and rewriting callbacks to event states.... Unfortunately, none of these attempts have proven successful in resolving the problem. -- 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]
