mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 12:48:25 +00:00
Merge pull request #496 from sartography/bug/cancel-notify-668
Fixes #668 - Cancel/Notify Called when loading last task
This commit is contained in:
commit
08e116515b
@ -252,6 +252,8 @@ def set_current_task(workflow_id, task_id):
|
||||
processor = WorkflowProcessor(workflow_model)
|
||||
task_id = uuid.UUID(task_id)
|
||||
spiff_task = processor.bpmn_workflow.get_task(task_id)
|
||||
cancel_notify = (spiff_task.state == spiff_task.COMPLETED and
|
||||
spiff_task.task_spec.__class__.__name__ != 'EndEvent')
|
||||
if not spiff_task:
|
||||
# An invalid task_id was requested.
|
||||
raise ApiError("invalid_task", "The Task you requested no longer exists as a part of this workflow.")
|
||||
@ -262,7 +264,7 @@ def set_current_task(workflow_id, task_id):
|
||||
"currently set to COMPLETE or READY.")
|
||||
|
||||
# Only reset the token if the task doesn't already have it.
|
||||
if spiff_task.state == spiff_task.COMPLETED:
|
||||
if cancel_notify:
|
||||
processor.cancel_notify()
|
||||
spiff_task.reset_token({}, reset_data=True) # Don't try to copy the existing data back into this task.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user