sartography / SpiffWorkflow

A powerful workflow engine implemented in pure Python
GNU Lesser General Public License v3.0
1.69k stars 313 forks source link

Workflow with endless cycle timer boundary event never completes #369

Closed yyscamper closed 11 months ago

yyscamper commented 11 months ago

For this simple workflow, If manual task is not completed, then it will periodically (every 1 second) send notice. But I found the workflow is still not completed even the manual task has been completed.

image

The BPMN XML has been attached. cycle_timer.txt

essweine commented 11 months ago

I can't run your exact diagram because the service task is implementation-dependent, but I created this workflow with a similar structure: cycle-timer.txt

I was unable to replicate the issue with the following code:

workflow.do_engine_steps()
    for i in range(10):
        workflow.refresh_waiting_tasks()
        workflow.do_engine_steps()
        time.sleep(1)
task = workflow.get_next_task(spec_name='any_task')
task.run()
workflow.do_engine_steps()
assert workflow.is_completed()

I would need more information to understand what's happening.

yyscamper commented 11 months ago

I can't run your exact diagram because the service task is implementation-dependent, but I created this workflow with a similar structure: cycle-timer.txt

I was unable to replicate the issue with the following code:

workflow.do_engine_steps()
    for i in range(10):
        workflow.refresh_waiting_tasks()
        workflow.do_engine_steps()
        time.sleep(1)
task = workflow.get_next_task(spec_name='any_task')
task.run()
workflow.do_engine_steps()
assert workflow.is_completed()

I would need more information to understand what's happening.

Sorry, using your code, I still cannot reproduce this issue right now, maybe this is a bug of my other code.