-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
javaPull requests that update java codePull requests that update java code
Description
What happened:
Workflows that enter WAITING status (e.g., at listen() tasks waiting for CloudEvents) cannot be properly restored after application restart. When the application restarts and attempts to restore persisted workflows, the restored workflows fail to receive events because event listeners are not re-registered.
Specifically:
- A workflow executes and reaches a
listen()task - The workflow enters
WAITINGstatus and is persisted - The application restarts
- The workflow is restored from persistence
- An event is emitted that the workflow is waiting for
- The workflow does not receive the event because event listeners were not re-registered during restoration
What you expected to happen:
After application restart, restored workflows in WAITING status should:
- Re-register their event listeners
- Receive events that they are waiting for
- Continue execution from the point where they were waiting
- Complete successfully
How to reproduce it:
- Create a workflow with a
listen()task:
FuncWorkflowBuilder.workflow("listenWorkflow")
.tasks(
set(Map.of("message", "hello")),
listen("waitEvent", toOne("my.event.type")),
function("processEvent", o -> {
System.out.println("Received: " + o);
return "success";
}, Object.class)
)
.build();-
Restart the application
-
Emit the event that the workflow is waiting for.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
javaPull requests that update java codePull requests that update java code