fixing feedback from @jasquat
This commit is contained in:
parent
1d37eed860
commit
ca62c49de8
|
@ -40,7 +40,7 @@ from SpiffWorkflow.bpmn.serializer.task_spec import ( # type: ignore
|
||||||
EventBasedGatewayConverter,
|
EventBasedGatewayConverter,
|
||||||
)
|
)
|
||||||
from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer # type: ignore
|
from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer # type: ignore
|
||||||
from SpiffWorkflow.bpmn.specs.BpmnProcessSpec import BpmnProcessSpec # type: ignore
|
from SpiffWorkflow.bpmn.specs.bpmn_process_spec import BpmnProcessSpec # type: ignore
|
||||||
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow # type: ignore
|
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow # type: ignore
|
||||||
from SpiffWorkflow.exceptions import WorkflowException # type: ignore
|
from SpiffWorkflow.exceptions import WorkflowException # type: ignore
|
||||||
from SpiffWorkflow.serializer.exceptions import MissingSpecError # type: ignore
|
from SpiffWorkflow.serializer.exceptions import MissingSpecError # type: ignore
|
||||||
|
@ -1111,7 +1111,6 @@ class ProcessInstanceProcessor:
|
||||||
|
|
||||||
def manual_complete_task(self, task_id: str, execute: bool) -> None:
|
def manual_complete_task(self, task_id: str, execute: bool) -> None:
|
||||||
"""Mark the task complete optionally executing it."""
|
"""Mark the task complete optionally executing it."""
|
||||||
time.time()
|
|
||||||
spiff_task = self.bpmn_process_instance.get_task_from_id(UUID(task_id))
|
spiff_task = self.bpmn_process_instance.get_task_from_id(UUID(task_id))
|
||||||
event_type = ProcessInstanceEventType.task_skipped.value
|
event_type = ProcessInstanceEventType.task_skipped.value
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
|
@ -508,24 +508,20 @@ class TestProcessInstanceProcessor(BaseTest):
|
||||||
processor.manual_complete_task(str(human_task_one.task_id), execute=True)
|
processor.manual_complete_task(str(human_task_one.task_id), execute=True)
|
||||||
processor.save()
|
processor.save()
|
||||||
processor = ProcessInstanceProcessor(process_instance)
|
processor = ProcessInstanceProcessor(process_instance)
|
||||||
assert (
|
step1_task = processor.get_task_by_bpmn_identifier("step_1", processor.bpmn_process_instance)
|
||||||
processor.get_task_by_bpmn_identifier("step_1", processor.bpmn_process_instance).state # type: ignore
|
assert (step1_task is not None)
|
||||||
== TaskState.COMPLETED
|
assert (step1_task.state == TaskState.COMPLETED)
|
||||||
)
|
gateway_task = processor.get_task_by_bpmn_identifier("Gateway_Open", processor.bpmn_process_instance)
|
||||||
assert (
|
assert (gateway_task is not None)
|
||||||
processor.get_task_by_bpmn_identifier("Gateway_Open", processor.bpmn_process_instance).state # type: ignore
|
assert (gateway_task.state == TaskState.READY)
|
||||||
== TaskState.READY
|
|
||||||
)
|
|
||||||
|
|
||||||
gateway_task = processor.bpmn_process_instance.get_tasks(TaskState.READY)[0]
|
gateway_task = processor.bpmn_process_instance.get_tasks(TaskState.READY)[0]
|
||||||
processor.manual_complete_task(str(gateway_task.id), execute=True)
|
processor.manual_complete_task(str(gateway_task.id), execute=True)
|
||||||
processor.save()
|
processor.save()
|
||||||
processor = ProcessInstanceProcessor(process_instance)
|
processor = ProcessInstanceProcessor(process_instance)
|
||||||
assert (
|
gateway_task = processor.get_task_by_bpmn_identifier("Gateway_Open", processor.bpmn_process_instance)
|
||||||
processor.get_task_by_bpmn_identifier("Gateway_Open", processor.bpmn_process_instance).state # type: ignore
|
assert (gateway_task is not None)
|
||||||
== TaskState.COMPLETED
|
assert (gateway_task.state == TaskState.COMPLETED)
|
||||||
)
|
|
||||||
print(processor)
|
|
||||||
|
|
||||||
def test_properly_saves_tasks_when_running(
|
def test_properly_saves_tasks_when_running(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in New Issue