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.
   
   
![image](https://github.com/apache/incubator-kie-kogito-runtimes/assets/139440179/d65a6d00-2dde-41fd-8582-4c0a9683b831)
   
   And there are unexpected lines in the logs after process completed:
   
   
![image](https://github.com/apache/incubator-kie-kogito-runtimes/assets/139440179/48a4de8b-44e0-4b73-a882-23b84a6d51eb)
   
   
   In build artifacts we can see that 2 consumers and producers were generated
   
   
![image](https://github.com/apache/incubator-kie-kogito-runtimes/assets/139440179/3e297ea6-5039-4676-8985-55a0e2732a20)
   
   
   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]

Reply via email to