You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use bpmn-engine together with the @onify/flow-extensions package, but I encountered the following unexpected behavior:
When I register the extensions package in the engine, the await engine.execute() command does not wait synchronously for the UserTask instances to reach the wait status. Instead, it returns immediately after the StartEvent completes.
This makes state persistence problematic because calling execution.getState() still returns the state before reaching wait.
If I don't use the extensions package, everything continues to work as expected, just like in our previous implementations.
Please help me determine whether this is a bug or if I am not using the package correctly.
If this is the expected behavior, could you advise on which event handler I should use to wait for the parallel UserTasks to reach the 'wait' status so I can properly save the state?
It is not a bug. The behaviour changes since camunda extensions allows for scripts to be executed when resolving input/output. And scripts are executed asynchronously, hence all formatting will be asynchronous regardless if you use script formatting or not.
You can use the listener to decide when to stop and save state.
Have a look at bpmn-middleware example app for inspiration on how to handle state.
Thank you for the clarification and for pointing me to the example app!
I really appreciate your help and the guidance on handling state.
I'll review the bpmn-middleware example to better understand the approach.
Thanks again!
Hi there!
I would like to use bpmn-engine together with the @onify/flow-extensions package, but I encountered the following unexpected behavior:
When I register the extensions package in the engine, the await engine.execute() command does not wait synchronously for the UserTask instances to reach the wait status. Instead, it returns immediately after the StartEvent completes.
This makes state persistence problematic because calling execution.getState() still returns the state before reaching wait.
If I don't use the extensions package, everything continues to work as expected, just like in our previous implementations.
Please help me determine whether this is a bug or if I am not using the package correctly.
If this is the expected behavior, could you advise on which event handler I should use to wait for the parallel UserTasks to reach the 'wait' status so I can properly save the state?
I have created a StackBlitz project to make it easy to reproduce the issue:
https://stackblitz.com/edit/stackblitz-starters-3wpwgade?file=index.mjs
Thank you!
Gergely Kovács
DPR Ltd.
The text was updated successfully, but these errors were encountered: