Closed vcodx closed 8 months ago
Cycle timer children are not created until the timer actually fires, so that's why the tasks don't appear immediately as they would with normal start events. This a change from previous versions of spiff (it was reported as a bug in https://github.com/sartography/SpiffWorkflow/issues/370).
After you complete the placeholder start task, the BPMN start task enters a waiting state, and only after the first cycle passes will the remainder of the tasks be created. Once you start running the workflow, the tasks should appear and be runnable.
After running the first task workflow.get_next_task(state=TaskState.READY).run()
you should see
92238ae1-92db-4c36-994d-c55b30838c97/0: Task of Start (BPMN Task) State: COMPLETED Children: 1
5bca361b-15c6-4dab-b635-13b1cdc2a3cf/0: Task of StartEvent_1 (Timer Start Event) State: WAITING Children: 0
After 10 seconds, refresh the waiting tasks (workflow.refresh_waiting_tasks()
)
92238ae1-92db-4c36-994d-c55b30838c97/0: Task of Start (BPMN Task) State: COMPLETED Children: 1
5bca361b-15c6-4dab-b635-13b1cdc2a3cf/0: Task of StartEvent_1 (Timer Start Event) State: WAITING Children: 1
7b883521-0a0a-4568-872e-c84962b501ec/0: Task of Activity_1n1t0x1 (Manual Task) State: READY Children: 1
a8ca6bdd-c4a1-473c-8f6e-469f9c9422fe/0: Task of Event_1e0ho54 (Default End Event) State: FUTURE Children: 1
9363b60d-baad-454e-871f-7cbe2f51b597/0: Task of Process_YzA9iBf.EndJoin (BPMN Task) State: FUTURE Children: 1
8c550ef8-d0eb-4056-a518-ea04ce6cc19a/0: Task of End (BPMN Task) State: FUTURE Children: 0
Arguably, it might be better to create one branch of tasks in a FUTURE state and mark them as READY when the timer completes, but I'm not sure how easy that would actually be (and what potential issues it could cause).
Works for me, thank you for the clarification @essweine
Description:
I've encountered an issue in SpiffWorkflow version v3.0.0rc2 where workflows are unexpectedly ending following a Timer Start Event. This behavior diverges from the expected, where the workflow should proceed to the next tasks defined in the BPMN diagram.
Steps to Reproduce:
Observed Behavior:
The workflow ends immediately after the Timer Start Event, without progressing to subsequent tasks.
Expected Behavior:
The workflow should continue beyond the Timer Start Event, executing subsequent tasks as defined in the BPMN diagram.
Task Tree Dump for Timer Start Event:
Link to reproduce https://gist.github.com/vcodx/f688a65a70f312a0b2e16a642842426d
Task Tree Dump for Default Start Event:
Link to reproduce https://gist.github.com/vcodx/aec4aa51c9561322c5de93d0ef566507