From 38ff7e08dad14714f97c0c603891d58eee26fdfd Mon Sep 17 00:00:00 2001 From: burnettk Date: Wed, 9 Aug 2023 16:14:27 -0400 Subject: [PATCH] Squashed 'SpiffWorkflow/' changes from 01a25fc3..0adfc8cb 0adfc8cb update spiff signal event 52d65dfc Merge pull request #346 from sartography/bugfix/update-split-task-inputs 23ca808c make sure tasks with boundary events are connected properly de427431 remove pointless parser attribute and variable 3236b5b9 change subprocess start event validation error message text a5ad0672 Merge pull request #344 from sartography/bugfix/gateway-in-loop 6b22a195 allow event definitions without refs bb843873 clean up inclusive gateway a little a7d81c02 prevent parallel gateways from waiting on descendants 802352a2 move test to proper location ebcdde95 Merge pull request #343 from sartography/feature/event-payloads 87636472 add an additional test for boundary event parent removal 41423168 add escalation event test 26c5a9bb fix message event catch check 9bd018e5 Add test case for call activities in sub processes, fixed bug (#342) 546923b4 add serialization migration for boundary events 46d41e20 add spiff payload extensions + base spec improvements a0f5fc2a remove boundary event parent 56277ff1 add event class 6de6fb2b reorganize event definitions 7db65566 fix subprocess cancel 442535ae do not allow the task trace to infinitely loop to get the trace w/ burnettk dbe41c8e Merge pull request #339 from sartography/improvement/better-subworkflow-management 6c61f20a update parent attribute name ea0a7bf4 update correlations when catching external messages f511e2dd remove unneeded method from tests 953fa63c clean up workflow methods efcdcf54 Merge pull request #338 from sartography/bugfix/triggered-multiinstance-tasks 11b78ce7 prevent errors synching children of MI tasks bbb79e05 miscellaneous improvements 3f8e8d84 split bpmn workflow into two classes 61e01201 clean up workflow attributes & methods git-subtree-dir: SpiffWorkflow git-subtree-split: 0adfc8cbaec80d36f98a4136434e960f666fcfe2 --- tests/SpiffWorkflow/bpmn/ApprovalsTest.py | 16 - .../bpmn/BpmnWorkflowTestCase.py | 11 +- tests/SpiffWorkflow/bpmn/CallActivityTest.py | 3 - tests/SpiffWorkflow/bpmn/CollaborationTest.py | 28 +- tests/SpiffWorkflow/bpmn/CustomScriptTest.py | 2 - .../SpiffWorkflow/bpmn/NestedProcessesTest.py | 29 +- .../ParallelMultiInstanceTest.py | 0 tests/SpiffWorkflow/bpmn/ParserTest.py | 13 + tests/SpiffWorkflow/bpmn/ProcessParserTest.py | 4 + .../SpiffWorkflow/bpmn/ResetSubProcessTest.py | 8 +- .../bpmn/data/boundary_event_split.bpmn | 108 + .../bpmn/data/gateway_loop_input.bpmn | 111 ++ .../bpmn/data/multipleEvents.bpmn | 201 -- .../bpmn/data/nested_call_activity.bpmn | 115 ++ .../v1.2-boundary-events-noninterrupting.json | 1772 +++++++++++++++++ .../serialization/v1.2-boundary-events.json | 1372 +++++++++++++ .../bpmn/events/ActionManagementTest.py | 5 +- .../bpmn/events/CallActivityEscalationTest.py | 1 - .../bpmn/events/EventBasedGatewayTest.py | 13 +- .../bpmn/events/MessageInterruptsSpTest.py | 6 +- .../bpmn/events/MessageInterruptsTest.py | 11 +- .../bpmn/events/MessageNonInterruptTest.py | 42 +- .../bpmn/events/MessageNonInterruptsSpTest.py | 13 +- .../SpiffWorkflow/bpmn/events/MessagesTest.py | 13 +- .../bpmn/events/MultipleCatchEventTest.py | 11 +- .../bpmn/events/MultipleEventsTest.py | 75 - .../bpmn/events/MultipleThrowEventTest.py | 2 - .../events/NITimerDurationBoundaryTest.py | 14 +- .../bpmn/events/TimeDurationParseTest.py | 2 +- .../bpmn/events/TimerCycleTest.py | 7 - .../bpmn/events/TransactionSubprocssTest.py | 10 +- .../ParallelGatewayLoopInputTest.py | 19 + .../ParallelMultipleSplitsTest.py | 1 - .../serializer/BpmnWorkflowSerializerTest.py | 1 - .../bpmn/serializer/VersionMigrationTest.py | 45 +- .../camunda/CallActivityMessageTest.py | 1 - .../ExternalMessageBoundaryEventTest.py | 22 +- .../camunda/MessageBoundaryEventTest.py | 12 - .../camunda/NIMessageBoundaryTest.py | 1 - .../camunda/ResetTokenSubWorkflowTest.py | 1 - .../camunda/StartMessageEventTest.py | 11 +- .../SpiffWorkflow/camunda/SubWorkflowTest.py | 1 - .../serializer/CamundaExtensionsTest.py | 2 +- .../core/specs/SubWorkflowTest.py | 2 +- tests/SpiffWorkflow/dmn/DecisionRunner.py | 11 +- tests/SpiffWorkflow/spiff/CorrelationTest.py | 19 +- tests/SpiffWorkflow/spiff/EventPayloadTest.py | 49 + .../spiff/PrescriptPostscriptTest.py | 1 - .../spiff/data/error_event_payload.bpmn | 121 ++ .../spiff/data/escalation_event_payload.bpmn | 121 ++ .../spiff/data/signal_event_payload.bpmn | 110 + 51 files changed, 4082 insertions(+), 487 deletions(-) rename tests/SpiffWorkflow/bpmn/{parallel_gateway_tests => }/ParallelMultiInstanceTest.py (100%) create mode 100644 tests/SpiffWorkflow/bpmn/data/boundary_event_split.bpmn create mode 100644 tests/SpiffWorkflow/bpmn/data/gateway_loop_input.bpmn delete mode 100644 tests/SpiffWorkflow/bpmn/data/multipleEvents.bpmn create mode 100644 tests/SpiffWorkflow/bpmn/data/nested_call_activity.bpmn create mode 100644 tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events-noninterrupting.json create mode 100644 tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events.json delete mode 100644 tests/SpiffWorkflow/bpmn/events/MultipleEventsTest.py create mode 100644 tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelGatewayLoopInputTest.py create mode 100644 tests/SpiffWorkflow/spiff/EventPayloadTest.py create mode 100644 tests/SpiffWorkflow/spiff/data/error_event_payload.bpmn create mode 100644 tests/SpiffWorkflow/spiff/data/escalation_event_payload.bpmn create mode 100644 tests/SpiffWorkflow/spiff/data/signal_event_payload.bpmn diff --git a/tests/SpiffWorkflow/bpmn/ApprovalsTest.py b/tests/SpiffWorkflow/bpmn/ApprovalsTest.py index ef1c3c51..9247dec9 100644 --- a/tests/SpiffWorkflow/bpmn/ApprovalsTest.py +++ b/tests/SpiffWorkflow/bpmn/ApprovalsTest.py @@ -46,8 +46,6 @@ class ApprovalsTest(BpmnWorkflowTestCase): def testRunThroughHappy(self): self.do_next_named_step('First_Approval_Wins.Manager_Approval') - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.First_Approval_Wins_Done') self.do_next_named_step('Approvals.Manager_Approval__P_') @@ -57,15 +55,11 @@ class ApprovalsTest(BpmnWorkflowTestCase): self.do_next_named_step('Parallel_Approvals_SP.Step1') self.do_next_named_step('Parallel_Approvals_SP.Manager_Approval') self.do_next_named_step('Parallel_Approvals_SP.Supervisor_Approval') - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.Parallel_SP_Done') def testRunThroughHappyOtherOrders(self): self.do_next_named_step('First_Approval_Wins.Supervisor_Approval') - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.First_Approval_Wins_Done') self.do_next_named_step('Approvals.Supervisor_Approval__P_') @@ -75,15 +69,11 @@ class ApprovalsTest(BpmnWorkflowTestCase): self.do_next_named_step('Parallel_Approvals_SP.Manager_Approval') self.do_next_named_step('Parallel_Approvals_SP.Step1') self.do_next_named_step('Parallel_Approvals_SP.Supervisor_Approval') - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.Parallel_SP_Done') def testSaveRestore(self): self.do_next_named_step('First_Approval_Wins.Manager_Approval') - self.complete_subworkflow() - self.complete_subworkflow() self.save_restore() self.do_next_exclusive_step('Approvals.First_Approval_Wins_Done') @@ -96,16 +86,12 @@ class ApprovalsTest(BpmnWorkflowTestCase): self.do_next_named_step('Parallel_Approvals_SP.Manager_Approval') self.do_next_exclusive_step('Parallel_Approvals_SP.Step1') self.do_next_exclusive_step('Parallel_Approvals_SP.Supervisor_Approval') - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.Parallel_SP_Done') def testSaveRestoreWaiting(self): self.do_next_named_step('First_Approval_Wins.Manager_Approval') self.save_restore() - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.First_Approval_Wins_Done') self.save_restore() @@ -122,8 +108,6 @@ class ApprovalsTest(BpmnWorkflowTestCase): self.save_restore() self.do_next_exclusive_step('Parallel_Approvals_SP.Supervisor_Approval') self.save_restore() - self.complete_subworkflow() - self.complete_subworkflow() self.do_next_exclusive_step('Approvals.Parallel_SP_Done') diff --git a/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py b/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py index 604ba1f6..0029f538 100644 --- a/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py +++ b/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py @@ -76,7 +76,7 @@ class BpmnWorkflowTestCase(unittest.TestCase): if (p.task_spec.name == parent_name or p.task_spec.bpmn_name == parent_name): found = True break - if p.parent is None and p.workflow != p.workflow.outer_workflow: + if p.parent is None and p.workflow != p.workflow.parent: p = switch_workflow(p) else: p = p.parent @@ -117,13 +117,6 @@ class BpmnWorkflowTestCase(unittest.TestCase): tasks[0].set_data(**set_attribs) tasks[0].run() - def complete_subworkflow(self): - # A side effect of finer grained contol over task execution is that tasks require more explicit intervention - # to change states. Subworkflows tasks no longer go directly to ready when the subworkflow completes. - # So they may need to explicitly refreshed to become ready, and then run. - self.workflow.refresh_waiting_tasks() - self.workflow.do_engine_steps() - def save_restore(self): script_engine = self.workflow.script_engine @@ -140,7 +133,7 @@ class BpmnWorkflowTestCase(unittest.TestCase): self.assertEqual(before_state, after_state) self.workflow = after self.workflow.script_engine = script_engine - + def restore(self, state): self.workflow = self.serializer.workflow_from_dict(state) diff --git a/tests/SpiffWorkflow/bpmn/CallActivityTest.py b/tests/SpiffWorkflow/bpmn/CallActivityTest.py index 1c71093c..97530dcf 100644 --- a/tests/SpiffWorkflow/bpmn/CallActivityTest.py +++ b/tests/SpiffWorkflow/bpmn/CallActivityTest.py @@ -17,7 +17,6 @@ class CallActivityTest(BpmnWorkflowTestCase): self.workflow = BpmnWorkflow(self.spec, self.subprocesses) self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertDictEqual(self.workflow.data, {'pre_var': 'some string', 'my_var': 'World', 'my_other_var': 'Mike'}) def test_call_activity_has_same_script_engine(self): @@ -26,7 +25,6 @@ class CallActivityTest(BpmnWorkflowTestCase): self.workflow = BpmnWorkflow(self.spec, self.subprocesses, script_engine=CustomScriptEngine()) self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertTrue(self.workflow.is_completed()) self.assertIsInstance(self.workflow.script_engine, CustomScriptEngine) @@ -42,7 +40,6 @@ class CallActivityTest(BpmnWorkflowTestCase): # data should be removed in the final output as well. self.workflow = BpmnWorkflow(self.spec, self.subprocesses) self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertTrue(self.workflow.is_completed()) self.assertNotIn('remove_this_var', self.workflow.last_task.data.keys()) diff --git a/tests/SpiffWorkflow/bpmn/CollaborationTest.py b/tests/SpiffWorkflow/bpmn/CollaborationTest.py index bbbcddd7..862badbf 100644 --- a/tests/SpiffWorkflow/bpmn/CollaborationTest.py +++ b/tests/SpiffWorkflow/bpmn/CollaborationTest.py @@ -1,5 +1,6 @@ from SpiffWorkflow.bpmn.specs.mixins.subworkflow_task import CallActivity from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from SpiffWorkflow.bpmn.event import BpmnEvent from SpiffWorkflow.task import TaskState from .BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -46,30 +47,27 @@ class CollaborationTest(BpmnWorkflowTestCase): start.data['lover_name'] = 'Peggy' workflow.do_engine_steps() # An external message should be created - messages = workflow.get_bpmn_messages() + messages = workflow.get_events() self.assertEqual(len(messages), 1) - self.assertEqual(len(workflow.bpmn_messages), 0) + self.assertEqual(len(workflow.bpmn_events), 0) receive = workflow.get_tasks_from_spec_name('EventReceiveLetter')[0] # Waiting Events should contain details about what we are no waiting on. events = workflow.waiting_events() self.assertEqual(1, len(events)) - self.assertEqual("MessageEventDefinition", events[0]['event_type']) - self.assertEqual("Love Letter Response", events[0]['name']) - self.assertEqual(['lover'], events[0]['value'][0].correlation_keys) - self.assertEqual('from_name', events[0]['value'][0].retrieval_expression) - self.assertEqual('lover_name', events[0]['value'][0].name) + self.assertEqual("MessageEventDefinition", events[0].event_type) + self.assertEqual("Love Letter Response", events[0].name) + self.assertEqual(['lover'], events[0].value[0].correlation_keys) + self.assertEqual('from_name', events[0].value[0].retrieval_expression) + self.assertEqual('lover_name', events[0].value[0].name) - # As shown above, the waiting event is looking for a payload with a - # 'from_name' that should be used to retrieve the lover's name. - new_message_payload = {'from_name': 'Peggy', 'other_nonsense': 1001} - workflow.catch_bpmn_message('Love Letter Response', new_message_payload) + message = BpmnEvent( + receive.task_spec.event_definition, + {'from_name': 'Peggy', 'other_nonsense': 1001} + ) + workflow.send_event(message) workflow.do_engine_steps() - # The external message created above should be caught self.assertEqual(receive.state, TaskState.COMPLETED) - # Spiff extensions allow us to specify the destination of a workflow - # but base BPMN does not, and all keys are added directly to the - # task data. self.assertEqual(workflow.last_task.data, {'from_name': 'Peggy', 'lover_name': 'Peggy', 'other_nonsense': 1001}) self.assertEqual(workflow.correlations, {'lover':{'lover_name':'Peggy'}}) self.assertEqual(workflow.is_completed(), True) diff --git a/tests/SpiffWorkflow/bpmn/CustomScriptTest.py b/tests/SpiffWorkflow/bpmn/CustomScriptTest.py index 5d974456..1593e581 100644 --- a/tests/SpiffWorkflow/bpmn/CustomScriptTest.py +++ b/tests/SpiffWorkflow/bpmn/CustomScriptTest.py @@ -36,8 +36,6 @@ class CustomInlineScriptTest(BpmnWorkflowTestCase): if save_restore: self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() - self.complete_subworkflow() if save_restore: self.save_restore() data = self.workflow.last_task.data diff --git a/tests/SpiffWorkflow/bpmn/NestedProcessesTest.py b/tests/SpiffWorkflow/bpmn/NestedProcessesTest.py index a77579fb..57bc9e33 100644 --- a/tests/SpiffWorkflow/bpmn/NestedProcessesTest.py +++ b/tests/SpiffWorkflow/bpmn/NestedProcessesTest.py @@ -20,7 +20,7 @@ class NestedProcessesTest(BpmnWorkflowTestCase): self.complete_task('Action2', True) self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.complete_task('Action3', True) - self.complete_workflow() + self.assertTrue(self.workflow.is_completed()) def testResetToTop(self): @@ -36,7 +36,7 @@ class NestedProcessesTest(BpmnWorkflowTestCase): self.complete_task('Action2') self.complete_task('Action3') - self.complete_workflow() + self.assertTrue(self.workflow.is_completed()) def testResetToIntermediate(self): @@ -53,16 +53,27 @@ class NestedProcessesTest(BpmnWorkflowTestCase): task.run() self.complete_task('Action3') - self.complete_workflow() + self.assertTrue(self.workflow.is_completed()) + + def testResetToSubworkflow(self): + + self.complete_task('Action1', True) + self.complete_task('Action2', True) + self.complete_task('Action3', True) + + # "Nested level 1" + task = self.workflow.get_tasks_from_spec_name('sid-C014B4B9-889F-4EE9-9949-C89502C35CF0')[0] + self.workflow.reset_from_task_id(task.id) + + self.workflow.do_engine_steps() + self.assertEqual(len(self.workflow.subprocesses), 1) + self.assertEqual(task.state, TaskState.WAITING) + self.complete_task('Action2', True) + self.complete_task('Action3', True) + self.assertTrue(self.workflow.is_completed()) def complete_task(self, name, save_restore=False): self.do_next_named_step(name) self.workflow.do_engine_steps() if save_restore: self.save_restore() - - def complete_workflow(self): - self.complete_subworkflow() - self.complete_subworkflow() - self.complete_subworkflow() - self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) \ No newline at end of file diff --git a/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelMultiInstanceTest.py b/tests/SpiffWorkflow/bpmn/ParallelMultiInstanceTest.py similarity index 100% rename from tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelMultiInstanceTest.py rename to tests/SpiffWorkflow/bpmn/ParallelMultiInstanceTest.py diff --git a/tests/SpiffWorkflow/bpmn/ParserTest.py b/tests/SpiffWorkflow/bpmn/ParserTest.py index b9e7dfbc..1c09a1af 100644 --- a/tests/SpiffWorkflow/bpmn/ParserTest.py +++ b/tests/SpiffWorkflow/bpmn/ParserTest.py @@ -46,3 +46,16 @@ class ParserTest(unittest.TestCase): self.assertRaisesRegex( ValidationException, "The process '\w+' was not found*", self.parser.get_spec, "Process") + + def testBoundaryEvent(self): + bpmn_file = os.path.join(os.path.dirname(__file__), 'data', 'boundary_event_split.bpmn') + self.parser.add_bpmn_file(bpmn_file) + spec = self.parser.get_spec('Process_0ymnx41') + gw1 = spec.task_specs.get('gw_1') + gw2 = spec.task_specs.get('gw_2') + task = spec.task_specs.get('task_2') + split_task = spec.task_specs.get(f'{task.name}.BoundaryEventSplit') + self.assertNotIn(task, gw1.outputs) + self.assertIn(split_task, gw1.outputs) + self.assertNotIn(task, gw2.outputs) + self.assertIn(split_task, gw2.outputs) diff --git a/tests/SpiffWorkflow/bpmn/ProcessParserTest.py b/tests/SpiffWorkflow/bpmn/ProcessParserTest.py index d70d6283..a091559d 100644 --- a/tests/SpiffWorkflow/bpmn/ProcessParserTest.py +++ b/tests/SpiffWorkflow/bpmn/ProcessParserTest.py @@ -24,6 +24,10 @@ class ProcessParserTest(unittest.TestCase): parser = _process_parser("multiple_call_activities.bpmn", "Process_90mmqlw") assert parser.called_element_ids() == ["Process_sypm122", "Process_diu8ta2", "Process_l14lar1"] + def testHandlesNestedCallActivity(self): + parser = _process_parser("nested_call_activity.bpmn", "Process_expand_call_activity") + assert parser.called_element_ids() == ["is_this_missing", "set_permissions_process"] + def testCanAddDmnFromString(self): parser = BpmnDmnParser() parser.add_dmn_str(EMPTY_DMN) diff --git a/tests/SpiffWorkflow/bpmn/ResetSubProcessTest.py b/tests/SpiffWorkflow/bpmn/ResetSubProcessTest.py index 2a2a8097..2f027cf7 100644 --- a/tests/SpiffWorkflow/bpmn/ResetSubProcessTest.py +++ b/tests/SpiffWorkflow/bpmn/ResetSubProcessTest.py @@ -24,7 +24,7 @@ class ResetSubProcessTest(BpmnWorkflowTestCase): state = self.serializer.serialize_json(self.workflow) self.workflow = self.serializer.deserialize_json(state) self.workflow.spec = spec - self.workflow.subprocesses = subprocesses + self.workflow.subprocess_specs = subprocesses def testSaveRestore(self): self.actualTest(True) @@ -38,14 +38,11 @@ class ResetSubProcessTest(BpmnWorkflowTestCase): task = self.workflow.get_ready_user_tasks()[0] self.save_restore() top_level_task = self.workflow.get_tasks_from_spec_name('Task1')[0] -# top_level_task.reset_token({}, reset_data=True) self.workflow.reset_from_task_id(top_level_task.id) task = self.workflow.get_ready_user_tasks()[0] - self.assertEqual(len(self.workflow.get_ready_user_tasks()), 1, - "There should only be one task in a ready state.") + self.assertEqual(len(self.workflow.get_ready_user_tasks()), 1, "There should only be one task in a ready state.") self.assertEqual(task.get_name(), 'Task1') - def actualTest(self, save_restore=False): self.workflow.do_engine_steps() @@ -73,7 +70,6 @@ class ResetSubProcessTest(BpmnWorkflowTestCase): self.assertEqual(task.get_name(),'Subtask2A') task.run() self.workflow.do_engine_steps() - self.complete_subworkflow() task = self.workflow.get_ready_user_tasks()[0] self.assertEqual(task.get_name(),'Task2') task.run() diff --git a/tests/SpiffWorkflow/bpmn/data/boundary_event_split.bpmn b/tests/SpiffWorkflow/bpmn/data/boundary_event_split.bpmn new file mode 100644 index 00000000..f0dd4b13 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/boundary_event_split.bpmn @@ -0,0 +1,108 @@ + + + + + Flow_01pj69c + + + Flow_01pj69c + Flow_1imjpib + Flow_1e2doc4 + + + + Flow_1imjpib + Flow_1baqf6p + Flow_0a5mw5g + + + False + + + Flow_1baqf6p + Flow_0qrmpxi + + + + Flow_0a5mw5g + Flow_1e2doc4 + Flow_1or38ex + + + True + + + + Flow_0qrmpxi + Flow_1or38ex + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/gateway_loop_input.bpmn b/tests/SpiffWorkflow/bpmn/data/gateway_loop_input.bpmn new file mode 100644 index 00000000..069741bc --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/gateway_loop_input.bpmn @@ -0,0 +1,111 @@ + + + + + Flow_1b4mvkp + + + + Flow_1b4mvkp + Flow_0igglvl + x = 0 + + + + Flow_0igglvl + Flow_0r5ndy6 + Flow_0ric3rl + + + + Flow_0ric3rl + Flow_19u7g47 + x += 1 + + + Flow_19u7g47 + Flow_0tubcbv + Flow_1jejn7h + + + + Flow_0tubcbv + + + + x < 2 + + + Flow_1jejn7h + Flow_0r5ndy6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/multipleEvents.bpmn b/tests/SpiffWorkflow/bpmn/data/multipleEvents.bpmn deleted file mode 100644 index 5cf1fa3c..00000000 --- a/tests/SpiffWorkflow/bpmn/data/multipleEvents.bpmn +++ /dev/null @@ -1,201 +0,0 @@ - - - - - Flow_1f7we2y - - - Flow_0mixvu9 - Flow_08knksn - cancel="cancel_signal" - - - - - - - - Flow_02yqmm2 - Flow_1i2iik3 - - - <H1>Hello</H1> - Flow_0ynr3ge - Flow_02yqmm2 - - - Flow_0xvajbj - - - <H1>Good Bye</H1> - Flow_0elk2a3 - Flow_0xvajbj - - - <H1>Cancel Message</H1> - Flow_0zc9byy - Flow_0zy1z3a - cancel="cancel_event" - - - Flow_1i2iik3 - Flow_0elk2a3 - - Flow_0syqz17 - - - - - - - - Flow_0syqz17 - Flow_0m0ilsi - - - Flow_0m0ilsi - - - - - - Flow_0mixvu9 - - - - Flow_0zc9byy - - - - - - - - - - - Flow_08knksn - - - - Flow_0zy1z3a - - - - Flow_1f7we2y - Flow_0ynr3ge - cancel="none" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/SpiffWorkflow/bpmn/data/nested_call_activity.bpmn b/tests/SpiffWorkflow/bpmn/data/nested_call_activity.bpmn new file mode 100644 index 00000000..ed1d9724 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/nested_call_activity.bpmn @@ -0,0 +1,115 @@ + + + + + Flow_0rrlqcy + Flow_1x7ckx0 + + Flow_09wo95v + + + + Flow_0fbenj5 + + + + Flow_09wo95v + Flow_0fbenj5 + + + + Flow_0q4zwqq + + + + Flow_0rrlqcy + + + + + Flow_1x7ckx0 + Flow_0q4zwqq + + Flow_1gg1sal + + + + Flow_151l7v5 + + + + Flow_1gg1sal + Flow_151l7v5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events-noninterrupting.json b/tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events-noninterrupting.json new file mode 100644 index 00000000..bfe11bd0 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events-noninterrupting.json @@ -0,0 +1,1772 @@ +{ + "serializer_version": "1.2", + "spec": { + "name": "sid-b0903a88-fe74-4f93-b912-47b815ea8d1c", + "description": "Test Workflows", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Test-Workflows.bpmn20.xml", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "sid-2C69C7A6-BD02-428F-B5AA-0BB10EC514C2" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "sid-b0903a88-fe74-4f93-b912-47b815ea8d1c.EndJoin": { + "name": "sid-b0903a88-fe74-4f93-b912-47b815ea8d1c.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-464B8E64-10B4-4158-BDEE-11144CE20306" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-b0903a88-fe74-4f93-b912-47b815ea8d1c.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "sid-2C69C7A6-BD02-428F-B5AA-0BB10EC514C2": { + "name": "sid-2C69C7A6-BD02-428F-B5AA-0BB10EC514C2", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "USER_INPUT_SELECT_TEST" + ], + "bpmn_id": "sid-2C69C7A6-BD02-428F-B5AA-0BB10EC514C2", + "bpmn_name": "", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "USER_INPUT_SELECT_TEST": { + "name": "USER_INPUT_SELECT_TEST", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-2C69C7A6-BD02-428F-B5AA-0BB10EC514C2" + ], + "outputs": [ + "GATEWAY_SELECTED_TEST" + ], + "bpmn_id": "USER_INPUT_SELECT_TEST", + "bpmn_name": "Select Test", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "GATEWAY_SELECTED_TEST": { + "name": "GATEWAY_SELECTED_TEST", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "USER_INPUT_SELECT_TEST" + ], + "outputs": [ + "sid-464B8E64-10B4-4158-BDEE-11144CE20306", + "MESSAGES_SUB", + "SCRIPTS_SUB", + "MESSAGE_INTERRUPTS_SUB", + "MESSAGE_NON_INTERRUPT_SUB" + ], + "bpmn_id": "GATEWAY_SELECTED_TEST", + "bpmn_name": "", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": "choice == 'Tests Done'", + "task_spec": "sid-464B8E64-10B4-4158-BDEE-11144CE20306" + }, + { + "condition": "choice == 'Messages'", + "task_spec": "MESSAGES_SUB" + }, + { + "condition": "choice == 'Scripts'", + "task_spec": "SCRIPTS_SUB" + }, + { + "condition": "choice == 'Message Interrupts'", + "task_spec": "MESSAGE_INTERRUPTS_SUB" + }, + { + "condition": "choice == 'Message Non Interrupt'", + "task_spec": "MESSAGE_NON_INTERRUPT_SUB" + } + ], + "choice": null, + "default_task_spec": null, + "typename": "ExclusiveGateway", + "extensions": {} + }, + "MESSAGE_NON_INTERRUPT_SUB": { + "name": "MESSAGE_NON_INTERRUPT_SUB", + "description": "Call Activity", + "manual": false, + "lookahead": 2, + "inputs": [ + "GATEWAY_SELECTED_TEST" + ], + "outputs": [ + "sid-464B8E64-10B4-4158-BDEE-11144CE20306" + ], + "bpmn_id": "MESSAGE_NON_INTERRUPT_SUB", + "bpmn_name": "Message Non Interrupt", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "spec": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9", + "typename": "CallActivity", + "extensions": {} + }, + "sid-464B8E64-10B4-4158-BDEE-11144CE20306": { + "name": "sid-464B8E64-10B4-4158-BDEE-11144CE20306", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "MESSAGE_NON_INTERRUPT_SUB", + "SCRIPTS_SUB", + "MESSAGE_INTERRUPTS_SUB", + "MESSAGES_SUB", + "GATEWAY_SELECTED_TEST" + ], + "outputs": [ + "sid-b0903a88-fe74-4f93-b912-47b815ea8d1c.EndJoin" + ], + "bpmn_id": "sid-464B8E64-10B4-4158-BDEE-11144CE20306", + "bpmn_name": "", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "SCRIPTS_SUB": { + "name": "SCRIPTS_SUB", + "description": "Call Activity", + "manual": false, + "lookahead": 2, + "inputs": [ + "GATEWAY_SELECTED_TEST" + ], + "outputs": [ + "sid-464B8E64-10B4-4158-BDEE-11144CE20306" + ], + "bpmn_id": "SCRIPTS_SUB", + "bpmn_name": "Scripts", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "spec": "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545", + "typename": "CallActivity", + "extensions": {} + }, + "MESSAGE_INTERRUPTS_SUB": { + "name": "MESSAGE_INTERRUPTS_SUB", + "description": "Call Activity", + "manual": false, + "lookahead": 2, + "inputs": [ + "GATEWAY_SELECTED_TEST" + ], + "outputs": [ + "sid-464B8E64-10B4-4158-BDEE-11144CE20306" + ], + "bpmn_id": "MESSAGE_INTERRUPTS_SUB", + "bpmn_name": "Message Interrupts", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "spec": "sid-db1e1749-03ee-46aa-8674-bba07b1bd167", + "typename": "CallActivity", + "extensions": {} + }, + "MESSAGES_SUB": { + "name": "MESSAGES_SUB", + "description": "Call Activity", + "manual": false, + "lookahead": 2, + "inputs": [ + "GATEWAY_SELECTED_TEST" + ], + "outputs": [ + "sid-464B8E64-10B4-4158-BDEE-11144CE20306" + ], + "bpmn_id": "MESSAGES_SUB", + "bpmn_name": "Messages", + "lane": "Test Runner", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "spec": "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff", + "typename": "CallActivity", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "data": {}, + "correlations": {}, + "last_task": "7b159aef-caf0-45dc-9b39-f0ff0d81cd1c", + "success": true, + "tasks": { + "d8fe3899-d96f-40ed-ba9a-278ddf61a493": { + "id": "d8fe3899-d96f-40ed-ba9a-278ddf61a493", + "parent": null, + "children": [ + "bc0cd59c-c9b0-4164-8a97-53679003135f" + ], + "last_state_change": 1689261505.3256323, + "state": 64, + "task_spec": "Root", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "bc0cd59c-c9b0-4164-8a97-53679003135f": { + "id": "bc0cd59c-c9b0-4164-8a97-53679003135f", + "parent": "d8fe3899-d96f-40ed-ba9a-278ddf61a493", + "children": [ + "e944535a-f4eb-4cda-8ea3-314d8c1896fd" + ], + "last_state_change": 1689261505.3295662, + "state": 64, + "task_spec": "Start", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "e944535a-f4eb-4cda-8ea3-314d8c1896fd": { + "id": "e944535a-f4eb-4cda-8ea3-314d8c1896fd", + "parent": "bc0cd59c-c9b0-4164-8a97-53679003135f", + "children": [ + "4d30911b-0753-4831-a555-3d534bd60e4b" + ], + "last_state_change": 1689261505.331921, + "state": 64, + "task_spec": "sid-2C69C7A6-BD02-428F-B5AA-0BB10EC514C2", + "triggered": false, + "internal_data": { + "event_fired": true + }, + "data": {} + }, + "4d30911b-0753-4831-a555-3d534bd60e4b": { + "id": "4d30911b-0753-4831-a555-3d534bd60e4b", + "parent": "e944535a-f4eb-4cda-8ea3-314d8c1896fd", + "children": [ + "7b159aef-caf0-45dc-9b39-f0ff0d81cd1c" + ], + "last_state_change": 1689261505.3349278, + "state": 64, + "task_spec": "USER_INPUT_SELECT_TEST", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "7b159aef-caf0-45dc-9b39-f0ff0d81cd1c": { + "id": "7b159aef-caf0-45dc-9b39-f0ff0d81cd1c", + "parent": "4d30911b-0753-4831-a555-3d534bd60e4b", + "children": [ + "c590d85a-9dc4-4499-959b-0be0823dcc5e" + ], + "last_state_change": 1689261505.3381038, + "state": 64, + "task_spec": "GATEWAY_SELECTED_TEST", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "c590d85a-9dc4-4499-959b-0be0823dcc5e": { + "id": "c590d85a-9dc4-4499-959b-0be0823dcc5e", + "parent": "7b159aef-caf0-45dc-9b39-f0ff0d81cd1c", + "children": [ + "aae34a1e-f1b4-441c-a7d5-6072bdb5a2e4" + ], + "last_state_change": 1689261505.341215, + "state": 8, + "task_spec": "MESSAGE_NON_INTERRUPT_SUB", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "aae34a1e-f1b4-441c-a7d5-6072bdb5a2e4": { + "id": "aae34a1e-f1b4-441c-a7d5-6072bdb5a2e4", + "parent": "c590d85a-9dc4-4499-959b-0be0823dcc5e", + "children": [ + "324acc39-71d7-4be5-82c6-ffb2d5158c2e" + ], + "last_state_change": 1689261505.337358, + "state": 4, + "task_spec": "sid-464B8E64-10B4-4158-BDEE-11144CE20306", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "324acc39-71d7-4be5-82c6-ffb2d5158c2e": { + "id": "324acc39-71d7-4be5-82c6-ffb2d5158c2e", + "parent": "aae34a1e-f1b4-441c-a7d5-6072bdb5a2e4", + "children": [ + "b8bdd007-9099-4d47-b4aa-13772de65ff5" + ], + "last_state_change": 1689261505.3377411, + "state": 4, + "task_spec": "sid-b0903a88-fe74-4f93-b912-47b815ea8d1c.EndJoin", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "b8bdd007-9099-4d47-b4aa-13772de65ff5": { + "id": "b8bdd007-9099-4d47-b4aa-13772de65ff5", + "parent": "324acc39-71d7-4be5-82c6-ffb2d5158c2e", + "children": [], + "last_state_change": 1689261505.3378844, + "state": 4, + "task_spec": "End", + "triggered": false, + "internal_data": {}, + "data": {} + } + }, + "root": "d8fe3899-d96f-40ed-ba9a-278ddf61a493", + "subprocess_specs": { + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9": { + "name": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9", + "description": "Message Non Interrupt", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Message-Non-Interrupt.bpmn20.xml", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin": { + "name": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F": { + "name": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "bpmn_id": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992": { + "name": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "bpmn_name": "Do Something That Takes A Long Time", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent": { + "name": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "outputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "sid-067AF0E4-F644-4962-BC02-E767C63647D5" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "main_child_task_spec": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "typename": "_BoundaryEventParent" + }, + "sid-067AF0E4-F644-4962-BC02-E767C63647D5": { + "name": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "description": "Non-Interrupting Message Boundary Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "outputs": [ + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE" + ], + "bpmn_id": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "bpmn_name": "Test Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Message", + "name": "Test Message", + "correlation_properties": [], + "typename": "MessageEventDefinition" + }, + "cancel_activity": false, + "typename": "BoundaryEvent", + "extensions": {} + }, + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE": { + "name": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-067AF0E4-F644-4962-BC02-E767C63647D5" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "bpmn_name": "Acknowledge Non-Interrupt Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A": { + "name": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992" + ], + "outputs": [ + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin" + ], + "bpmn_id": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545": { + "name": "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545", + "description": "Scripts", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Scripts.bpmn20.xml", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "sid-8FEAF795-94B2-440D-802F-A1E3D06B2E8D" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545.EndJoin": { + "name": "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-11DD8628-C125-439E-B207-AE898139650B" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "sid-8FEAF795-94B2-440D-802F-A1E3D06B2E8D": { + "name": "sid-8FEAF795-94B2-440D-802F-A1E3D06B2E8D", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "sid-6C039219-F210-4984-B366-11C77DB35229" + ], + "bpmn_id": "sid-8FEAF795-94B2-440D-802F-A1E3D06B2E8D", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "sid-6C039219-F210-4984-B366-11C77DB35229": { + "name": "sid-6C039219-F210-4984-B366-11C77DB35229", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-8FEAF795-94B2-440D-802F-A1E3D06B2E8D" + ], + "outputs": [ + "sid-8BB6CFC5-D636-47D8-9AF6-0E45FD2F3B39" + ], + "bpmn_id": "sid-6C039219-F210-4984-B366-11C77DB35229", + "bpmn_name": "Select Type Of Change", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-8BB6CFC5-D636-47D8-9AF6-0E45FD2F3B39": { + "name": "sid-8BB6CFC5-D636-47D8-9AF6-0E45FD2F3B39", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-6C039219-F210-4984-B366-11C77DB35229" + ], + "outputs": [ + "sid-F7545D0E-08BD-4415-968E-CEF57C5261A9", + "sid-26E89636-8D64-4086-A71F-A225A5AA8F81" + ], + "bpmn_id": "sid-8BB6CFC5-D636-47D8-9AF6-0E45FD2F3B39", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": "choice == 'Temporary'", + "task_spec": "sid-F7545D0E-08BD-4415-968E-CEF57C5261A9" + }, + { + "condition": "choice == 'Permanent'", + "task_spec": "sid-26E89636-8D64-4086-A71F-A225A5AA8F81" + } + ], + "choice": null, + "default_task_spec": null, + "typename": "ExclusiveGateway", + "extensions": {} + }, + "sid-26E89636-8D64-4086-A71F-A225A5AA8F81": { + "name": "sid-26E89636-8D64-4086-A71F-A225A5AA8F81", + "description": "Script Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-8BB6CFC5-D636-47D8-9AF6-0E45FD2F3B39" + ], + "outputs": [ + "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC" + ], + "bpmn_id": "sid-26E89636-8D64-4086-A71F-A225A5AA8F81", + "bpmn_name": "Permanent Script", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "script": "record.log_some_interesting_value(sa_session, choice); record.change_type = choice", + "typename": "ScriptTask", + "extensions": {} + }, + "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC": { + "name": "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-26E89636-8D64-4086-A71F-A225A5AA8F81", + "sid-F7545D0E-08BD-4415-968E-CEF57C5261A9" + ], + "outputs": [ + "sid-F4C7A6CA-3D30-43FE-BDCE-17DFBE8C102E", + "sid-11DD8628-C125-439E-B207-AE898139650B" + ], + "bpmn_id": "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC", + "bpmn_name": "Emergency?", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": "priority = 'Emergency'", + "task_spec": "sid-F4C7A6CA-3D30-43FE-BDCE-17DFBE8C102E" + }, + { + "condition": null, + "task_spec": "sid-11DD8628-C125-439E-B207-AE898139650B" + } + ], + "choice": null, + "default_task_spec": "sid-11DD8628-C125-439E-B207-AE898139650B", + "typename": "ExclusiveGateway", + "extensions": {} + }, + "sid-11DD8628-C125-439E-B207-AE898139650B": { + "name": "sid-11DD8628-C125-439E-B207-AE898139650B", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-F4C7A6CA-3D30-43FE-BDCE-17DFBE8C102E", + "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC" + ], + "outputs": [ + "sid-e6cdd73d-0fd2-49b9-99f1-031f81f99545.EndJoin" + ], + "bpmn_id": "sid-11DD8628-C125-439E-B207-AE898139650B", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "sid-F4C7A6CA-3D30-43FE-BDCE-17DFBE8C102E": { + "name": "sid-F4C7A6CA-3D30-43FE-BDCE-17DFBE8C102E", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC" + ], + "outputs": [ + "sid-11DD8628-C125-439E-B207-AE898139650B" + ], + "bpmn_id": "sid-F4C7A6CA-3D30-43FE-BDCE-17DFBE8C102E", + "bpmn_name": "Acknowledge Emergency", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-F7545D0E-08BD-4415-968E-CEF57C5261A9": { + "name": "sid-F7545D0E-08BD-4415-968E-CEF57C5261A9", + "description": "Script Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-8BB6CFC5-D636-47D8-9AF6-0E45FD2F3B39" + ], + "outputs": [ + "sid-C621B8FC-0E3E-409C-A9D2-55188512C4CC" + ], + "bpmn_id": "sid-F7545D0E-08BD-4415-968E-CEF57C5261A9", + "bpmn_name": "Temp Script", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "script": "record.log_some_interesting_value(sa_session, choice); record.change_type = choice", + "typename": "ScriptTask", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "sid-db1e1749-03ee-46aa-8674-bba07b1bd167": { + "name": "sid-db1e1749-03ee-46aa-8674-bba07b1bd167", + "description": "Message Interrupts", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Message-Interrupts.bpmn20.xml", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "sid-db1e1749-03ee-46aa-8674-bba07b1bd167.EndJoin": { + "name": "sid-db1e1749-03ee-46aa-8674-bba07b1bd167.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-db1e1749-03ee-46aa-8674-bba07b1bd167.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F": { + "name": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "bpmn_id": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992": { + "name": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "bpmn_name": "Do Something That Takes A Long Time", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent": { + "name": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "outputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "sid-067AF0E4-F644-4962-BC02-E767C63647D5" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "main_child_task_spec": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "typename": "_BoundaryEventParent" + }, + "sid-067AF0E4-F644-4962-BC02-E767C63647D5": { + "name": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "description": "Interrupting Message Boundary Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "outputs": [ + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE" + ], + "bpmn_id": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "bpmn_name": "Test Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Message", + "name": "Test Message", + "correlation_properties": [], + "typename": "MessageEventDefinition" + }, + "cancel_activity": true, + "typename": "BoundaryEvent", + "extensions": {} + }, + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE": { + "name": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-067AF0E4-F644-4962-BC02-E767C63647D5" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "bpmn_name": "Acknowledge Interrupt Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A": { + "name": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992" + ], + "outputs": [ + "sid-db1e1749-03ee-46aa-8674-bba07b1bd167.EndJoin" + ], + "bpmn_id": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff": { + "name": "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff", + "description": "Messages", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Messages.bpmn20.xml", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff.EndJoin": { + "name": "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F": { + "name": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "sid-DF69AC93-16C3-405D-9FB1-9B2539519372" + ], + "bpmn_id": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "sid-DF69AC93-16C3-405D-9FB1-9B2539519372": { + "name": "sid-DF69AC93-16C3-405D-9FB1-9B2539519372", + "description": "Message Intermediate Catch Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-DF69AC93-16C3-405D-9FB1-9B2539519372", + "bpmn_name": "Test Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Message", + "name": "Test Message", + "correlation_properties": [], + "typename": "MessageEventDefinition" + }, + "typename": "IntermediateCatchEvent", + "extensions": {} + }, + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A": { + "name": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-DF69AC93-16C3-405D-9FB1-9B2539519372" + ], + "outputs": [ + "sid-4a1f10ab-316f-4cd8-836d-65aa3d178fff.EndJoin" + ], + "bpmn_id": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + } + }, + "subprocesses": { + "c590d85a-9dc4-4499-959b-0be0823dcc5e": { + "spec": { + "name": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9", + "description": "Message Non Interrupt", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Message-Non-Interrupt.bpmn20.xml", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin": { + "name": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F": { + "name": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "bpmn_id": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992": { + "name": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "bpmn_name": "Do Something That Takes A Long Time", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent": { + "name": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F" + ], + "outputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "sid-067AF0E4-F644-4962-BC02-E767C63647D5" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "main_child_task_spec": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "typename": "_BoundaryEventParent" + }, + "sid-067AF0E4-F644-4962-BC02-E767C63647D5": { + "name": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "description": "Non-Interrupting Message Boundary Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent" + ], + "outputs": [ + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE" + ], + "bpmn_id": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "bpmn_name": "Test Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Message", + "name": "Test Message", + "correlation_properties": [], + "typename": "MessageEventDefinition" + }, + "cancel_activity": false, + "typename": "BoundaryEvent", + "extensions": {} + }, + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE": { + "name": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "sid-067AF0E4-F644-4962-BC02-E767C63647D5" + ], + "outputs": [ + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A" + ], + "bpmn_id": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "bpmn_name": "Acknowledge Non-Interrupt Message", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A": { + "name": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992" + ], + "outputs": [ + "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin" + ], + "bpmn_id": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "bpmn_name": "", + "lane": "Tester", + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "data": {}, + "correlations": {}, + "last_task": "cf31adfe-fb24-4687-8f3b-1287deccb634", + "success": true, + "tasks": { + "e1771268-c75d-492c-9ab8-0f80cf357602": { + "id": "e1771268-c75d-492c-9ab8-0f80cf357602", + "parent": null, + "children": [ + "791948d6-2a96-4422-94f7-48cc252aa244" + ], + "last_state_change": 1689261505.338456, + "state": 64, + "task_spec": "Root", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "791948d6-2a96-4422-94f7-48cc252aa244": { + "id": "791948d6-2a96-4422-94f7-48cc252aa244", + "parent": "e1771268-c75d-492c-9ab8-0f80cf357602", + "children": [ + "d0244ae0-84c3-42ef-9121-5382839f569e" + ], + "last_state_change": 1689261505.343374, + "state": 64, + "task_spec": "Start", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "d0244ae0-84c3-42ef-9121-5382839f569e": { + "id": "d0244ae0-84c3-42ef-9121-5382839f569e", + "parent": "791948d6-2a96-4422-94f7-48cc252aa244", + "children": [ + "a9f73167-0062-481e-a9c0-b98b1d4ba620" + ], + "last_state_change": 1689261505.3443537, + "state": 64, + "task_spec": "sid-516421BF-6D56-4D23-87A5-6E8FC1E2636F", + "triggered": false, + "internal_data": { + "event_fired": true + }, + "data": { + "choice": "Message Non Interrupt" + } + }, + "a9f73167-0062-481e-a9c0-b98b1d4ba620": { + "id": "a9f73167-0062-481e-a9c0-b98b1d4ba620", + "parent": "d0244ae0-84c3-42ef-9121-5382839f569e", + "children": [ + "91b8bbe4-cfba-4b11-89ce-0893355eb08c", + "cf31adfe-fb24-4687-8f3b-1287deccb634" + ], + "last_state_change": 1689261505.3454466, + "state": 64, + "task_spec": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992.BoundaryEventParent", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "91b8bbe4-cfba-4b11-89ce-0893355eb08c": { + "id": "91b8bbe4-cfba-4b11-89ce-0893355eb08c", + "parent": "a9f73167-0062-481e-a9c0-b98b1d4ba620", + "children": [ + "ae0582d6-f3dc-460e-8ecd-8c06e6cac64e" + ], + "last_state_change": 1689261505.345582, + "state": 16, + "task_spec": "sid-6FBBB56D-00CD-4C2B-9345-486986BB4992", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "ae0582d6-f3dc-460e-8ecd-8c06e6cac64e": { + "id": "ae0582d6-f3dc-460e-8ecd-8c06e6cac64e", + "parent": "91b8bbe4-cfba-4b11-89ce-0893355eb08c", + "children": [ + "bc41c0b2-780b-4efd-8096-6cd1a0ce815a" + ], + "last_state_change": 1689261505.339256, + "state": 4, + "task_spec": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "bc41c0b2-780b-4efd-8096-6cd1a0ce815a": { + "id": "bc41c0b2-780b-4efd-8096-6cd1a0ce815a", + "parent": "ae0582d6-f3dc-460e-8ecd-8c06e6cac64e", + "children": [ + "b2707ce4-5e5e-4980-9d79-c5183af78cbf" + ], + "last_state_change": 1689261505.3393846, + "state": 4, + "task_spec": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "b2707ce4-5e5e-4980-9d79-c5183af78cbf": { + "id": "b2707ce4-5e5e-4980-9d79-c5183af78cbf", + "parent": "bc41c0b2-780b-4efd-8096-6cd1a0ce815a", + "children": [], + "last_state_change": 1689261505.3395112, + "state": 4, + "task_spec": "End", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "cf31adfe-fb24-4687-8f3b-1287deccb634": { + "id": "cf31adfe-fb24-4687-8f3b-1287deccb634", + "parent": "a9f73167-0062-481e-a9c0-b98b1d4ba620", + "children": [ + "01e3fcd8-6648-4795-b1dc-c6f3f9c522bc" + ], + "last_state_change": 1689261505.360199, + "state": 64, + "task_spec": "sid-067AF0E4-F644-4962-BC02-E767C63647D5", + "triggered": false, + "internal_data": { + "event_fired": false, + "Test Message": null + }, + "data": { + "choice": "Message Non Interrupt" + } + }, + "01e3fcd8-6648-4795-b1dc-c6f3f9c522bc": { + "id": "01e3fcd8-6648-4795-b1dc-c6f3f9c522bc", + "parent": "cf31adfe-fb24-4687-8f3b-1287deccb634", + "children": [ + "3436cf00-5ef4-4752-bdec-77560af42f69" + ], + "last_state_change": 1689261505.3609872, + "state": 16, + "task_spec": "sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE", + "triggered": false, + "internal_data": {}, + "data": { + "choice": "Message Non Interrupt" + } + }, + "3436cf00-5ef4-4752-bdec-77560af42f69": { + "id": "3436cf00-5ef4-4752-bdec-77560af42f69", + "parent": "01e3fcd8-6648-4795-b1dc-c6f3f9c522bc", + "children": [ + "de3587c9-52a2-477b-b978-d438de5721fc" + ], + "last_state_change": 1689261505.360624, + "state": 1, + "task_spec": "sid-B0D398F3-C33A-4113-B8BB-D7ABF6990C4A", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "de3587c9-52a2-477b-b978-d438de5721fc": { + "id": "de3587c9-52a2-477b-b978-d438de5721fc", + "parent": "3436cf00-5ef4-4752-bdec-77560af42f69", + "children": [], + "last_state_change": 1689261505.3608468, + "state": 1, + "task_spec": "sid-60e2cc58-68c9-4cb5-a95c-22e3e311b6b9.EndJoin", + "triggered": false, + "internal_data": {}, + "data": {} + } + }, + "root": "e1771268-c75d-492c-9ab8-0f80cf357602", + "parent_task_id": "c590d85a-9dc4-4499-959b-0be0823dcc5e" + } + }, + "bpmn_messages": [] +} diff --git a/tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events.json b/tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events.json new file mode 100644 index 00000000..944504a4 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/serialization/v1.2-boundary-events.json @@ -0,0 +1,1372 @@ +{ + "serializer_version": "1.2", + "spec": { + "name": "Main_Process", + "description": "Main_Process", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/transaction.bpmn", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "Start_Event" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "Main_Process.EndJoin": { + "name": "Main_Process.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "End_Event" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Main_Process.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start_Event": { + "name": "Start_Event", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "Subprocess.BoundaryEventParent" + ], + "bpmn_id": "Start_Event", + "bpmn_name": "Start", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "Subprocess": { + "name": "Subprocess", + "description": "Transaction", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess.BoundaryEventParent" + ], + "outputs": [ + "Activity_Print_Data" + ], + "bpmn_id": "Subprocess", + "bpmn_name": "Collect Data", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "spec": "Subprocess", + "typename": "TransactionSubprocess", + "extensions": {} + }, + "Subprocess.BoundaryEventParent": { + "name": "Subprocess.BoundaryEventParent", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start_Event" + ], + "outputs": [ + "Subprocess", + "Catch_Error_1", + "Catch_Error_None", + "Catch_Cancel_Event" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "main_child_task_spec": "Subprocess", + "typename": "_BoundaryEventParent" + }, + "Catch_Error_1": { + "name": "Catch_Error_1", + "description": "Interrupting Error Boundary Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess.BoundaryEventParent" + ], + "outputs": [ + "Error_1_Action" + ], + "bpmn_id": "Catch_Error_1", + "bpmn_name": "Catch Error 1", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Error", + "name": "TransactionError", + "error_code": "1", + "typename": "ErrorEventDefinition" + }, + "cancel_activity": true, + "typename": "BoundaryEvent", + "extensions": {} + }, + "Error_1_Action": { + "name": "Error_1_Action", + "description": "Script Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Catch_Error_1" + ], + "outputs": [], + "bpmn_id": "Error_1_Action", + "bpmn_name": "Error 1 Action", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "script": "reason = \"Error 1\"", + "typename": "ScriptTask", + "extensions": {} + }, + "Catch_Error_None": { + "name": "Catch_Error_None", + "description": "Interrupting Error Boundary Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess.BoundaryEventParent" + ], + "outputs": [ + "Error_None_Action" + ], + "bpmn_id": "Catch_Error_None", + "bpmn_name": "Catch Error None", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Error", + "name": "None Error Event", + "error_code": null, + "typename": "ErrorEventDefinition" + }, + "cancel_activity": true, + "typename": "BoundaryEvent", + "extensions": {} + }, + "Error_None_Action": { + "name": "Error_None_Action", + "description": "Script Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Catch_Error_None" + ], + "outputs": [], + "bpmn_id": "Error_None_Action", + "bpmn_name": "Error None Action", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "script": "reason = \"Error None\"", + "typename": "ScriptTask", + "extensions": {} + }, + "Catch_Cancel_Event": { + "name": "Catch_Cancel_Event", + "description": "Interrupting Cancel Boundary Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess.BoundaryEventParent" + ], + "outputs": [ + "Cancel_Action" + ], + "bpmn_id": "Catch_Cancel_Event", + "bpmn_name": "Catch Cancel Event", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Cancel", + "typename": "CancelEventDefinition" + }, + "cancel_activity": true, + "typename": "BoundaryEvent", + "extensions": {} + }, + "Cancel_Action": { + "name": "Cancel_Action", + "description": "Script Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Catch_Cancel_Event" + ], + "outputs": [], + "bpmn_id": "Cancel_Action", + "bpmn_name": "Cancel Action", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "script": "reason = \"Cancel\"", + "typename": "ScriptTask", + "extensions": {} + }, + "Activity_Print_Data": { + "name": "Activity_Print_Data", + "description": "Script Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess" + ], + "outputs": [ + "End_Event" + ], + "bpmn_id": "Activity_Print_Data", + "bpmn_name": "Print Data", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "script": "print(f\"Value: {value} / Quantity {quantity}\")", + "typename": "ScriptTask", + "extensions": {} + }, + "End_Event": { + "name": "End_Event", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Activity_Print_Data" + ], + "outputs": [ + "Main_Process.EndJoin" + ], + "bpmn_id": "End_Event", + "bpmn_name": "End Event", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "data": {}, + "correlations": {}, + "last_task": "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe", + "success": true, + "tasks": { + "2a762523-3704-4b78-ba94-0533c9dc9acd": { + "id": "2a762523-3704-4b78-ba94-0533c9dc9acd", + "parent": null, + "children": [ + "541ca877-058e-4301-8442-d9500e9d549a" + ], + "last_state_change": 1688572736.163045, + "state": 64, + "task_spec": "Root", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "541ca877-058e-4301-8442-d9500e9d549a": { + "id": "541ca877-058e-4301-8442-d9500e9d549a", + "parent": "2a762523-3704-4b78-ba94-0533c9dc9acd", + "children": [ + "2c84c432-7ee9-427c-a878-2c6aac21f849" + ], + "last_state_change": 1688572736.1688027, + "state": 64, + "task_spec": "Start", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "2c84c432-7ee9-427c-a878-2c6aac21f849": { + "id": "2c84c432-7ee9-427c-a878-2c6aac21f849", + "parent": "541ca877-058e-4301-8442-d9500e9d549a", + "children": [ + "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe" + ], + "last_state_change": 1688572736.1705842, + "state": 64, + "task_spec": "Start_Event", + "triggered": false, + "internal_data": { + "event_fired": true + }, + "data": {} + }, + "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe": { + "id": "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe", + "parent": "2c84c432-7ee9-427c-a878-2c6aac21f849", + "children": [ + "ff5f617b-a248-44fb-bf9c-963aec03af7b", + "84c2b1ee-259e-4d9d-9a14-99c438dff736", + "421748df-542d-4ca3-87b6-1df8f1d8c35c", + "871f66d7-6d53-4482-8e99-a17cdf3c3e5f" + ], + "last_state_change": 1688572736.1722405, + "state": 64, + "task_spec": "Subprocess.BoundaryEventParent", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "ff5f617b-a248-44fb-bf9c-963aec03af7b": { + "id": "ff5f617b-a248-44fb-bf9c-963aec03af7b", + "parent": "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe", + "children": [ + "adbfc6e5-82d1-4f32-bb0c-4460ba1a6a2e" + ], + "last_state_change": 1688572736.1745574, + "state": 8, + "task_spec": "Subprocess", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "adbfc6e5-82d1-4f32-bb0c-4460ba1a6a2e": { + "id": "adbfc6e5-82d1-4f32-bb0c-4460ba1a6a2e", + "parent": "ff5f617b-a248-44fb-bf9c-963aec03af7b", + "children": [ + "e6fd033a-c011-4fbb-80f2-ddc29b48d2d6" + ], + "last_state_change": 1688572736.166182, + "state": 4, + "task_spec": "Activity_Print_Data", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "e6fd033a-c011-4fbb-80f2-ddc29b48d2d6": { + "id": "e6fd033a-c011-4fbb-80f2-ddc29b48d2d6", + "parent": "adbfc6e5-82d1-4f32-bb0c-4460ba1a6a2e", + "children": [ + "0d88c93f-7862-4049-ad7d-b80b1b4bff33" + ], + "last_state_change": 1688572736.1663244, + "state": 4, + "task_spec": "End_Event", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "0d88c93f-7862-4049-ad7d-b80b1b4bff33": { + "id": "0d88c93f-7862-4049-ad7d-b80b1b4bff33", + "parent": "e6fd033a-c011-4fbb-80f2-ddc29b48d2d6", + "children": [ + "e3a90cc9-0e9e-48a7-a702-322155ecdaf9" + ], + "last_state_change": 1688572736.1664557, + "state": 4, + "task_spec": "Main_Process.EndJoin", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "e3a90cc9-0e9e-48a7-a702-322155ecdaf9": { + "id": "e3a90cc9-0e9e-48a7-a702-322155ecdaf9", + "parent": "0d88c93f-7862-4049-ad7d-b80b1b4bff33", + "children": [], + "last_state_change": 1688572736.1665893, + "state": 4, + "task_spec": "End", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "84c2b1ee-259e-4d9d-9a14-99c438dff736": { + "id": "84c2b1ee-259e-4d9d-9a14-99c438dff736", + "parent": "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe", + "children": [ + "70aacb1b-0763-4927-93f9-322dc5331d59" + ], + "last_state_change": 1688572736.1720812, + "state": 8, + "task_spec": "Catch_Error_1", + "triggered": false, + "internal_data": { + "event_fired": false + }, + "data": {} + }, + "70aacb1b-0763-4927-93f9-322dc5331d59": { + "id": "70aacb1b-0763-4927-93f9-322dc5331d59", + "parent": "84c2b1ee-259e-4d9d-9a14-99c438dff736", + "children": [], + "last_state_change": 1688572736.1668055, + "state": 1, + "task_spec": "Error_1_Action", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "421748df-542d-4ca3-87b6-1df8f1d8c35c": { + "id": "421748df-542d-4ca3-87b6-1df8f1d8c35c", + "parent": "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe", + "children": [ + "9bc1d28a-d4d7-4b77-a1e9-8b7fdd89cea2" + ], + "last_state_change": 1688572736.1721296, + "state": 8, + "task_spec": "Catch_Error_None", + "triggered": false, + "internal_data": { + "event_fired": false + }, + "data": {} + }, + "9bc1d28a-d4d7-4b77-a1e9-8b7fdd89cea2": { + "id": "9bc1d28a-d4d7-4b77-a1e9-8b7fdd89cea2", + "parent": "421748df-542d-4ca3-87b6-1df8f1d8c35c", + "children": [], + "last_state_change": 1688572736.1669466, + "state": 1, + "task_spec": "Error_None_Action", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "871f66d7-6d53-4482-8e99-a17cdf3c3e5f": { + "id": "871f66d7-6d53-4482-8e99-a17cdf3c3e5f", + "parent": "5454ac95-fcfb-4c6d-a0fb-ef62cfcaefbe", + "children": [ + "40acea69-ed93-4bdc-84e3-cd7fdc1d3501" + ], + "last_state_change": 1688572736.17217, + "state": 8, + "task_spec": "Catch_Cancel_Event", + "triggered": false, + "internal_data": { + "event_fired": false + }, + "data": {} + }, + "40acea69-ed93-4bdc-84e3-cd7fdc1d3501": { + "id": "40acea69-ed93-4bdc-84e3-cd7fdc1d3501", + "parent": "871f66d7-6d53-4482-8e99-a17cdf3c3e5f", + "children": [], + "last_state_change": 1688572736.16709, + "state": 1, + "task_spec": "Cancel_Action", + "triggered": false, + "internal_data": {}, + "data": {} + } + }, + "root": "2a762523-3704-4b78-ba94-0533c9dc9acd", + "subprocess_specs": { + "Subprocess": { + "name": "Subprocess", + "description": "Collect Data", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/transaction.bpmn", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "Start_Subprocess" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "Subprocess.EndJoin": { + "name": "Subprocess.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "End_Subprocess", + "Error_1", + "Error_None", + "Cancel_Event" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start_Subprocess": { + "name": "Start_Subprocess", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "Activity_Get_Data" + ], + "bpmn_id": "Start_Subprocess", + "bpmn_name": "Start Subprocess", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "Activity_Get_Data": { + "name": "Activity_Get_Data", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "Start_Subprocess" + ], + "outputs": [ + "Check_Data" + ], + "bpmn_id": "Activity_Get_Data", + "bpmn_name": "Get Data", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "Check_Data": { + "name": "Check_Data", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "Activity_Get_Data" + ], + "outputs": [ + "Activity_Get_Quantity", + "Cancel_Event" + ], + "bpmn_id": "Check_Data", + "bpmn_name": "Check Data", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": null, + "task_spec": "Activity_Get_Quantity" + }, + { + "condition": "value == \"\"", + "task_spec": "Cancel_Event" + } + ], + "choice": null, + "default_task_spec": "Activity_Get_Quantity", + "typename": "ExclusiveGateway", + "extensions": {} + }, + "Activity_Get_Quantity": { + "name": "Activity_Get_Quantity", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "Check_Data" + ], + "outputs": [ + "Check_Quantity" + ], + "bpmn_id": "Activity_Get_Quantity", + "bpmn_name": "Get Quantity", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "Check_Quantity": { + "name": "Check_Quantity", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "Activity_Get_Quantity" + ], + "outputs": [ + "End_Subprocess", + "Error_1", + "Error_None" + ], + "bpmn_id": "Check_Quantity", + "bpmn_name": "Check Quantity", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": null, + "task_spec": "End_Subprocess" + }, + { + "condition": "quantity < 0", + "task_spec": "Error_1" + }, + { + "condition": "quantity == 0", + "task_spec": "Error_None" + } + ], + "choice": null, + "default_task_spec": "End_Subprocess", + "typename": "ExclusiveGateway", + "extensions": {} + }, + "End_Subprocess": { + "name": "End_Subprocess", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Quantity" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "End_Subprocess", + "bpmn_name": "End Subprocess", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Error_1": { + "name": "Error_1", + "description": "Error End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Quantity" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "Error_1", + "bpmn_name": "Error 1", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Error", + "name": "TransactionError", + "error_code": "1", + "typename": "ErrorEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Error_None": { + "name": "Error_None", + "description": "Error End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Quantity" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "Error_None", + "bpmn_name": "Error_None", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Error", + "name": "None Error Event", + "error_code": null, + "typename": "ErrorEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Cancel_Event": { + "name": "Cancel_Event", + "description": "Cancel End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Data" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "Cancel_Event", + "bpmn_name": "Cancel Event", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Cancel", + "typename": "CancelEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + } + }, + "subprocesses": { + "ff5f617b-a248-44fb-bf9c-963aec03af7b": { + "spec": { + "name": "Subprocess", + "description": "Collect Data", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/transaction.bpmn", + "task_specs": { + "Root": { + "name": "Root", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start": { + "name": "Start", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "Start_Subprocess" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "BpmnStartTask" + }, + "Subprocess.EndJoin": { + "name": "Subprocess.EndJoin", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "End_Subprocess", + "Error_1", + "Error_None", + "Cancel_Event" + ], + "outputs": [ + "End" + ], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "_EndJoin" + }, + "End": { + "name": "End", + "description": "BPMN Task", + "manual": false, + "lookahead": 2, + "inputs": [ + "Subprocess.EndJoin" + ], + "outputs": [], + "bpmn_id": null, + "bpmn_name": null, + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "SimpleBpmnTask" + }, + "Start_Subprocess": { + "name": "Start_Subprocess", + "description": "Default Start Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Start" + ], + "outputs": [ + "Activity_Get_Data" + ], + "bpmn_id": "Start_Subprocess", + "bpmn_name": "Start Subprocess", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "Activity_Get_Data": { + "name": "Activity_Get_Data", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "Start_Subprocess" + ], + "outputs": [ + "Check_Data" + ], + "bpmn_id": "Activity_Get_Data", + "bpmn_name": "Get Data", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "Check_Data": { + "name": "Check_Data", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "Activity_Get_Data" + ], + "outputs": [ + "Activity_Get_Quantity", + "Cancel_Event" + ], + "bpmn_id": "Check_Data", + "bpmn_name": "Check Data", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": null, + "task_spec": "Activity_Get_Quantity" + }, + { + "condition": "value == \"\"", + "task_spec": "Cancel_Event" + } + ], + "choice": null, + "default_task_spec": "Activity_Get_Quantity", + "typename": "ExclusiveGateway", + "extensions": {} + }, + "Activity_Get_Quantity": { + "name": "Activity_Get_Quantity", + "description": "User Task", + "manual": true, + "lookahead": 2, + "inputs": [ + "Check_Data" + ], + "outputs": [ + "Check_Quantity" + ], + "bpmn_id": "Activity_Get_Quantity", + "bpmn_name": "Get Quantity", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "typename": "UserTask", + "extensions": {} + }, + "Check_Quantity": { + "name": "Check_Quantity", + "description": "Exclusive Gateway", + "manual": false, + "lookahead": 2, + "inputs": [ + "Activity_Get_Quantity" + ], + "outputs": [ + "End_Subprocess", + "Error_1", + "Error_None" + ], + "bpmn_id": "Check_Quantity", + "bpmn_name": "Check Quantity", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "cond_task_specs": [ + { + "condition": null, + "task_spec": "End_Subprocess" + }, + { + "condition": "quantity < 0", + "task_spec": "Error_1" + }, + { + "condition": "quantity == 0", + "task_spec": "Error_None" + } + ], + "choice": null, + "default_task_spec": "End_Subprocess", + "typename": "ExclusiveGateway", + "extensions": {} + }, + "End_Subprocess": { + "name": "End_Subprocess", + "description": "Default End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Quantity" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "End_Subprocess", + "bpmn_name": "End Subprocess", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": false, + "description": "Default", + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Error_1": { + "name": "Error_1", + "description": "Error End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Quantity" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "Error_1", + "bpmn_name": "Error 1", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Error", + "name": "TransactionError", + "error_code": "1", + "typename": "ErrorEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Error_None": { + "name": "Error_None", + "description": "Error End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Quantity" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "Error_None", + "bpmn_name": "Error_None", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Error", + "name": "None Error Event", + "error_code": null, + "typename": "ErrorEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Cancel_Event": { + "name": "Cancel_Event", + "description": "Cancel End Event", + "manual": false, + "lookahead": 2, + "inputs": [ + "Check_Data" + ], + "outputs": [ + "Subprocess.EndJoin" + ], + "bpmn_id": "Cancel_Event", + "bpmn_name": "Cancel Event", + "lane": null, + "documentation": null, + "data_input_associations": [], + "data_output_associations": [], + "io_specification": null, + "event_definition": { + "internal": false, + "external": true, + "description": "Cancel", + "typename": "CancelEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + } + }, + "io_specification": null, + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "data": {}, + "correlations": {}, + "last_task": "e26ab40a-2da9-4cd3-aa63-dba5bdc54a41", + "success": true, + "tasks": { + "0981472d-b16c-49b1-a1a7-1057fcf76ccb": { + "id": "0981472d-b16c-49b1-a1a7-1057fcf76ccb", + "parent": null, + "children": [ + "30f56386-ecf0-4ecd-96b8-b7bbd968b948" + ], + "last_state_change": 1688572736.1725495, + "state": 64, + "task_spec": "Root", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "30f56386-ecf0-4ecd-96b8-b7bbd968b948": { + "id": "30f56386-ecf0-4ecd-96b8-b7bbd968b948", + "parent": "0981472d-b16c-49b1-a1a7-1057fcf76ccb", + "children": [ + "e26ab40a-2da9-4cd3-aa63-dba5bdc54a41" + ], + "last_state_change": 1688572736.1771119, + "state": 64, + "task_spec": "Start", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "e26ab40a-2da9-4cd3-aa63-dba5bdc54a41": { + "id": "e26ab40a-2da9-4cd3-aa63-dba5bdc54a41", + "parent": "30f56386-ecf0-4ecd-96b8-b7bbd968b948", + "children": [ + "9d265678-2025-40a5-81b9-a15f2b0d7efe" + ], + "last_state_change": 1688572736.1782155, + "state": 64, + "task_spec": "Start_Subprocess", + "triggered": false, + "internal_data": { + "event_fired": true + }, + "data": {} + }, + "9d265678-2025-40a5-81b9-a15f2b0d7efe": { + "id": "9d265678-2025-40a5-81b9-a15f2b0d7efe", + "parent": "e26ab40a-2da9-4cd3-aa63-dba5bdc54a41", + "children": [ + "44799bd2-3c87-4f91-8503-6e83ae0fa103" + ], + "last_state_change": 1688572736.1784077, + "state": 16, + "task_spec": "Activity_Get_Data", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "44799bd2-3c87-4f91-8503-6e83ae0fa103": { + "id": "44799bd2-3c87-4f91-8503-6e83ae0fa103", + "parent": "9d265678-2025-40a5-81b9-a15f2b0d7efe", + "children": [ + "4d6d3ec0-3bdc-4385-b70e-a028dd59c4f1", + "9345ade1-3acc-40aa-9ee1-0d8725e92e4a" + ], + "last_state_change": 1688572736.1730845, + "state": 4, + "task_spec": "Check_Data", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "4d6d3ec0-3bdc-4385-b70e-a028dd59c4f1": { + "id": "4d6d3ec0-3bdc-4385-b70e-a028dd59c4f1", + "parent": "44799bd2-3c87-4f91-8503-6e83ae0fa103", + "children": [ + "28bcba71-8185-46ca-9a5a-fae211889591" + ], + "last_state_change": 1688572736.1732779, + "state": 2, + "task_spec": "Activity_Get_Quantity", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "28bcba71-8185-46ca-9a5a-fae211889591": { + "id": "28bcba71-8185-46ca-9a5a-fae211889591", + "parent": "4d6d3ec0-3bdc-4385-b70e-a028dd59c4f1", + "children": [], + "last_state_change": 1688572736.1734755, + "state": 2, + "task_spec": "Check_Quantity", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "9345ade1-3acc-40aa-9ee1-0d8725e92e4a": { + "id": "9345ade1-3acc-40aa-9ee1-0d8725e92e4a", + "parent": "44799bd2-3c87-4f91-8503-6e83ae0fa103", + "children": [ + "eaf10263-49d3-4670-bd41-7eceb9aabc93" + ], + "last_state_change": 1688572736.173326, + "state": 1, + "task_spec": "Cancel_Event", + "triggered": false, + "internal_data": {}, + "data": {} + }, + "eaf10263-49d3-4670-bd41-7eceb9aabc93": { + "id": "eaf10263-49d3-4670-bd41-7eceb9aabc93", + "parent": "9345ade1-3acc-40aa-9ee1-0d8725e92e4a", + "children": [], + "last_state_change": 1688572736.1736495, + "state": 1, + "task_spec": "Subprocess.EndJoin", + "triggered": false, + "internal_data": {}, + "data": {} + } + }, + "root": "0981472d-b16c-49b1-a1a7-1057fcf76ccb", + "parent_task_id": "ff5f617b-a248-44fb-bf9c-963aec03af7b" + } + }, + "bpmn_messages": [] +} diff --git a/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py b/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py index c0a8de01..bfc95185 100644 --- a/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py +++ b/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py @@ -48,7 +48,6 @@ class ActionManagementTest(BpmnWorkflowTestCase): self.do_next_named_step("Complete Work", choice="Done") self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertTrue(self.workflow.is_completed()) @@ -74,7 +73,7 @@ class ActionManagementTest(BpmnWorkflowTestCase): time.sleep(self.FINISH_TIME_DELTA) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() - self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) + self.assertEqual(3, len(self.workflow.get_tasks(TaskState.WAITING))) self.assertNotEqual('Finish Time', self.workflow.get_tasks(TaskState.WAITING)[0].task_spec.bpmn_name) overdue_escalation_task = [ @@ -86,8 +85,6 @@ class ActionManagementTest(BpmnWorkflowTestCase): self.do_next_named_step("Complete Work", choice="Done") self.workflow.do_engine_steps() - self.complete_subworkflow() - self.assertTrue(self.workflow.is_completed()) def testRunThroughCancel(self): diff --git a/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py b/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py index 9ef11e41..e8bae0e5 100644 --- a/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py +++ b/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py @@ -80,7 +80,6 @@ class CallActivityEscalationTest(BpmnWorkflowTestCase): for task in self.workflow.get_tasks(TaskState.READY): task.set_data(should_escalate=False) self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.workflow.run_all() self.assertEqual(True, self.workflow.is_completed()) diff --git a/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py b/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py index e5c99004..811ddc41 100644 --- a/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py +++ b/tests/SpiffWorkflow/bpmn/events/EventBasedGatewayTest.py @@ -1,9 +1,10 @@ from datetime import timedelta from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from SpiffWorkflow.bpmn.event import BpmnEvent, BpmnEvent from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import TaskDataEnvironment -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from SpiffWorkflow.task import TaskState from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -29,7 +30,7 @@ class EventBasedGatewayTest(BpmnWorkflowTestCase): self.save_restore() self.workflow.script_engine = self.script_engine self.assertEqual(len(waiting_tasks), 2) - self.workflow.catch(MessageEventDefinition('message_1')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('message_1'), {})) self.workflow.do_engine_steps() self.workflow.refresh_waiting_tasks() self.assertEqual(self.workflow.is_completed(), True) @@ -42,8 +43,8 @@ class EventBasedGatewayTest(BpmnWorkflowTestCase): self.workflow.do_engine_steps() waiting_tasks = self.workflow.get_waiting_tasks() self.assertEqual(len(waiting_tasks), 2) - timer_event = waiting_tasks[0].task_spec.event_definition.event_definitions[-1] - self.workflow.catch(timer_event) + timer_event_definition = waiting_tasks[0].task_spec.event_definition.event_definitions[-1] + self.workflow.catch(BpmnEvent(timer_event_definition)) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() self.assertEqual(self.workflow.is_completed(), True) @@ -55,7 +56,7 @@ class EventBasedGatewayTest(BpmnWorkflowTestCase): spec, subprocess = self.load_workflow_spec('multiple-start-parallel.bpmn', 'main') workflow = BpmnWorkflow(spec) workflow.do_engine_steps() - workflow.catch(MessageEventDefinition('message_1')) - workflow.catch(MessageEventDefinition('message_2')) + workflow.catch(BpmnEvent(MessageEventDefinition('message_1'), {})) + workflow.catch(BpmnEvent(MessageEventDefinition('message_2'), {})) workflow.refresh_waiting_tasks() workflow.do_engine_steps() diff --git a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py index c36b43ef..b11e1d48 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py @@ -2,7 +2,8 @@ from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.event import BpmnEvent +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'matth' @@ -29,7 +30,6 @@ class MessageInterruptsSpTest(BpmnWorkflowTestCase): self.do_next_exclusive_step('Do Something In a Subprocess') self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.do_next_exclusive_step('Ack Subprocess Done') @@ -50,7 +50,7 @@ class MessageInterruptsSpTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.workflow.do_engine_steps() self.save_restore() diff --git a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py index 3fd35b00..87f35cba 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py @@ -4,7 +4,8 @@ import unittest from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.event import BpmnEvent +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'matth' @@ -33,7 +34,6 @@ class MessageInterruptsTest(BpmnWorkflowTestCase): self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.WAITING))) self.save_restore() @@ -52,7 +52,7 @@ class MessageInterruptsTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.save_restore() self.workflow.do_engine_steps() @@ -64,7 +64,6 @@ class MessageInterruptsTest(BpmnWorkflowTestCase): self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) @@ -80,7 +79,6 @@ class MessageInterruptsTest(BpmnWorkflowTestCase): self.do_next_exclusive_step('Do Something That Takes A Long Time') self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.WAITING))) self.workflow.do_engine_steps() @@ -95,7 +93,7 @@ class MessageInterruptsTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.workflow.do_engine_steps() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.WAITING))) @@ -104,7 +102,6 @@ class MessageInterruptsTest(BpmnWorkflowTestCase): self.do_next_exclusive_step('Acknowledge Interrupt Message') self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) diff --git a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py index 6674bf01..4d5e50bf 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.event import BpmnEvent +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'matth' @@ -19,8 +20,7 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.workflow = BpmnWorkflow(self.spec, self.subprocesses) self.save_restore() - self.do_next_exclusive_step( - 'Select Test', choice='Message Non Interrupt') + self.do_next_exclusive_step('Select Test', choice='Message Non Interrupt') self.workflow.do_engine_steps() self.save_restore() @@ -31,7 +31,6 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.WAITING))) self.save_restore() @@ -43,19 +42,18 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.workflow = BpmnWorkflow(self.spec, self.subprocesses) self.save_restore() - self.do_next_exclusive_step( - 'Select Test', choice='Message Non Interrupt') + self.do_next_exclusive_step('Select Test', choice='Message Non Interrupt') self.workflow.do_engine_steps() self.save_restore() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.save_restore() self.workflow.do_engine_steps() - self.assertEqual(1, len(self.workflow.get_tasks(TaskState.WAITING))) + self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.READY))) self.do_next_named_step('Acknowledge Non-Interrupt Message') @@ -71,14 +69,12 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) def testRunThroughHappy(self): self.workflow = BpmnWorkflow(self.spec, self.subprocesses) - self.do_next_exclusive_step( - 'Select Test', choice='Message Non Interrupt') + self.do_next_exclusive_step('Select Test', choice='Message Non Interrupt') self.workflow.do_engine_steps() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) @@ -87,7 +83,6 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.do_next_exclusive_step('Do Something That Takes A Long Time') self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.WAITING))) self.workflow.do_engine_steps() @@ -96,45 +91,42 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): def testRunThroughMessageInterrupt(self): self.workflow = BpmnWorkflow(self.spec, self.subprocesses) - self.do_next_exclusive_step( - 'Select Test', choice='Message Non Interrupt') + self.do_next_exclusive_step('Select Test', choice='Message Non Interrupt') self.workflow.do_engine_steps() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.workflow.do_engine_steps() - self.assertEqual(1, len(self.workflow.get_tasks(TaskState.WAITING))) + self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.READY))) self.do_next_named_step('Acknowledge Non-Interrupt Message') self.workflow.do_engine_steps() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) - self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) + self.assertEqual(3, len(self.workflow.get_tasks(TaskState.WAITING))) self.do_next_named_step('Do Something That Takes A Long Time') self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) def testRunThroughMessageInterruptOtherOrder(self): self.workflow = BpmnWorkflow(self.spec, self.subprocesses) - self.do_next_exclusive_step( - 'Select Test', choice='Message Non Interrupt') + self.do_next_exclusive_step('Select Test', choice='Message Non Interrupt') self.workflow.do_engine_steps() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.workflow.do_engine_steps() - self.assertEqual(1, len(self.workflow.get_tasks(TaskState.WAITING))) + self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.READY))) self.do_next_named_step('Do Something That Takes A Long Time') @@ -145,7 +137,6 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.do_next_named_step('Acknowledge Non-Interrupt Message') self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) def testRunThroughMessageInterruptOtherOrderSaveAndRestore(self): @@ -160,11 +151,11 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.save_restore() self.workflow.do_engine_steps() - self.assertEqual(1, len(self.workflow.get_tasks(TaskState.WAITING))) + self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.READY))) self.do_next_named_step('Do Something That Takes A Long Time') @@ -177,5 +168,4 @@ class MessageNonInterruptTest(BpmnWorkflowTestCase): self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) diff --git a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py index 947a4844..8b1144c7 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.event import BpmnEvent +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'matth' @@ -28,7 +29,6 @@ class MessageNonInterruptsSpTest(BpmnWorkflowTestCase): self.do_next_exclusive_step('Do Something In a Subprocess') self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.do_next_exclusive_step('Ack Subprocess Done') @@ -49,11 +49,10 @@ class MessageNonInterruptsSpTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.do_next_named_step('Do Something In a Subprocess') self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.do_next_named_step('Ack Subprocess Done') @@ -78,10 +77,9 @@ class MessageNonInterruptsSpTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.do_next_named_step('Do Something In a Subprocess') self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.do_next_named_step('Acknowledge SP Parallel Message') @@ -106,7 +104,7 @@ class MessageNonInterruptsSpTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.do_next_named_step('Acknowledge SP Parallel Message') self.workflow.do_engine_steps() @@ -114,7 +112,6 @@ class MessageNonInterruptsSpTest(BpmnWorkflowTestCase): self.do_next_named_step('Do Something In a Subprocess') self.workflow.do_engine_steps() - self.complete_subworkflow() self.save_restore() self.do_next_named_step('Ack Subprocess Done') diff --git a/tests/SpiffWorkflow/bpmn/events/MessagesTest.py b/tests/SpiffWorkflow/bpmn/events/MessagesTest.py index eb06ed18..3e5f12aa 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessagesTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessagesTest.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.event import BpmnEvent +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'matth' @@ -22,15 +23,14 @@ class MessagesTest(BpmnWorkflowTestCase): self.workflow.do_engine_steps() self.assertEqual([], self.workflow.get_tasks(TaskState.READY)) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Wrong Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Wrong Message'), {})) self.assertEqual([], self.workflow.get_tasks(TaskState.READY)) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.assertEqual('Test Message', self.workflow.get_tasks(TaskState.READY)[0].task_spec.bpmn_name) self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) def testRunThroughSaveAndRestore(self): @@ -43,13 +43,12 @@ class MessagesTest(BpmnWorkflowTestCase): self.assertEqual([], self.workflow.get_tasks(TaskState.READY)) self.assertEqual(2, len(self.workflow.get_tasks(TaskState.WAITING))) - self.workflow.catch(MessageEventDefinition('Wrong Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Wrong Message'), {})) self.assertEqual([], self.workflow.get_tasks(TaskState.READY)) - self.workflow.catch(MessageEventDefinition('Test Message')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('Test Message'), {})) self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(0, len(self.workflow.get_tasks(TaskState.READY | TaskState.WAITING))) diff --git a/tests/SpiffWorkflow/bpmn/events/MultipleCatchEventTest.py b/tests/SpiffWorkflow/bpmn/events/MultipleCatchEventTest.py index 3d31aac9..035b5400 100644 --- a/tests/SpiffWorkflow/bpmn/events/MultipleCatchEventTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MultipleCatchEventTest.py @@ -1,5 +1,6 @@ from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.specs.event_definitions import MessageEventDefinition +from SpiffWorkflow.bpmn.event import BpmnEvent +from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -28,7 +29,7 @@ class MultipleStartEventTest(BpmnWorkflowTestCase): self.assertEqual(len(waiting_tasks), 1) self.assertEqual(waiting_tasks[0].task_spec.name, 'StartEvent_1') - self.workflow.catch(MessageEventDefinition('message_1')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('message_1'), {})) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() @@ -62,7 +63,7 @@ class ParallelStartEventTest(BpmnWorkflowTestCase): self.assertEqual(len(waiting_tasks), 1) self.assertEqual(waiting_tasks[0].task_spec.name, 'StartEvent_1') - self.workflow.catch(MessageEventDefinition('message_1')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('message_1'), {})) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() @@ -71,11 +72,11 @@ class ParallelStartEventTest(BpmnWorkflowTestCase): self.assertEqual(len(waiting_tasks), 1) self.assertEqual(waiting_tasks[0].task_spec.name, 'StartEvent_1') - self.workflow.catch(MessageEventDefinition('message_2')) + self.workflow.catch(BpmnEvent(MessageEventDefinition('message_2'), {})) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() # Now the first task should be ready ready_tasks = self.workflow.get_ready_user_tasks() self.assertEqual(len(ready_tasks), 1) - self.assertEqual(ready_tasks[0].task_spec.name, 'any_task') \ No newline at end of file + self.assertEqual(ready_tasks[0].task_spec.name, 'any_task') diff --git a/tests/SpiffWorkflow/bpmn/events/MultipleEventsTest.py b/tests/SpiffWorkflow/bpmn/events/MultipleEventsTest.py deleted file mode 100644 index f0c8c168..00000000 --- a/tests/SpiffWorkflow/bpmn/events/MultipleEventsTest.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -import unittest - -from SpiffWorkflow.bpmn.specs.event_definitions import CancelEventDefinition, SignalEventDefinition -from SpiffWorkflow.task import TaskState -from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase - -__author__ = 'kellym' - - -class MultipleEventsTest(BpmnWorkflowTestCase): - - def setUp(self): - self.spec, self.subprocesses = self.load_workflow_spec('multipleEvents.bpmn', 'SignalAndCancel') - self.workflow = BpmnWorkflow(self.spec, self.subprocesses) - self.workflow.do_engine_steps() - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual("hello", ready_tasks[0].get_name()) - - def test_cancel_does_nothing_if_no_one_is_listening(self,save_restore = False): - - # Send cancel notifications to the workflow - self.workflow.catch(SignalEventDefinition('cancel')) # generate a cancel signal. - self.workflow.catch(CancelEventDefinition()) - - # Nothing should have happened. - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual("hello", ready_tasks[0].get_name()) - - def test_cancel_works_with_signal(self,save_restore = False): - - task = self.workflow.get_tasks(TaskState.READY)[0] - - # Move to User Task 1 - self.workflow.run_task_from_id(task.id) - self.workflow.do_engine_steps() - task = self.workflow.get_tasks(TaskState.READY)[0] - self.assertEqual('UserTaskOne', task.get_name()) - - # Send cancel notifications to the workflow - self.workflow.catch(SignalEventDefinition('cancel')) # generate a cancel signal. - self.workflow.catch(CancelEventDefinition()) - self.workflow.do_engine_steps() - - # The cancel event should have been called. - self.assertEqual("cancel_signal", self.workflow.last_task.data['cancel']) - - - def test_cancel_works_with_cancel_Event(self,save_restore = False): - - task = self.workflow.get_tasks(TaskState.READY)[0] - - # Move to User Task 2 - self.workflow.run_task_from_id(task.id) - self.workflow.do_engine_steps() - task = self.workflow.get_tasks(TaskState.READY)[0] - self.workflow.run_task_from_id(task.id) - self.workflow.do_engine_steps() - task = self.workflow.get_tasks(TaskState.READY)[0] - self.assertEqual('UserTaskTwo', task.get_name()) - - # Send cancel notifications to the workflow - self.workflow.catch(SignalEventDefinition('cancel')) # generate a cancel signal. - self.workflow.catch(CancelEventDefinition()) - self.workflow.do_engine_steps() - - # The cancel event shave h - self.assertEqual("cancel_event", self.workflow.last_task.data['cancel']) - - -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(MultipleEventsTest) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/bpmn/events/MultipleThrowEventTest.py b/tests/SpiffWorkflow/bpmn/events/MultipleThrowEventTest.py index 0b7b383f..031a1643 100644 --- a/tests/SpiffWorkflow/bpmn/events/MultipleThrowEventTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MultipleThrowEventTest.py @@ -19,7 +19,6 @@ class MultipleThrowEventIntermediateCatchTest(BpmnWorkflowTestCase): if save_restore: self.save_restore() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(len(self.workflow.get_waiting_tasks()), 0) self.assertEqual(self.workflow.is_completed(), True) @@ -45,5 +44,4 @@ class MultipleThrowEventStartsEventTest(BpmnWorkflowTestCase): self.assertEqual(len(ready_tasks), 1) ready_tasks[0].run() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(self.workflow.is_completed(), True) \ No newline at end of file diff --git a/tests/SpiffWorkflow/bpmn/events/NITimerDurationBoundaryTest.py b/tests/SpiffWorkflow/bpmn/events/NITimerDurationBoundaryTest.py index 275640b0..657476be 100644 --- a/tests/SpiffWorkflow/bpmn/events/NITimerDurationBoundaryTest.py +++ b/tests/SpiffWorkflow/bpmn/events/NITimerDurationBoundaryTest.py @@ -1,8 +1,6 @@ -# -*- coding: utf-8 -*- - -import unittest import datetime import time + from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -38,9 +36,10 @@ class NITimerDurationTest(BpmnWorkflowTestCase): starttime = datetime.datetime.now() # test bpmn has a timeout of .2s; we should terminate loop before that. # The subprocess will also wait - while len(self.workflow.get_waiting_tasks()) == 2 and loopcount < 10: + while event.state == TaskState.WAITING and loopcount < 10: if save_restore: self.save_restore() + event = self.workflow.get_tasks_from_spec_name('Event_0jyy8ao')[0] time.sleep(0.1) ready_tasks = self.workflow.get_tasks(TaskState.READY) # There should be one ready task until the boundary event fires @@ -66,12 +65,5 @@ class NITimerDurationTest(BpmnWorkflowTestCase): self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(self.workflow.is_completed(), True) self.assertEqual(self.workflow.last_task.data, {'work_done': 'Yes', 'delay_reason': 'Just Because'}) - - -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(NITimerDurationTest) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py b/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py index 9371d5ac..1e66ba7d 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py @@ -1,7 +1,7 @@ import unittest from datetime import datetime -from SpiffWorkflow.bpmn.specs.event_definitions import TimerEventDefinition +from SpiffWorkflow.bpmn.specs.event_definitions.timer import TimerEventDefinition class TimeDurationParseTest(unittest.TestCase): "Non-exhaustive ISO durations, but hopefully covers basic support" diff --git a/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py b/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py index 3e16830e..89cbf070 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py @@ -1,7 +1,4 @@ -# -*- coding: utf-8 -*- - import datetime -import unittest import time from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine @@ -70,7 +67,3 @@ class TimerCycleTest(BpmnWorkflowTestCase): self.assertEqual(timer.state, TaskState.COMPLETED) self.assertEqual(counter, 2) -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(TimerCycleTest) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/bpmn/events/TransactionSubprocssTest.py b/tests/SpiffWorkflow/bpmn/events/TransactionSubprocssTest.py index 25c7d23a..e1230bba 100644 --- a/tests/SpiffWorkflow/bpmn/events/TransactionSubprocssTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TransactionSubprocssTest.py @@ -22,7 +22,6 @@ class TransactionSubprocessTest(BpmnWorkflowTestCase): ready_tasks[0].update_data({'quantity': 2}) ready_tasks[0].run() self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertIn('value', self.workflow.last_task.data) # Check that workflow and next task completed @@ -63,7 +62,8 @@ class TransactionSubprocessTest(BpmnWorkflowTestCase): # We should not have this task, as we followed the 'cancel branch' print_task = self.workflow.get_tasks_from_spec_name("Activity_Print_Data") - self.assertEqual(len(print_task), 0) + self.assertEqual(len(print_task), 1) + self.assertEqual(print_task[0].state, TaskState.CANCELLED) def testSubworkflowErrorCodeNone(self): @@ -94,7 +94,8 @@ class TransactionSubprocessTest(BpmnWorkflowTestCase): # Make sure this branch didn't getfollowed print_task = self.workflow.get_tasks_from_spec_name("Activity_Print_Data") - self.assertEqual(len(print_task), 0) + self.assertEqual(len(print_task), 1) + self.assertEqual(print_task[0].state, TaskState.CANCELLED) def testSubworkflowErrorCodeOne(self): @@ -119,4 +120,5 @@ class TransactionSubprocessTest(BpmnWorkflowTestCase): self.assertEqual(error_1_task.state, TaskState.COMPLETED) print_task = self.workflow.get_tasks_from_spec_name("Activity_Print_Data") - self.assertEqual(len(print_task), 0) + self.assertEqual(len(print_task), 1) + self.assertEqual(print_task[0].state, TaskState.CANCELLED) diff --git a/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelGatewayLoopInputTest.py b/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelGatewayLoopInputTest.py new file mode 100644 index 00000000..37477acd --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelGatewayLoopInputTest.py @@ -0,0 +1,19 @@ +from SpiffWorkflow.task import TaskState +from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase + +class ParallelGatewayLoopInputTest(BpmnWorkflowTestCase): + + def setUp(self): + spec, subprocess_specs = self.load_workflow_spec('gateway_loop_input.bpmn', 'main') + self.workflow = BpmnWorkflow(spec, subprocess_specs) + + def test_loop_input(self): + + self.workflow.do_engine_steps() + ready = self.workflow.get_tasks(TaskState.READY) + self.assertEqual(len(ready), 1) + ready[0].run() + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertDictEqual(self.workflow.data, { 'x': 2}) diff --git a/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelMultipleSplitsTest.py b/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelMultipleSplitsTest.py index 70a37f7f..f01dba11 100644 --- a/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelMultipleSplitsTest.py +++ b/tests/SpiffWorkflow/bpmn/parallel_gateway_tests/ParallelMultipleSplitsTest.py @@ -33,7 +33,6 @@ class ParallelMultipleSplitsTest(BpmnWorkflowTestCase): self.workflow.do_engine_steps() self.do_next_named_step('SP 3 - Yes Task') self.workflow.do_engine_steps() - self.complete_subworkflow() self.do_next_named_step('Done') self.workflow.do_engine_steps() diff --git a/tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py b/tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py index d0358953..b3bbcfaf 100644 --- a/tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py +++ b/tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py @@ -162,7 +162,6 @@ class BpmnWorkflowSerializerTest(BaseTestCase): self.assertIsInstance(w1, BpmnWorkflow) self.assertIsInstance(w2, BpmnWorkflow) self.assertEqual(w1.data, w2.data) - self.assertEqual(w1.name, w2.name) for task in w1.get_ready_user_tasks(): w2_task = w2.get_task_from_id(task.id) self.assertIsNotNone(w2_task) diff --git a/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py b/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py index f3bdb800..d0facb40 100644 --- a/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py +++ b/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py @@ -11,8 +11,6 @@ from .BaseTestCase import BaseTestCase class Version_1_0_Test(BaseTestCase): - SERIALIZER_VERSION = "1.2" - def test_convert_subprocess(self): # The serialization used here comes from NestedSubprocessTest saved at line 25 with version 1.0 fn = os.path.join(self.DATA_DIR, 'serialization', 'v1.0.json') @@ -92,3 +90,46 @@ class Version_1_1_Test(BaseTestCase): ready_tasks[0].run() ready_tasks = wf.get_tasks(TaskState.READY) self.assertTrue(wf.is_completed()) + + +class Version1_2_Test(BaseTestCase): + + def test_remove_boundary_events(self): + fn = os.path.join(self.DATA_DIR, 'serialization', 'v1.2-boundary-events.json') + wf = self.serializer.deserialize_json(open(fn).read()) + ready_tasks = wf.get_tasks(TaskState.READY) + ready_tasks[0].update_data({'value': 'asdf'}) + ready_tasks[0].run() + wf.do_engine_steps() + ready_tasks = wf.get_tasks(TaskState.READY) + ready_tasks[0].update_data({'quantity': 2}) + ready_tasks[0].run() + wf.do_engine_steps() + self.assertIn('value', wf.last_task.data) + + # Check that workflow and next task completed + subprocess = wf.get_tasks_from_spec_name('Subprocess')[0] + self.assertEqual(subprocess.state, TaskState.COMPLETED) + print_task = wf.get_tasks_from_spec_name("Activity_Print_Data")[0] + self.assertEqual(print_task.state, TaskState.COMPLETED) + + # Check that the boundary events were cancelled + cancel_task = wf.get_tasks_from_spec_name("Catch_Cancel_Event")[0] + self.assertEqual(cancel_task.state, TaskState.CANCELLED) + error_1_task = wf.get_tasks_from_spec_name("Catch_Error_1")[0] + self.assertEqual(error_1_task.state, TaskState.CANCELLED) + error_none_task = wf.get_tasks_from_spec_name("Catch_Error_None")[0] + self.assertEqual(error_none_task.state, TaskState.CANCELLED) + + def test_remove_noninterrupting_boundary_events(self): + fn = os.path.join(self.DATA_DIR, 'serialization', 'v1.2-boundary-events-noninterrupting.json') + wf = self.serializer.deserialize_json(open(fn).read()) + + wf.get_tasks_from_spec_name('sid-D3365C47-2FAE-4D17-98F4-E68B345E18CE')[0].run() + wf.do_engine_steps() + self.assertEqual(1, len(wf.get_tasks(TaskState.READY))) + self.assertEqual(3, len(wf.get_tasks(TaskState.WAITING))) + + wf.get_tasks_from_spec_name('sid-6FBBB56D-00CD-4C2B-9345-486986BB4992')[0].run() + wf.do_engine_steps() + self.assertTrue(wf.is_completed()) diff --git a/tests/SpiffWorkflow/camunda/CallActivityMessageTest.py b/tests/SpiffWorkflow/camunda/CallActivityMessageTest.py index 6942c301..d61e2f24 100644 --- a/tests/SpiffWorkflow/camunda/CallActivityMessageTest.py +++ b/tests/SpiffWorkflow/camunda/CallActivityMessageTest.py @@ -41,7 +41,6 @@ class CallActivityMessageTest(BaseTestCase): current_task.update_data(step[1]) current_task.run() self.workflow.do_engine_steps() - self.complete_subworkflow() if save_restore: self.save_restore() ready_tasks = self.workflow.get_tasks(TaskState.READY) diff --git a/tests/SpiffWorkflow/camunda/ExternalMessageBoundaryEventTest.py b/tests/SpiffWorkflow/camunda/ExternalMessageBoundaryEventTest.py index 02d5d4a8..c1950eed 100644 --- a/tests/SpiffWorkflow/camunda/ExternalMessageBoundaryEventTest.py +++ b/tests/SpiffWorkflow/camunda/ExternalMessageBoundaryEventTest.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from SpiffWorkflow.bpmn.event import BpmnEvent from SpiffWorkflow.camunda.specs.event_definitions import MessageEventDefinition from .BaseTestCase import BaseTestCase @@ -19,19 +19,19 @@ class ExternalMessageBoundaryTest(BaseTestCase): def testThroughSaveRestore(self): self.actual_test(save_restore=True) - - def actual_test(self,save_restore = False): + def actual_test(self, save_restore=False): self.workflow.do_engine_steps() ready_tasks = self.workflow.get_tasks(TaskState.READY) self.assertEqual(1, len(ready_tasks),'Expected to have only one ready task') - self.workflow.catch(MessageEventDefinition('Interrupt', payload='SomethingImportant', result_var='interrupt_var')) + self.workflow.catch(BpmnEvent( + MessageEventDefinition('Interrupt'), + {'result_var': 'interrupt_var', 'payload': 'SomethingImportant'} + )) self.workflow.do_engine_steps() ready_tasks = self.workflow.get_tasks(TaskState.READY) self.assertEqual(2,len(ready_tasks),'Expected to have two ready tasks') - # here because the thread just dies and doesn't lead to a task, we expect the data - # to die with it. # item 1 should be at 'Pause' self.assertEqual('Pause',ready_tasks[1].task_spec.bpmn_name) self.assertEqual('SomethingImportant', ready_tasks[1].data['interrupt_var']) @@ -40,11 +40,11 @@ class ExternalMessageBoundaryTest(BaseTestCase): self.assertEqual(False, ready_tasks[0].data['caughtinterrupt']) ready_tasks[1].run() self.workflow.do_engine_steps() - # what I think is going on here is that when we hit the reset, it is updating the - # last_task and appending the data to whatever happened there, so it would make sense that - # we have the extra variables that happened in 'pause' - # if on the other hand, we went on from 'meaningless task' those variables would not get added. - self.workflow.catch(MessageEventDefinition('reset', payload='SomethingDrastic', result_var='reset_var')) + + self.workflow.catch(BpmnEvent( + MessageEventDefinition('reset'), + {'result_var': 'reset_var', 'payload': 'SomethingDrastic'} + )) ready_tasks = self.workflow.get_tasks(TaskState.READY) # The user activity was cancelled and we should continue from the boundary event self.assertEqual(2, len(ready_tasks), 'Expected to have two ready tasks') diff --git a/tests/SpiffWorkflow/camunda/MessageBoundaryEventTest.py b/tests/SpiffWorkflow/camunda/MessageBoundaryEventTest.py index 2b67be61..2ebbc98b 100644 --- a/tests/SpiffWorkflow/camunda/MessageBoundaryEventTest.py +++ b/tests/SpiffWorkflow/camunda/MessageBoundaryEventTest.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - - -import unittest import time from datetime import timedelta from SpiffWorkflow.task import TaskState @@ -26,8 +22,6 @@ class MessageBoundaryTest(BaseTestCase): def testThroughSaveRestore(self): self.actual_test(save_restore=True) - - def actual_test(self,save_restore = False): steps = [('Activity_Interrupt', {'interrupt_task':'No'}), ('Activity_Interrupt', {'interrupt_task': 'No'}), @@ -54,9 +48,3 @@ class MessageBoundaryTest(BaseTestCase): self.workflow.do_engine_steps() self.assertEqual(self.workflow.is_completed(),True,'Expected the workflow to be complete at this point') - - -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(MessageBoundaryTest) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/camunda/NIMessageBoundaryTest.py b/tests/SpiffWorkflow/camunda/NIMessageBoundaryTest.py index ab1bdaac..b327f409 100644 --- a/tests/SpiffWorkflow/camunda/NIMessageBoundaryTest.py +++ b/tests/SpiffWorkflow/camunda/NIMessageBoundaryTest.py @@ -82,7 +82,6 @@ class NIMessageBoundaryTest(BaseTestCase): task.data['work_completed'] = 'Lots of Stuff' self.workflow.run_task_from_id(task.id) self.workflow.do_engine_steps() - self.complete_subworkflow() self.assertEqual(self.workflow.is_completed(),True) self.assertEqual(self.workflow.last_task.data,{'Event_InterruptBoundary_Response': 'Youre late!', 'flag_task': 'Yes', diff --git a/tests/SpiffWorkflow/camunda/ResetTokenSubWorkflowTest.py b/tests/SpiffWorkflow/camunda/ResetTokenSubWorkflowTest.py index 3eb6ddf8..fd336571 100644 --- a/tests/SpiffWorkflow/camunda/ResetTokenSubWorkflowTest.py +++ b/tests/SpiffWorkflow/camunda/ResetTokenSubWorkflowTest.py @@ -77,7 +77,6 @@ class ResetTokenTestSubProcess(BaseTestCase): task.update_data({step['formvar']: step['answer']}) task.run() self.workflow.do_engine_steps() - self.complete_subworkflow() if save_restore: self.save_restore() diff --git a/tests/SpiffWorkflow/camunda/StartMessageEventTest.py b/tests/SpiffWorkflow/camunda/StartMessageEventTest.py index 07e4bf0f..b2e248a9 100644 --- a/tests/SpiffWorkflow/camunda/StartMessageEventTest.py +++ b/tests/SpiffWorkflow/camunda/StartMessageEventTest.py @@ -1,10 +1,7 @@ -# -*- coding: utf-8 -*- - -import unittest - from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from .BaseTestCase import BaseTestCase + __author__ = 'kellym' @@ -62,9 +59,3 @@ class StartMessageTest(BaseTestCase): 'ApprovalResult': 'Yes', 'Done': 'OK!' }) - - -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(StartMessageTest) -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/camunda/SubWorkflowTest.py b/tests/SpiffWorkflow/camunda/SubWorkflowTest.py index 2d1a73c6..5185fdcd 100644 --- a/tests/SpiffWorkflow/camunda/SubWorkflowTest.py +++ b/tests/SpiffWorkflow/camunda/SubWorkflowTest.py @@ -33,7 +33,6 @@ class SubWorkflowTest(BaseTestCase): task.update_data({"Field"+answer: answer}) task.run() self.workflow.do_engine_steps() - self.complete_subworkflow() if save_restore: self.save_restore() diff --git a/tests/SpiffWorkflow/camunda/serializer/CamundaExtensionsTest.py b/tests/SpiffWorkflow/camunda/serializer/CamundaExtensionsTest.py index 902a911e..6e9ef5dd 100644 --- a/tests/SpiffWorkflow/camunda/serializer/CamundaExtensionsTest.py +++ b/tests/SpiffWorkflow/camunda/serializer/CamundaExtensionsTest.py @@ -18,7 +18,7 @@ class CamundaExtensionsTest(BaseTestCase): def assertMyExtension(self): """Assure that we have a very specific extension on specific task.""" - task = self.workflow.get_task_spec_from_name("Task_User_Select_Type") + task = self.workflow.spec.get_task_spec_from_name("Task_User_Select_Type") self.assertIsNotNone(task) self.assertTrue(hasattr(task, 'extensions')) self.assertTrue("my_extension" in task.extensions) diff --git a/tests/SpiffWorkflow/core/specs/SubWorkflowTest.py b/tests/SpiffWorkflow/core/specs/SubWorkflowTest.py index 2b8a9a3c..5e341108 100644 --- a/tests/SpiffWorkflow/core/specs/SubWorkflowTest.py +++ b/tests/SpiffWorkflow/core/specs/SubWorkflowTest.py @@ -109,7 +109,7 @@ class TaskSpecTest(unittest.TestCase): # Now refresh waiting tasks: # Update the state of every WAITING task. - for thetask in self.workflow._get_waiting_tasks(): + for thetask in [t for t in self.workflow.get_tasks(TaskState.WAITING)]: thetask.task_spec._update(thetask) self.do_next_unique_task('last') diff --git a/tests/SpiffWorkflow/dmn/DecisionRunner.py b/tests/SpiffWorkflow/dmn/DecisionRunner.py index 47bcfbda..11daacd6 100644 --- a/tests/SpiffWorkflow/dmn/DecisionRunner.py +++ b/tests/SpiffWorkflow/dmn/DecisionRunner.py @@ -2,16 +2,21 @@ import os from lxml import etree -from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import Box from SpiffWorkflow.dmn.engine.DMNEngine import DMNEngine from SpiffWorkflow.dmn.parser.DMNParser import DMNParser, get_dmn_ns +class WorkflowSpec: + def __init__(self): + self.file = 'my_mock_file' + self.name = 'Mock Workflow Spec' + self.task_specs = {} class Workflow: def __init__(self, script_engine): self.script_engine = script_engine - self.outer_workflow = self - self.spec = Box({'file': 'my_mock_file'}) + self.parent = None + self.spec = WorkflowSpec() + self.top_workflow = self class TaskSpec: def __init__(self): diff --git a/tests/SpiffWorkflow/spiff/CorrelationTest.py b/tests/SpiffWorkflow/spiff/CorrelationTest.py index 80d26c96..03b557fc 100644 --- a/tests/SpiffWorkflow/spiff/CorrelationTest.py +++ b/tests/SpiffWorkflow/spiff/CorrelationTest.py @@ -45,16 +45,11 @@ class DualConversationTest(BaseTestCase): spec, subprocesses = self.load_workflow_spec('correlation_two_conversations.bpmn', 'message_send_process') workflow = BpmnWorkflow(spec, subprocesses) workflow.do_engine_steps() - messages = workflow.get_bpmn_messages() + messages = workflow.get_events() self.assertEqual(len(messages), 2) - [ msg for msg in messages if msg.name== 'Message Send One' ][0] - [ msg for msg in messages if msg.name== 'Message Send Two' ][0] - - # fixme: This seemed to test that we get a nested structure of correlation keys and correlation properties - # Perhaps there should be a way to get the keys and thier associated properties - - # but things should not default to a nested structure. - - # self.assertIn('message_correlation_key_one', message_one.correlations) - # self.assertNotIn('message_correlation_key_one', message_two.correlations) - # self.assertIn('message_correlation_key_two', message_two.correlations) - # self.assertNotIn('message_correlation_key_two', message_one.correlations) + self.assertEqual('Message Send One', messages[0].event_definition.name) + self.assertEqual('Message Send Two', messages[1].event_definition.name) + self.assertIn('message_correlation_key_one', messages[0].correlations) + self.assertNotIn('message_correlation_key_one', messages[1].correlations) + self.assertIn('message_correlation_key_two', messages[1].correlations) + self.assertNotIn('message_correlation_key_two', messages[0].correlations) diff --git a/tests/SpiffWorkflow/spiff/EventPayloadTest.py b/tests/SpiffWorkflow/spiff/EventPayloadTest.py new file mode 100644 index 00000000..bcd9b671 --- /dev/null +++ b/tests/SpiffWorkflow/spiff/EventPayloadTest.py @@ -0,0 +1,49 @@ +from SpiffWorkflow.bpmn.workflow import BpmnWorkflow + +from .BaseTestCase import BaseTestCase + +class EventPayloadTest(BaseTestCase): + + def testSignalEvent(self): + spec, subprocesses = self.load_workflow_spec('signal_event_payload.bpmn', 'event_test') + self.workflow = BpmnWorkflow(spec) + self.workflow.do_engine_steps() + self.save_restore() + set_data = self.workflow.get_tasks_from_spec_name('set_data')[0] + # Throw event creates payload from v1 & v2 + set_data.data = {'v1': 1, 'v2': 2, 'v3': 3} + set_data.run() + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertDictEqual(self.workflow.data, { + 'v1': 1, + 'v2': 2, + 'v3': 3, + 'result': {'r1': 1, 'r2': 2} + }) + + def testErrorEvent(self): + spec, subprocesses = self.load_workflow_spec('error_event_payload.bpmn', 'event_test') + self.workflow = BpmnWorkflow(spec, subprocesses) + self.workflow.do_engine_steps() + self.save_restore() + set_data = self.workflow.get_tasks_from_spec_name('set_data')[0] + # Throw event creates payload from v1 & v2 + set_data.data = {'error': True, 'payload': 'ERROR!'} + set_data.run() + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertEqual(self.workflow.data, {'result': 'ERROR!'}) + + def testEscalationEvent(self): + spec, subprocesses = self.load_workflow_spec('escalation_event_payload.bpmn', 'event_test') + self.workflow = BpmnWorkflow(spec, subprocesses) + self.workflow.do_engine_steps() + self.save_restore() + set_data = self.workflow.get_tasks_from_spec_name('set_data')[0] + # Throw event creates payload from v1 & v2 + set_data.data = {'escalation': True, 'payload': 'ERROR!'} + set_data.run() + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertEqual(self.workflow.data, {'result': 'ERROR!'}) \ No newline at end of file diff --git a/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py b/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py index 7f8ac82f..1e7ab057 100644 --- a/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py +++ b/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py @@ -84,4 +84,3 @@ class PrescriptPostsciptTest(BaseTestCase): ready_tasks = self.workflow.get_tasks(TaskState.READY) ready_tasks[0].set_data(**data) self.workflow.do_engine_steps() - self.complete_subworkflow() diff --git a/tests/SpiffWorkflow/spiff/data/error_event_payload.bpmn b/tests/SpiffWorkflow/spiff/data/error_event_payload.bpmn new file mode 100644 index 00000000..ce2615bb --- /dev/null +++ b/tests/SpiffWorkflow/spiff/data/error_event_payload.bpmn @@ -0,0 +1,121 @@ + + + + + Flow_1rbbx75 + + + + Flow_1rbbx75 + Flow_077e1zz + + Flow_1as4f94 + + + Flow_1as4f94 + Flow_10mhppx + + + + Flow_10mhppx + Flow_0wv10p6 + Flow_1o689w0 + + + + Flow_0wv10p6 + + + + error + + + Flow_1o689w0 + + + + + Flow_01bfubj + + + + Flow_01bfubj + + + + Flow_077e1zz + + + + + + payload + result + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/spiff/data/escalation_event_payload.bpmn b/tests/SpiffWorkflow/spiff/data/escalation_event_payload.bpmn new file mode 100644 index 00000000..1fbcd4fd --- /dev/null +++ b/tests/SpiffWorkflow/spiff/data/escalation_event_payload.bpmn @@ -0,0 +1,121 @@ + + + + + Flow_1rbbx75 + + + + Flow_1rbbx75 + Flow_077e1zz + + Flow_1as4f94 + + + Flow_1as4f94 + Flow_10mhppx + + + + Flow_10mhppx + Flow_0wv10p6 + Flow_1o689w0 + + + + Flow_0wv10p6 + + + + escalation + + + Flow_1o689w0 + + + + + Flow_01bfubj + + + + Flow_01bfubj + + + + Flow_077e1zz + + + + + + payload + result + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/spiff/data/signal_event_payload.bpmn b/tests/SpiffWorkflow/spiff/data/signal_event_payload.bpmn new file mode 100644 index 00000000..f73a9afd --- /dev/null +++ b/tests/SpiffWorkflow/spiff/data/signal_event_payload.bpmn @@ -0,0 +1,110 @@ + + + + + Flow_1snc2rf + + + + Flow_1snc2rf + Flow_0izdnv7 + Flow_1io9375 + + + + + Flow_038p23k + Flow_0e7nmhg + + + + + Flow_0e7nmhg + Flow_1a61be1 + Flow_0v3ccvw + + + Flow_0v3ccvw + + + + + Flow_1io9375 + Flow_1a61be1 + + + + + Flow_0izdnv7 + Flow_038p23k + + + + + {'r1': v1, 'r2': v2} + result + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +