diff --git a/SpiffWorkflow/SpiffWorkflow/bpmn/specs/SubWorkflowTask.py b/SpiffWorkflow/SpiffWorkflow/bpmn/specs/SubWorkflowTask.py index 1e2e277e..34675501 100644 --- a/SpiffWorkflow/SpiffWorkflow/bpmn/specs/SubWorkflowTask.py +++ b/SpiffWorkflow/SpiffWorkflow/bpmn/specs/SubWorkflowTask.py @@ -27,7 +27,6 @@ class SubWorkflowTask(BpmnSpecMixin): def _on_ready_hook(self, my_task): super()._on_ready_hook(my_task) - self.start_workflow(my_task) def _on_subworkflow_completed(self, subworkflow, my_task): self.update_data(my_task, subworkflow) @@ -38,7 +37,8 @@ class SubWorkflowTask(BpmnSpecMixin): if my_task.id not in wf.subprocesses: super()._update_hook(my_task) self.create_workflow(my_task) - return True + self.start_workflow(my_task) + my_task._set_state(TaskState.WAITING) def _on_cancel(self, my_task): subworkflow = my_task.workflow.get_subprocess(my_task) diff --git a/SpiffWorkflow/SpiffWorkflow/spiff/specs/subworkflow_task.py b/SpiffWorkflow/SpiffWorkflow/spiff/specs/subworkflow_task.py index 792d026b..ba1c061b 100644 --- a/SpiffWorkflow/SpiffWorkflow/spiff/specs/subworkflow_task.py +++ b/SpiffWorkflow/SpiffWorkflow/spiff/specs/subworkflow_task.py @@ -1,3 +1,4 @@ +from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.specs.SubWorkflowTask import ( SubWorkflowTask as DefaultSubWorkflow, TransactionSubprocess as DefaultTransaction, @@ -24,7 +25,8 @@ class SubWorkflowTask(DefaultSubWorkflow, SpiffBpmnTask): if my_task.id not in wf.subprocesses: SpiffBpmnTask._update_hook(self, my_task) self.create_workflow(my_task) - return True + self.start_workflow(my_task) + my_task._set_state(TaskState.WAITING) def _on_complete_hook(self, my_task): SpiffBpmnTask._on_complete_hook(self, my_task)