From b8d3d5d84b78e8e63b72d9d615d210c8bf85efd7 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 26 Jan 2023 18:17:35 -0500 Subject: [PATCH] Squashed 'SpiffWorkflow/' changes from 450ef3bcd..98c6294f1 98c6294f1 Merge pull request #287 from sartography/feature/workflow_data_exceptions d40a1da59 Workflow Data Exceptions were broken in the previous error refactor. This assures we are getting good messages from these errors. a156378e1 Merge pull request #286 from sartography/feature/inclusive-gateway-support 7f6e398c2 bypass unnecessary checks in gateway joins ade21a894 revert a few things e1cf75202 Merge branch 'main' into feature/inclusive-gateway-support 15a0a4414 revert change to MultiChoice and handle no defaults in BPMN specs e1469e6bb add support for diverging inclusive gateways 71fd86386 really prevent non-default flows without conditions 924759d9b clean up join specs 7378639d3 Merge pull request #284 from sartography/feature/improved-timer-events dc8d139d2 remove useless method 530f23697 Merge branch 'main' into feature/improved-timer-events 307cca9c5 partially clean up existing gateways 0a344285e clean up task parsers 2cef997d1 add waiting_events method to bpmn workflow 48091c407 serializer migration script and miscellaneous fixes to serialization 61316854b store internal timer data as string/float 389c14c4c add some tests for parsing durations 582bc9482 convert timers to iso 8601 6dfd7ebe9 remove extraneous calls to update 6bd429529 clean up tests d56e9912f remove useless method git-subtree-dir: SpiffWorkflow git-subtree-split: 98c6294f1240aee599cd98bcee58d121cb57b331 --- .../SpiffWorkflow/bpmn/BpmnLoaderForTests.py | 7 +- tests/SpiffWorkflow/bpmn/IOSpecTest.py | 14 +- .../bpmn/InclusiveGatewayTest.py | 39 + .../bpmn/NITimerDurationBoundaryTest.py | 59 +- .../data/MultiInstanceParallelTaskCond.bpmn | 162 +-- .../Parallel-Join-Long-Inclusive.bpmn20.xml | 1282 +++++++++-------- .../Parallel-One-Path-Ends.bpmn20.xml | 384 ++--- ...lel-Then-Exclusive-No-Inclusive.bpmn20.xml | 438 +++--- .../Parallel-Then-Exclusive.bpmn20.xml | 404 +++--- .../Parallel-Through-Same-Task.bpmn20.xml | 402 +++--- tests/SpiffWorkflow/bpmn/data/boundary.bpmn | 116 +- .../bpmn/data/boundary_timer_on_task.bpmn | 48 +- .../bpmn/data/event-gateway.bpmn | 2 +- .../bpmn/data/inclusive_gateway.bpmn | 131 ++ .../bpmn/data/serialization/v1-1.json | 590 ++++++++ .../bpmn/data/timer-cycle-start.bpmn | 4 +- .../SpiffWorkflow/bpmn/data/timer-cycle.bpmn | 44 +- .../bpmn/data/timer-date-start.bpmn | 59 +- .../data/timer-non-interrupt-boundary.bpmn | 125 +- tests/SpiffWorkflow/bpmn/data/timer.bpmn | 58 +- .../bpmn/data/too_many_loops.bpmn | 30 +- .../bpmn/data/too_many_loops_sub_process.bpmn | 4 +- .../bpmn/events/ActionManagementTest.py | 2 +- .../bpmn/events/TimeDurationParseTest.py | 60 + .../bpmn/events/TimerCycleStartTest.py | 25 +- .../bpmn/events/TimerCycleTest.py | 35 +- .../bpmn/events/TimerDateTest.py | 26 +- .../events/TimerDurationBoundaryOnTaskTest.py | 39 +- .../bpmn/events/TimerDurationBoundaryTest.py | 33 +- .../bpmn/events/TimerDurationTest.py | 34 +- .../bpmn/events/TimerIntermediateTest.py | 2 +- .../bpmn/serializer/BaseTestCase.py | 27 + .../BpmnWorkflowSerializerTest.py | 42 +- .../bpmn/serializer/VersionMigrationTest.py | 30 + .../camunda/data/MessageBoundary.bpmn | 202 +-- .../camunda/data/token_trial.bpmn | 82 +- .../data/token_trial_camunda_clash.bpmn | 82 +- .../data/token_trial_parallel_simple.bpmn | 40 +- 38 files changed, 2959 insertions(+), 2204 deletions(-) create mode 100644 tests/SpiffWorkflow/bpmn/InclusiveGatewayTest.py create mode 100644 tests/SpiffWorkflow/bpmn/data/inclusive_gateway.bpmn create mode 100644 tests/SpiffWorkflow/bpmn/data/serialization/v1-1.json create mode 100644 tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py create mode 100644 tests/SpiffWorkflow/bpmn/serializer/BaseTestCase.py rename tests/SpiffWorkflow/bpmn/{ => serializer}/BpmnWorkflowSerializerTest.py (80%) create mode 100644 tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py diff --git a/tests/SpiffWorkflow/bpmn/BpmnLoaderForTests.py b/tests/SpiffWorkflow/bpmn/BpmnLoaderForTests.py index 54c18709f..9f90268da 100644 --- a/tests/SpiffWorkflow/bpmn/BpmnLoaderForTests.py +++ b/tests/SpiffWorkflow/bpmn/BpmnLoaderForTests.py @@ -3,7 +3,8 @@ from SpiffWorkflow.bpmn.specs.ExclusiveGateway import ExclusiveGateway from SpiffWorkflow.bpmn.specs.UserTask import UserTask from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnParser -from SpiffWorkflow.bpmn.parser.task_parsers import ExclusiveGatewayParser, UserTaskParser +from SpiffWorkflow.bpmn.parser.TaskParser import TaskParser +from SpiffWorkflow.bpmn.parser.task_parsers import ConditionalGatewayParser from SpiffWorkflow.bpmn.parser.util import full_tag from SpiffWorkflow.bpmn.serializer.bpmn_converters import BpmnTaskSpecConverter @@ -38,7 +39,7 @@ class TestUserTask(UserTask): def deserialize(self, serializer, wf_spec, s_state): return serializer.deserialize_generic(wf_spec, s_state, TestUserTask) -class TestExclusiveGatewayParser(ExclusiveGatewayParser): +class TestExclusiveGatewayParser(ConditionalGatewayParser): def parse_condition(self, sequence_flow_node): cond = super().parse_condition(sequence_flow_node) @@ -62,7 +63,7 @@ class TestUserTaskConverter(BpmnTaskSpecConverter): class TestBpmnParser(BpmnParser): OVERRIDE_PARSER_CLASSES = { - full_tag('userTask'): (UserTaskParser, TestUserTask), + full_tag('userTask'): (TaskParser, TestUserTask), full_tag('exclusiveGateway'): (TestExclusiveGatewayParser, ExclusiveGateway), full_tag('callActivity'): (CallActivityParser, CallActivity) } diff --git a/tests/SpiffWorkflow/bpmn/IOSpecTest.py b/tests/SpiffWorkflow/bpmn/IOSpecTest.py index efa6441c9..6b27fc059 100644 --- a/tests/SpiffWorkflow/bpmn/IOSpecTest.py +++ b/tests/SpiffWorkflow/bpmn/IOSpecTest.py @@ -18,14 +18,17 @@ class CallActivityDataTest(BpmnWorkflowTestCase): self.actual_test(True) def testCallActivityMissingInput(self): - + self.workflow = BpmnWorkflow(self.spec, self.subprocesses) set_data = self.workflow.spec.task_specs['Activity_0haob58'] set_data.script = """in_1, unused = 1, True""" with self.assertRaises(WorkflowDataException) as exc: self.advance_to_subprocess() - self.assertEqual(exc.var.name,'in_2') + self.assertEqual("'in_2' was not found in the task data. " + "You are missing a required Data Input for a call activity.", + str(exc.exception)) + self.assertEqual(exc.exception.data_input.name,'in_2') def testCallActivityMissingOutput(self): @@ -40,7 +43,10 @@ class CallActivityDataTest(BpmnWorkflowTestCase): with self.assertRaises(WorkflowDataException) as exc: self.complete_subprocess() - self.assertEqual(exc.var.name,'out_2') + + self.assertEqual("'out_2' was not found in the task data. A Data Output was not provided as promised.", + str(exc.exception)) + self.assertEqual(exc.exception.data_output.name,'out_2') def actual_test(self, save_restore=False): @@ -85,4 +91,4 @@ class CallActivityDataTest(BpmnWorkflowTestCase): while len(waiting) > 0: next_task = self.workflow.get_tasks(TaskState.READY)[0] next_task.complete() - waiting = self.workflow.get_tasks(TaskState.WAITING) \ No newline at end of file + waiting = self.workflow.get_tasks(TaskState.WAITING) diff --git a/tests/SpiffWorkflow/bpmn/InclusiveGatewayTest.py b/tests/SpiffWorkflow/bpmn/InclusiveGatewayTest.py new file mode 100644 index 000000000..f4a0e5db6 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/InclusiveGatewayTest.py @@ -0,0 +1,39 @@ +from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from SpiffWorkflow.exceptions import WorkflowTaskException + +from .BpmnWorkflowTestCase import BpmnWorkflowTestCase + +class InclusiveGatewayTest(BpmnWorkflowTestCase): + + def setUp(self): + spec, subprocess = self.load_workflow_spec('inclusive_gateway.bpmn', 'main') + self.workflow = BpmnWorkflow(spec) + self.workflow.do_engine_steps() + + def testDefaultConditionOnly(self): + self.set_data({'v': -1, 'u': -1, 'w': -1}) + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertDictEqual(self.workflow.data, {'v': 0, 'u': -1, 'w': -1}) + + def testDefaultConditionOnlySaveRestore(self): + self.set_data({'v': -1, 'u': -1, 'w': -1}) + self.save_restore() + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertDictEqual(self.workflow.data, {'v': 0, 'u': -1, 'w': -1}) + + def testNoPathFromSecondGateway(self): + self.set_data({'v': 0, 'u': -1, 'w': -1}) + self.assertRaises(WorkflowTaskException, self.workflow.do_engine_steps) + + def testParallelCondition(self): + self.set_data({'v': 0, 'u': 1, 'w': 1}) + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) + self.assertDictEqual(self.workflow.data, {'v': 0, 'u': 1, 'w': 1}) + + def set_data(self, value): + task = self.workflow.get_ready_user_tasks()[0] + task.data = value + task.complete() diff --git a/tests/SpiffWorkflow/bpmn/NITimerDurationBoundaryTest.py b/tests/SpiffWorkflow/bpmn/NITimerDurationBoundaryTest.py index 97553a6d2..29e0f62ad 100644 --- a/tests/SpiffWorkflow/bpmn/NITimerDurationBoundaryTest.py +++ b/tests/SpiffWorkflow/bpmn/NITimerDurationBoundaryTest.py @@ -5,7 +5,6 @@ import datetime import time from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow -from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'kellym' @@ -16,9 +15,8 @@ class NITimerDurationTest(BpmnWorkflowTestCase): Non-Interrupting Timer boundary test """ def setUp(self): - self.script_engine = PythonScriptEngine(default_globals={"timedelta": datetime.timedelta}) spec, subprocesses = self.load_workflow_spec('timer-non-interrupt-boundary.bpmn', 'NonInterruptTimer') - self.workflow = BpmnWorkflow(spec, subprocesses, script_engine=self.script_engine) + self.workflow = BpmnWorkflow(spec, subprocesses) def load_spec(self): return @@ -31,57 +29,44 @@ class NITimerDurationTest(BpmnWorkflowTestCase): def actual_test(self,save_restore = False): - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - self.workflow.complete_task_from_id(ready_tasks[0].id) self.workflow.do_engine_steps() ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - ready_tasks[0].data['work_done'] = 'No' - self.workflow.complete_task_from_id(ready_tasks[0].id) - self.workflow.do_engine_steps() + event = self.workflow.get_tasks_from_spec_name('Event_0jyy8ao')[0] + self.assertEqual(event.state, TaskState.WAITING) loopcount = 0 - # test bpmn has a timeout of .25s - # we should terminate loop before that. starttime = datetime.datetime.now() - while loopcount < 10: - ready_tasks = self.workflow.get_tasks(TaskState.READY) - if len(ready_tasks) > 1: - break + # 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: if save_restore: self.save_restore() - self.workflow.script_engine = self.script_engine - #self.assertEqual(1, len(self.workflow.get_tasks(Task.WAITING))) time.sleep(0.1) - self.workflow.complete_task_from_id(ready_tasks[0].id) + ready_tasks = self.workflow.get_tasks(TaskState.READY) + # There should be one ready task until the boundary event fires + self.assertEqual(len(self.workflow.get_ready_user_tasks()), 1) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() - loopcount = loopcount +1 + loopcount += 1 + endtime = datetime.datetime.now() - duration = endtime-starttime - # appropriate time here is .5 seconds - # due to the .3 seconds that we loop and then - # the two conditions that we complete after the timer completes. - self.assertEqual(durationdatetime.timedelta(seconds=.2),True) + duration = endtime - starttime + # appropriate time here is .5 seconds due to the .3 seconds that we loop and then + self.assertEqual(duration < datetime.timedelta(seconds=.5), True) + self.assertEqual(duration > datetime.timedelta(seconds=.2), True) + ready_tasks = self.workflow.get_ready_user_tasks() + # Now there should be two. + self.assertEqual(len(ready_tasks), 2) for task in ready_tasks: - if task.task_spec == 'GetReason': + if task.task_spec.name == 'GetReason': task.data['delay_reason'] = 'Just Because' - else: + elif task.task_spec.name == 'Activity_Work': task.data['work_done'] = 'Yes' - self.workflow.complete_task_from_id(task.id) + task.complete() self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - ready_tasks[0].data['experience'] = 'Great!' - self.workflow.complete_task_from_id(ready_tasks[0].id) - self.workflow.do_engine_steps() self.assertEqual(self.workflow.is_completed(),True) - self.assertEqual(self.workflow.last_task.data,{'work_done': 'Yes', 'experience': 'Great!'}) - print (self.workflow.last_task.data) - print(duration) + self.assertEqual(self.workflow.last_task.data, {'work_done': 'Yes', 'delay_reason': 'Just Because'}) def suite(): diff --git a/tests/SpiffWorkflow/bpmn/data/MultiInstanceParallelTaskCond.bpmn b/tests/SpiffWorkflow/bpmn/data/MultiInstanceParallelTaskCond.bpmn index 2945c381a..53ecfd4e2 100644 --- a/tests/SpiffWorkflow/bpmn/data/MultiInstanceParallelTaskCond.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/MultiInstanceParallelTaskCond.bpmn @@ -1,5 +1,5 @@ - + Flow_0t6p1sb @@ -40,7 +40,7 @@ Flow_1dah8xt Flow_0io0g18 - + Flow_0io0g18 Flow_0i1bv5g Flow_1sx7n9u @@ -52,85 +52,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -140,6 +61,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Join-Long-Inclusive.bpmn20.xml b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Join-Long-Inclusive.bpmn20.xml index 80cf29724..077c57218 100644 --- a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Join-Long-Inclusive.bpmn20.xml +++ b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Join-Long-Inclusive.bpmn20.xml @@ -1,633 +1,653 @@ - - - - - - - - - - - - - - - sid-9CAB06E6-EDCF-4193-869A-FE8328E8CBFF - sid-F4CFA154-9281-4579-B117-0859A2BFF7E8 - sid-E489DED4-8C38-4841-80BC-E514353C1B8C - sid-B88338F7-5084-4532-9ABB-7387B1E5A664 - sid-35745597-A6C0-424B-884C-C5C23B60C942 - sid-0BC1E7F7-CBDA-4591-95B9-320FCBEF6114 - sid-45841FFD-3D92-4A18-9CE3-84DC5282F570 - sid-A8E18F57-FC41-401D-A397-9264C3E48293 - sid-E98E44A0-A273-4350-BA75-B37F2FCBA1DD - sid-29C1DD4B-9E3E-4686-892D-D47927F6DA08 - sid-107A993F-6302-4391-9BE2-068C9C7B693B - sid-71AA325A-4D02-46B4-8DC9-00C90BC5337C - sid-54BB293D-91B6-41B5-A5C4-423300D74D14 - sid-D8777102-7A64-42E6-A988-D0AE3049ABB0 - sid-E6A08072-E35C-4545-9C66-B74B615F34C2 - sid-BEC02819-27FE-4484-8FDA-08450F4DE618 - sid-6576AA43-43DF-4086-98C8-FD2B22F20EB0 - sid-08397892-678C-4706-A05F-8F6DAE9B5423 - sid-3500C16F-8037-4987-9022-8E30AB6B0590 - sid-A473B421-0981-49D8-BD5A-66832BD518EC - sid-F18EA1E5-B692-484C-AB84-2F422BF7868A - sid-D67A997E-C7CF-4581-8749-4F931D8737B5 - sid-399AE395-D46F-4A30-B875-E904970AF141 - sid-738EA50B-3EB5-464B-96B8-6CA5FC30ECBA - sid-5598F421-4AC5-4C12-9239-EFAC51C5F474 - sid-CF5677F8-747F-4E95-953E-4DAB186958F4 - sid-A73FF591-2A52-42DF-97DB-6CEEF8991283 - sid-69DF31CE-D587-4BA8-8BE6-72786108D8DF - sid-38B84B23-6757-4357-9AF5-A62A5C8AC1D3 - sid-732095A1-B07A-4B08-A46B-277C12901DED - sid-23391B60-C6A7-4C9E-9F95-43EA84ECFB74 - sid-9A40D0CD-3BD0-4A0D-A6B0-60FD60265247 - sid-B2E34105-96D5-4020-85D9-C569BA42D618 - sid-3D1455CF-6B1E-4EB1-81B2-D738110BB283 - sid-75EE4F61-E8E2-441B-8818-30E3BACF140B - sid-4864A824-7467-421A-A654-83EE83F7681C - sid-6938255D-3C1A-4B94-9E83-4D467E0DDB4B - - - - - - - sid-54E118FA-9A24-434C-9E65-36F9D01FB43D - - - - - - sid-54E118FA-9A24-434C-9E65-36F9D01FB43D - sid-7BFA5A55-E297-40FC-88A6-DF1DA809A12C - sid-C7247231-5152-424E-A240-B07B76E8F5EC - - - - - - sid-C609F3E0-2D09-469C-8750-3E3BA8C926BE - sid-0204722F-5A92-4236-BBF1-C66123E14E22 - - - - - - sid-0204722F-5A92-4236-BBF1-C66123E14E22 - sid-699ED598-1AB9-4A3B-9315-9C89578FB017 - - - - - - sid-699ED598-1AB9-4A3B-9315-9C89578FB017 - sid-85116AFA-E95A-4384-9695-361C1A6070C3 - - - - - - sid-85116AFA-E95A-4384-9695-361C1A6070C3 - sid-84756278-D67A-4E65-AD96-24325F08E2D1 - - - - - - sid-AE7CFA43-AC83-4F28-BCE3-AD7BE9CE6F27 - sid-C132728C-7DAF-468C-A807-90A34847071E - - - - - - sid-C132728C-7DAF-468C-A807-90A34847071E - sid-4A3A7E6E-F79B-4842-860C-407DB9227023 - - - - - - sid-4A3A7E6E-F79B-4842-860C-407DB9227023 - sid-B45563D3-2FBE-406D-93E4-85A2DD04B1A4 - - - - - - sid-D7D86B12-A88C-4072-9852-6DD62643556A - sid-AE7CFA43-AC83-4F28-BCE3-AD7BE9CE6F27 - - - - - - sid-369B410B-EA82-4896-91FD-23FFF759494A - sid-E47AA9C3-9EB7-4B07-BB17-086388AACE0D - - - - - - sid-84756278-D67A-4E65-AD96-24325F08E2D1 - sid-0C53B343-3753-4EED-A6FE-C1A7DFBF13BC - - - - - - sid-0C53B343-3753-4EED-A6FE-C1A7DFBF13BC - sid-9CA8DF1F-1622-4F6A-B9A6-761C60C29A11 - - - - - - sid-9CA8DF1F-1622-4F6A-B9A6-761C60C29A11 - sid-13838920-8EE4-45CB-8F01-29F13CA13819 - - - - - - sid-13838920-8EE4-45CB-8F01-29F13CA13819 - sid-FAA04C3A-F55B-4947-850D-5A180D43BD61 - - - - - - sid-FAA04C3A-F55B-4947-850D-5A180D43BD61 - sid-A19043EA-D140-48AE-99A1-4B1EA3DE0E51 - - - - - - sid-A19043EA-D140-48AE-99A1-4B1EA3DE0E51 - sid-2A94D2F0-DF4B-45B6-A30D-FFB9BDF6E9D9 - - - - - - sid-2A94D2F0-DF4B-45B6-A30D-FFB9BDF6E9D9 - sid-661F5F14-5B94-4977-9827-20654AE2719B - - - - - - sid-661F5F14-5B94-4977-9827-20654AE2719B - sid-C0DC27C3-19F9-4D3D-9D04-8869DAEDEF1E - - - - - - sid-B45563D3-2FBE-406D-93E4-85A2DD04B1A4 - sid-0E826E42-8FBC-4532-96EA-C82E7340CBA4 - - - - - - sid-0E826E42-8FBC-4532-96EA-C82E7340CBA4 - sid-BE9CBE97-0E09-4A37-BD98-65592D2F2E84 - - - - - - sid-BE9CBE97-0E09-4A37-BD98-65592D2F2E84 - sid-C96EBBBD-7DDA-4875-89AC-0F030E53C2B6 - - - - - - sid-C96EBBBD-7DDA-4875-89AC-0F030E53C2B6 - sid-8449C64C-CF1D-4601-ACAE-2CD61BE2D36C - - - - - - sid-8449C64C-CF1D-4601-ACAE-2CD61BE2D36C - sid-1DD0519A-72AD-4FB1-91D6-4D18F2DA1FC8 - - - - - - sid-1DD0519A-72AD-4FB1-91D6-4D18F2DA1FC8 - sid-42540C95-8E89-4B6F-B133-F677FA72C9FF - - - - - - sid-42540C95-8E89-4B6F-B133-F677FA72C9FF - sid-108A05A6-D07C-4DA9-AAC3-8075A721B44B - - - - - - sid-108A05A6-D07C-4DA9-AAC3-8075A721B44B - sid-A8886943-1369-43FB-BFC1-FF1FF974EB5D - - - - - - sid-7BFA5A55-E297-40FC-88A6-DF1DA809A12C - sid-7F5D9083-6201-43F9-BBEE-664E7310F4F2 - - - - - - sid-7F5D9083-6201-43F9-BBEE-664E7310F4F2 - sid-C609F3E0-2D09-469C-8750-3E3BA8C926BE - sid-C06DF3AB-4CE5-4123-8033-8AACDCDF4416 - - - - - - sid-C06DF3AB-4CE5-4123-8033-8AACDCDF4416 - sid-A0A2FCFF-E2BE-4FE6-A4D2-CCB3DCF68BFB - - - - - - sid-C7247231-5152-424E-A240-B07B76E8F5EC - sid-DC398932-1111-4CA2-AEB4-D460E0E06C6E - - - - - - sid-DC398932-1111-4CA2-AEB4-D460E0E06C6E - sid-D7D86B12-A88C-4072-9852-6DD62643556A - sid-16EB4D98-7F77-4046-8CDD-E07C796542FE - - - - - - sid-16EB4D98-7F77-4046-8CDD-E07C796542FE - sid-8E17C1AF-45C2-48C7-A794-1259E2ECA43D - - - - - - sid-A8886943-1369-43FB-BFC1-FF1FF974EB5D - sid-C0DC27C3-19F9-4D3D-9D04-8869DAEDEF1E - sid-369B410B-EA82-4896-91FD-23FFF759494A - - - - - - sid-8E17C1AF-45C2-48C7-A794-1259E2ECA43D - - - - - - sid-A0A2FCFF-E2BE-4FE6-A4D2-CCB3DCF68BFB - - - - - - sid-E47AA9C3-9EB7-4B07-BB17-086388AACE0D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + sid-9CAB06E6-EDCF-4193-869A-FE8328E8CBFF + sid-F4CFA154-9281-4579-B117-0859A2BFF7E8 + sid-E489DED4-8C38-4841-80BC-E514353C1B8C + sid-B88338F7-5084-4532-9ABB-7387B1E5A664 + sid-35745597-A6C0-424B-884C-C5C23B60C942 + sid-0BC1E7F7-CBDA-4591-95B9-320FCBEF6114 + sid-45841FFD-3D92-4A18-9CE3-84DC5282F570 + sid-A8E18F57-FC41-401D-A397-9264C3E48293 + sid-E98E44A0-A273-4350-BA75-B37F2FCBA1DD + sid-29C1DD4B-9E3E-4686-892D-D47927F6DA08 + sid-107A993F-6302-4391-9BE2-068C9C7B693B + sid-71AA325A-4D02-46B4-8DC9-00C90BC5337C + sid-54BB293D-91B6-41B5-A5C4-423300D74D14 + sid-D8777102-7A64-42E6-A988-D0AE3049ABB0 + sid-E6A08072-E35C-4545-9C66-B74B615F34C2 + sid-BEC02819-27FE-4484-8FDA-08450F4DE618 + sid-6576AA43-43DF-4086-98C8-FD2B22F20EB0 + sid-08397892-678C-4706-A05F-8F6DAE9B5423 + sid-3500C16F-8037-4987-9022-8E30AB6B0590 + sid-A473B421-0981-49D8-BD5A-66832BD518EC + sid-F18EA1E5-B692-484C-AB84-2F422BF7868A + sid-D67A997E-C7CF-4581-8749-4F931D8737B5 + sid-399AE395-D46F-4A30-B875-E904970AF141 + sid-738EA50B-3EB5-464B-96B8-6CA5FC30ECBA + sid-5598F421-4AC5-4C12-9239-EFAC51C5F474 + sid-CF5677F8-747F-4E95-953E-4DAB186958F4 + sid-A73FF591-2A52-42DF-97DB-6CEEF8991283 + sid-69DF31CE-D587-4BA8-8BE6-72786108D8DF + sid-38B84B23-6757-4357-9AF5-A62A5C8AC1D3 + sid-732095A1-B07A-4B08-A46B-277C12901DED + sid-23391B60-C6A7-4C9E-9F95-43EA84ECFB74 + sid-9A40D0CD-3BD0-4A0D-A6B0-60FD60265247 + sid-B2E34105-96D5-4020-85D9-C569BA42D618 + sid-3D1455CF-6B1E-4EB1-81B2-D738110BB283 + sid-75EE4F61-E8E2-441B-8818-30E3BACF140B + sid-4864A824-7467-421A-A654-83EE83F7681C + sid-6938255D-3C1A-4B94-9E83-4D467E0DDB4B + + + + + + + sid-54E118FA-9A24-434C-9E65-36F9D01FB43D + + + + + + sid-54E118FA-9A24-434C-9E65-36F9D01FB43D + sid-7BFA5A55-E297-40FC-88A6-DF1DA809A12C + sid-C7247231-5152-424E-A240-B07B76E8F5EC + + + + + + sid-C609F3E0-2D09-469C-8750-3E3BA8C926BE + sid-0204722F-5A92-4236-BBF1-C66123E14E22 + + + + + + sid-0204722F-5A92-4236-BBF1-C66123E14E22 + sid-699ED598-1AB9-4A3B-9315-9C89578FB017 + + + + + + sid-699ED598-1AB9-4A3B-9315-9C89578FB017 + sid-85116AFA-E95A-4384-9695-361C1A6070C3 + + + + + + sid-85116AFA-E95A-4384-9695-361C1A6070C3 + sid-84756278-D67A-4E65-AD96-24325F08E2D1 + + + + + + sid-AE7CFA43-AC83-4F28-BCE3-AD7BE9CE6F27 + sid-C132728C-7DAF-468C-A807-90A34847071E + + + + + + sid-C132728C-7DAF-468C-A807-90A34847071E + sid-4A3A7E6E-F79B-4842-860C-407DB9227023 + + + + + + sid-4A3A7E6E-F79B-4842-860C-407DB9227023 + sid-B45563D3-2FBE-406D-93E4-85A2DD04B1A4 + + + + + + sid-D7D86B12-A88C-4072-9852-6DD62643556A + sid-AE7CFA43-AC83-4F28-BCE3-AD7BE9CE6F27 + + + + + + sid-369B410B-EA82-4896-91FD-23FFF759494A + sid-E47AA9C3-9EB7-4B07-BB17-086388AACE0D + + + + + + sid-84756278-D67A-4E65-AD96-24325F08E2D1 + sid-0C53B343-3753-4EED-A6FE-C1A7DFBF13BC + + + + + + sid-0C53B343-3753-4EED-A6FE-C1A7DFBF13BC + sid-9CA8DF1F-1622-4F6A-B9A6-761C60C29A11 + + + + + + sid-9CA8DF1F-1622-4F6A-B9A6-761C60C29A11 + sid-13838920-8EE4-45CB-8F01-29F13CA13819 + + + + + + sid-13838920-8EE4-45CB-8F01-29F13CA13819 + sid-FAA04C3A-F55B-4947-850D-5A180D43BD61 + + + + + + sid-FAA04C3A-F55B-4947-850D-5A180D43BD61 + sid-A19043EA-D140-48AE-99A1-4B1EA3DE0E51 + + + + + + sid-A19043EA-D140-48AE-99A1-4B1EA3DE0E51 + sid-2A94D2F0-DF4B-45B6-A30D-FFB9BDF6E9D9 + + + + + + sid-2A94D2F0-DF4B-45B6-A30D-FFB9BDF6E9D9 + sid-661F5F14-5B94-4977-9827-20654AE2719B + + + + + + sid-661F5F14-5B94-4977-9827-20654AE2719B + sid-C0DC27C3-19F9-4D3D-9D04-8869DAEDEF1E + + + + + + sid-B45563D3-2FBE-406D-93E4-85A2DD04B1A4 + sid-0E826E42-8FBC-4532-96EA-C82E7340CBA4 + + + + + + sid-0E826E42-8FBC-4532-96EA-C82E7340CBA4 + sid-BE9CBE97-0E09-4A37-BD98-65592D2F2E84 + + + + + + sid-BE9CBE97-0E09-4A37-BD98-65592D2F2E84 + sid-C96EBBBD-7DDA-4875-89AC-0F030E53C2B6 + + + + + + sid-C96EBBBD-7DDA-4875-89AC-0F030E53C2B6 + sid-8449C64C-CF1D-4601-ACAE-2CD61BE2D36C + + + + + + sid-8449C64C-CF1D-4601-ACAE-2CD61BE2D36C + sid-1DD0519A-72AD-4FB1-91D6-4D18F2DA1FC8 + + + + + + sid-1DD0519A-72AD-4FB1-91D6-4D18F2DA1FC8 + sid-42540C95-8E89-4B6F-B133-F677FA72C9FF + + + + + + sid-42540C95-8E89-4B6F-B133-F677FA72C9FF + sid-108A05A6-D07C-4DA9-AAC3-8075A721B44B + + + + + + sid-108A05A6-D07C-4DA9-AAC3-8075A721B44B + sid-A8886943-1369-43FB-BFC1-FF1FF974EB5D + + + + + + sid-7BFA5A55-E297-40FC-88A6-DF1DA809A12C + sid-7F5D9083-6201-43F9-BBEE-664E7310F4F2 + + + + + + sid-7F5D9083-6201-43F9-BBEE-664E7310F4F2 + sid-C609F3E0-2D09-469C-8750-3E3BA8C926BE + sid-C06DF3AB-4CE5-4123-8033-8AACDCDF4416 + + + + + + sid-C06DF3AB-4CE5-4123-8033-8AACDCDF4416 + sid-A0A2FCFF-E2BE-4FE6-A4D2-CCB3DCF68BFB + + + + + + sid-C7247231-5152-424E-A240-B07B76E8F5EC + sid-DC398932-1111-4CA2-AEB4-D460E0E06C6E + + + + + + sid-DC398932-1111-4CA2-AEB4-D460E0E06C6E + sid-D7D86B12-A88C-4072-9852-6DD62643556A + sid-16EB4D98-7F77-4046-8CDD-E07C796542FE + + + + + + sid-16EB4D98-7F77-4046-8CDD-E07C796542FE + sid-8E17C1AF-45C2-48C7-A794-1259E2ECA43D + + + + + + sid-A8886943-1369-43FB-BFC1-FF1FF974EB5D + sid-C0DC27C3-19F9-4D3D-9D04-8869DAEDEF1E + sid-369B410B-EA82-4896-91FD-23FFF759494A + + + + + + sid-8E17C1AF-45C2-48C7-A794-1259E2ECA43D + + + + + + sid-A0A2FCFF-E2BE-4FE6-A4D2-CCB3DCF68BFB + + + + + + sid-E47AA9C3-9EB7-4B07-BB17-086388AACE0D + + + + + + + choice == 'No' + + + choice == 'Yes' + + + + + choice == 'No' + + + choice == 'Yes' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-One-Path-Ends.bpmn20.xml b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-One-Path-Ends.bpmn20.xml index 773ffc75e..b17d93698 100644 --- a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-One-Path-Ends.bpmn20.xml +++ b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-One-Path-Ends.bpmn20.xml @@ -1,192 +1,196 @@ - - - - - - - - - - - - - - - sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE - sid-349F8C0C-45EA-489C-84DD-1D944F48D778 - sid-57463471-693A-42A2-9EC6-6460BEDECA86 - sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 - sid-E2054FDD-0C20-4939-938D-2169B317FEE7 - sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 - sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 - sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB - sid-8FFE9D52-DC83-46A8-BB36-98BA94E5FE84 - sid-40294A27-262C-4805-94A0-36AC9DFEA55A - - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - - - - - - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-E3493781-6466-4AED-BAD2-63D115E14820 - - - - - - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - - - - - - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - sid-9C753C3D-F964-45B0-AF57-234F910529EF - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - - - - - - sid-9C753C3D-F964-45B0-AF57-234F910529EF - sid-A6DA25CE-636A-46B7-8005-759577956F09 - - - - - - sid-8B2BFD35-F1B2-4C77-AC51-F15960D8791A - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - - - - - - sid-A6DA25CE-636A-46B7-8005-759577956F09 - sid-E3493781-6466-4AED-BAD2-63D115E14820 - sid-8B2BFD35-F1B2-4C77-AC51-F15960D8791A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE + sid-349F8C0C-45EA-489C-84DD-1D944F48D778 + sid-57463471-693A-42A2-9EC6-6460BEDECA86 + sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 + sid-E2054FDD-0C20-4939-938D-2169B317FEE7 + sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 + sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB + sid-8FFE9D52-DC83-46A8-BB36-98BA94E5FE84 + sid-40294A27-262C-4805-94A0-36AC9DFEA55A + sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 + + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + + + + + + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-E3493781-6466-4AED-BAD2-63D115E14820 + + + + + + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + + + + + + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + sid-9C753C3D-F964-45B0-AF57-234F910529EF + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + + + + + + sid-9C753C3D-F964-45B0-AF57-234F910529EF + sid-A6DA25CE-636A-46B7-8005-759577956F09 + + + + + + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + + + + + + sid-A6DA25CE-636A-46B7-8005-759577956F09 + sid-E3493781-6466-4AED-BAD2-63D115E14820 + sid-8B2BFD35-F1B2-4C77-AC51-F15960D8791A + + + + + + + choice == 'Yes' + + + + + choice == 'No' + + + + + + + + sid-8B2BFD35-F1B2-4C77-AC51-F15960D8791A + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive-No-Inclusive.bpmn20.xml b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive-No-Inclusive.bpmn20.xml index 373bb7f23..deab7a403 100644 --- a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive-No-Inclusive.bpmn20.xml +++ b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive-No-Inclusive.bpmn20.xml @@ -1,219 +1,223 @@ - - - - - - - - - - - - - - - sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE - sid-349F8C0C-45EA-489C-84DD-1D944F48D778 - sid-57463471-693A-42A2-9EC6-6460BEDECA86 - sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 - sid-E2054FDD-0C20-4939-938D-2169B317FEE7 - sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 - sid-2A302E91-F89F-4913-8F55-5C3AC5FAE4D3 - sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 - sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB - sid-040FCBAD-0550-4251-B799-74FCDB0DC3E2 - sid-D856C519-562B-46A3-B32C-9587F394BD0F - - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - - - - - - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-E3493781-6466-4AED-BAD2-63D115E14820 - - - - - - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - - - - - - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - sid-9C753C3D-F964-45B0-AF57-234F910529EF - - - - - - sid-9C753C3D-F964-45B0-AF57-234F910529EF - sid-A6DA25CE-636A-46B7-8005-759577956F09 - - - - - - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE - - - - - - sid-0895E09C-077C-4D12-8C11-31F28CBC7740 - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE - sid-A6DA25CE-636A-46B7-8005-759577956F09 - sid-3B450653-1657-4247-B96E-6E3E6262BB97 - - - - - - sid-E3493781-6466-4AED-BAD2-63D115E14820 - sid-3B450653-1657-4247-B96E-6E3E6262BB97 - sid-0895E09C-077C-4D12-8C11-31F28CBC7740 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE + sid-349F8C0C-45EA-489C-84DD-1D944F48D778 + sid-57463471-693A-42A2-9EC6-6460BEDECA86 + sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 + sid-E2054FDD-0C20-4939-938D-2169B317FEE7 + sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 + sid-2A302E91-F89F-4913-8F55-5C3AC5FAE4D3 + sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 + sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB + sid-040FCBAD-0550-4251-B799-74FCDB0DC3E2 + sid-D856C519-562B-46A3-B32C-9587F394BD0F + + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + + + + + + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-E3493781-6466-4AED-BAD2-63D115E14820 + + + + + + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + + + + + + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + sid-9C753C3D-F964-45B0-AF57-234F910529EF + + + + + + sid-9C753C3D-F964-45B0-AF57-234F910529EF + sid-A6DA25CE-636A-46B7-8005-759577956F09 + + + + + + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE + + + + + + sid-0895E09C-077C-4D12-8C11-31F28CBC7740 + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE + sid-A6DA25CE-636A-46B7-8005-759577956F09 + sid-3B450653-1657-4247-B96E-6E3E6262BB97 + + + + + + sid-E3493781-6466-4AED-BAD2-63D115E14820 + sid-3B450653-1657-4247-B96E-6E3E6262BB97 + sid-0895E09C-077C-4D12-8C11-31F28CBC7740 + + + + + + + choice == 'No' + + + choice == 'Yes' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive.bpmn20.xml b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive.bpmn20.xml index f915b4c3d..5526cf68d 100644 --- a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive.bpmn20.xml +++ b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Then-Exclusive.bpmn20.xml @@ -1,202 +1,206 @@ - - - - - - - - - - - - - - - sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE - sid-349F8C0C-45EA-489C-84DD-1D944F48D778 - sid-57463471-693A-42A2-9EC6-6460BEDECA86 - sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 - sid-E2054FDD-0C20-4939-938D-2169B317FEE7 - sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 - sid-2A302E91-F89F-4913-8F55-5C3AC5FAE4D3 - sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 - sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB - sid-EBB511F3-5AD5-4307-9B9B-85C17F8889D5 - - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - - - - - - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-E3493781-6466-4AED-BAD2-63D115E14820 - - - - - - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - - - - - - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - sid-9C753C3D-F964-45B0-AF57-234F910529EF - - - - - - sid-9C753C3D-F964-45B0-AF57-234F910529EF - sid-A6DA25CE-636A-46B7-8005-759577956F09 - - - - - - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE - - - - - - sid-0895E09C-077C-4D12-8C11-31F28CBC7740 - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-E3493781-6466-4AED-BAD2-63D115E14820 - sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE - sid-A6DA25CE-636A-46B7-8005-759577956F09 - sid-0895E09C-077C-4D12-8C11-31F28CBC7740 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE + sid-349F8C0C-45EA-489C-84DD-1D944F48D778 + sid-57463471-693A-42A2-9EC6-6460BEDECA86 + sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 + sid-E2054FDD-0C20-4939-938D-2169B317FEE7 + sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 + sid-2A302E91-F89F-4913-8F55-5C3AC5FAE4D3 + sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 + sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB + sid-EBB511F3-5AD5-4307-9B9B-85C17F8889D5 + + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + + + + + + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-E3493781-6466-4AED-BAD2-63D115E14820 + + + + + + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + + + + + + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + sid-9C753C3D-F964-45B0-AF57-234F910529EF + + + + + + sid-9C753C3D-F964-45B0-AF57-234F910529EF + sid-A6DA25CE-636A-46B7-8005-759577956F09 + + + + + + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE + + + + + + sid-0895E09C-077C-4D12-8C11-31F28CBC7740 + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-E3493781-6466-4AED-BAD2-63D115E14820 + sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE + sid-A6DA25CE-636A-46B7-8005-759577956F09 + sid-0895E09C-077C-4D12-8C11-31F28CBC7740 + + + + + + + choice == 'No' + + + choice == 'Yes' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Through-Same-Task.bpmn20.xml b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Through-Same-Task.bpmn20.xml index fed03996b..5b328cdcc 100644 --- a/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Through-Same-Task.bpmn20.xml +++ b/tests/SpiffWorkflow/bpmn/data/Test-Workflows/Parallel-Through-Same-Task.bpmn20.xml @@ -1,201 +1,205 @@ - - - - - - - - - - - - - - - sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE - sid-349F8C0C-45EA-489C-84DD-1D944F48D778 - sid-57463471-693A-42A2-9EC6-6460BEDECA86 - sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 - sid-E2054FDD-0C20-4939-938D-2169B317FEE7 - sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 - sid-2A302E91-F89F-4913-8F55-5C3AC5FAE4D3 - sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 - sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB - sid-AF897BE2-CC07-4236-902B-DD6E1AB31842 - - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - - - - - - sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - - - - - - sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 - sid-A6DA25CE-636A-46B7-8005-759577956F09 - sid-E3493781-6466-4AED-BAD2-63D115E14820 - - - - - - sid-B6E22A74-A691-453A-A789-B9F8AF787D7C - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - - - - - - sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - sid-9C753C3D-F964-45B0-AF57-234F910529EF - - - - - - sid-9C753C3D-F964-45B0-AF57-234F910529EF - sid-A6DA25CE-636A-46B7-8005-759577956F09 - - - - - - sid-3742C960-71D0-4342-8064-AF1BB9EECB42 - sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE - - - - - - sid-0895E09C-077C-4D12-8C11-31F28CBC7740 - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-40496205-24D7-494C-AB6B-CD42B8D606EF - - - - - - sid-E3493781-6466-4AED-BAD2-63D115E14820 - sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE - sid-0895E09C-077C-4D12-8C11-31F28CBC7740 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + sid-B33EE043-AB93-4343-A1D4-7B267E2DAFBE + sid-349F8C0C-45EA-489C-84DD-1D944F48D778 + sid-57463471-693A-42A2-9EC6-6460BEDECA86 + sid-CA089240-802A-4C32-9130-FB1A33DDCCC3 + sid-E2054FDD-0C20-4939-938D-2169B317FEE7 + sid-34AD79D9-BE0C-4F97-AC23-7A97D238A6E5 + sid-2A302E91-F89F-4913-8F55-5C3AC5FAE4D3 + sid-F3A979E3-F586-4807-8223-1FAB5A5647B0 + sid-51816945-79BF-47F9-BA3C-E95ABAE3D1DB + sid-AF897BE2-CC07-4236-902B-DD6E1AB31842 + + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + + + + + + sid-F3994F51-FE54-4910-A1F4-E5895AA1A612 + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + + + + + + sid-7E15C71B-DE9E-4788-B140-A647C99FDC94 + sid-A6DA25CE-636A-46B7-8005-759577956F09 + sid-E3493781-6466-4AED-BAD2-63D115E14820 + + + + + + sid-B6E22A74-A691-453A-A789-B9F8AF787D7C + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + + + + + + sid-CAEAD081-6E73-4C98-8656-C67DA18F5140 + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + sid-9C753C3D-F964-45B0-AF57-234F910529EF + + + + + + sid-9C753C3D-F964-45B0-AF57-234F910529EF + sid-A6DA25CE-636A-46B7-8005-759577956F09 + + + + + + sid-3742C960-71D0-4342-8064-AF1BB9EECB42 + sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE + + + + + + sid-0895E09C-077C-4D12-8C11-31F28CBC7740 + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-40496205-24D7-494C-AB6B-CD42B8D606EF + + + + + + sid-E3493781-6466-4AED-BAD2-63D115E14820 + sid-12F60C82-D18F-4747-B5B5-34FD40F2C8DE + sid-0895E09C-077C-4D12-8C11-31F28CBC7740 + + + + + + + choice == 'No' + + + choice == 'Yes' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/boundary.bpmn b/tests/SpiffWorkflow/bpmn/data/boundary.bpmn index 00e53ccbd..773bdb7d5 100644 --- a/tests/SpiffWorkflow/bpmn/data/boundary.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/boundary.bpmn @@ -1,5 +1,5 @@ - + Flow_1pbxbk9 @@ -65,77 +65,46 @@ Flow_0yzqey7 - PT0.03S + "PT0.03S" - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - - - - - - + + + + - - - - + + + - - + + + + + + - - - - - - + + - - + + - - - - - - - - - - - @@ -145,10 +114,39 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/boundary_timer_on_task.bpmn b/tests/SpiffWorkflow/bpmn/data/boundary_timer_on_task.bpmn index bedebecf0..18901a5b7 100644 --- a/tests/SpiffWorkflow/bpmn/data/boundary_timer_on_task.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/boundary_timer_on_task.bpmn @@ -1,5 +1,5 @@ - + Flow_164sojd @@ -8,7 +8,7 @@ Flow_0ac4lx5 - timedelta(milliseconds=2) + "PT0.002S" @@ -34,32 +34,23 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -69,6 +60,15 @@ + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/event-gateway.bpmn b/tests/SpiffWorkflow/bpmn/data/event-gateway.bpmn index afa986ba5..1a83c7a45 100644 --- a/tests/SpiffWorkflow/bpmn/data/event-gateway.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/event-gateway.bpmn @@ -27,7 +27,7 @@ Flow_1rfbrlf Flow_0mppjk9 - timedelta(seconds=1) + "PT1S" diff --git a/tests/SpiffWorkflow/bpmn/data/inclusive_gateway.bpmn b/tests/SpiffWorkflow/bpmn/data/inclusive_gateway.bpmn new file mode 100644 index 000000000..8ea4f4969 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/inclusive_gateway.bpmn @@ -0,0 +1,131 @@ + + + + + Flow_1g5ma8d + + + + + Flow_1g7lmw3 + default + u_positive + w_positive + + + + u > 0 + + + w > 0 + + + + Flow_0byxq9y + Flow_0hatxr4 + Flow_17jgshs + check_v + + + + + check_v + + + v == 0 + + + Flow_1g5ma8d + Flow_1g7lmw3 + + + default + Flow_17jgshs + v += 1 + + + u_positive + Flow_0byxq9y + u += v + + + w_positive + Flow_0hatxr4 + w += v + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/serialization/v1-1.json b/tests/SpiffWorkflow/bpmn/data/serialization/v1-1.json new file mode 100644 index 000000000..22a3d9148 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/data/serialization/v1-1.json @@ -0,0 +1,590 @@ +{ + "serializer_version": "1.1", + "data": {}, + "last_task": "6bd75ef7-d765-4d0b-83ba-1158d2e9ed0a", + "success": true, + "tasks": { + "ccca8dcf-e833-494a-9281-ec133223ab75": { + "id": "ccca8dcf-e833-494a-9281-ec133223ab75", + "parent": null, + "children": [ + "6bd75ef7-d765-4d0b-83ba-1158d2e9ed0a" + ], + "last_state_change": 1673895963.536834, + "state": 32, + "task_spec": "Root", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "6bd75ef7-d765-4d0b-83ba-1158d2e9ed0a": { + "id": "6bd75ef7-d765-4d0b-83ba-1158d2e9ed0a", + "parent": "ccca8dcf-e833-494a-9281-ec133223ab75", + "children": [ + "34a70bb5-88f7-4a71-9dea-da6893437633" + ], + "last_state_change": 1673896001.8471706, + "state": 32, + "task_spec": "Start", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "34a70bb5-88f7-4a71-9dea-da6893437633": { + "id": "34a70bb5-88f7-4a71-9dea-da6893437633", + "parent": "6bd75ef7-d765-4d0b-83ba-1158d2e9ed0a", + "children": [ + "28d6b82b-64e9-41ad-9620-cc00497c859f", + "deb1eb94-6537-4cb8-a7e6-ea28c4983732" + ], + "last_state_change": 1673896001.8511543, + "state": 8, + "task_spec": "StartEvent_1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": { + "repeat": 2, + "start_time": "2023-01-16 14:06:41.847524" + }, + "data": { + "repeat_count": 0 + } + }, + "28d6b82b-64e9-41ad-9620-cc00497c859f": { + "id": "28d6b82b-64e9-41ad-9620-cc00497c859f", + "parent": "34a70bb5-88f7-4a71-9dea-da6893437633", + "children": [ + "a07abe4c-8122-494f-8b43-b3c44d3f7e34", + "975c49d4-dceb-4137-829c-64c657894701" + ], + "last_state_change": 1673895963.5375524, + "state": 4, + "task_spec": "StartEvent_1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "a07abe4c-8122-494f-8b43-b3c44d3f7e34": { + "id": "a07abe4c-8122-494f-8b43-b3c44d3f7e34", + "parent": "28d6b82b-64e9-41ad-9620-cc00497c859f", + "children": [], + "last_state_change": 1673895963.5380332, + "state": 4, + "task_spec": "return_to_StartEvent_1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "975c49d4-dceb-4137-829c-64c657894701": { + "id": "975c49d4-dceb-4137-829c-64c657894701", + "parent": "28d6b82b-64e9-41ad-9620-cc00497c859f", + "children": [ + "e937e37e-04a7-45b6-b6a4-7615876ae19f" + ], + "last_state_change": 1673895963.5380924, + "state": 4, + "task_spec": "task_1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "e937e37e-04a7-45b6-b6a4-7615876ae19f": { + "id": "e937e37e-04a7-45b6-b6a4-7615876ae19f", + "parent": "975c49d4-dceb-4137-829c-64c657894701", + "children": [ + "42036b41-f934-457a-86e7-cc3b65882073" + ], + "last_state_change": 1673895963.5384276, + "state": 4, + "task_spec": "Event_1uhhxu1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "42036b41-f934-457a-86e7-cc3b65882073": { + "id": "42036b41-f934-457a-86e7-cc3b65882073", + "parent": "e937e37e-04a7-45b6-b6a4-7615876ae19f", + "children": [ + "583f99df-db90-4237-8718-c1cf638c4391", + "24f73965-e218-4f94-8ca9-5267cbf635ad" + ], + "last_state_change": 1673895963.5386448, + "state": 4, + "task_spec": "task_2.BoundaryEventParent", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "583f99df-db90-4237-8718-c1cf638c4391": { + "id": "583f99df-db90-4237-8718-c1cf638c4391", + "parent": "42036b41-f934-457a-86e7-cc3b65882073", + "children": [ + "825b0a7b-b33e-4692-a11c-9c0fb49e20c0" + ], + "last_state_change": 1673895963.5391376, + "state": 4, + "task_spec": "task_2", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "825b0a7b-b33e-4692-a11c-9c0fb49e20c0": { + "id": "825b0a7b-b33e-4692-a11c-9c0fb49e20c0", + "parent": "583f99df-db90-4237-8718-c1cf638c4391", + "children": [ + "e5b6e43e-2ba9-42a2-90c0-25202f096273" + ], + "last_state_change": 1673895963.5393665, + "state": 4, + "task_spec": "Event_1vzwq7p", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "e5b6e43e-2ba9-42a2-90c0-25202f096273": { + "id": "e5b6e43e-2ba9-42a2-90c0-25202f096273", + "parent": "825b0a7b-b33e-4692-a11c-9c0fb49e20c0", + "children": [ + "0a5fbc15-2807-463d-9762-b7b724835a40" + ], + "last_state_change": 1673895963.5396175, + "state": 4, + "task_spec": "migration_test.EndJoin", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "0a5fbc15-2807-463d-9762-b7b724835a40": { + "id": "0a5fbc15-2807-463d-9762-b7b724835a40", + "parent": "e5b6e43e-2ba9-42a2-90c0-25202f096273", + "children": [], + "last_state_change": 1673895963.5398767, + "state": 4, + "task_spec": "End", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "24f73965-e218-4f94-8ca9-5267cbf635ad": { + "id": "24f73965-e218-4f94-8ca9-5267cbf635ad", + "parent": "42036b41-f934-457a-86e7-cc3b65882073", + "children": [], + "last_state_change": 1673895963.5390024, + "state": 1, + "task_spec": "Event_1bkh7yi", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "deb1eb94-6537-4cb8-a7e6-ea28c4983732": { + "id": "deb1eb94-6537-4cb8-a7e6-ea28c4983732", + "parent": "34a70bb5-88f7-4a71-9dea-da6893437633", + "children": [ + "56045c5b-9400-4fea-ae82-b357268672f8" + ], + "last_state_change": 1673895963.5376105, + "state": 4, + "task_spec": "task_1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "56045c5b-9400-4fea-ae82-b357268672f8": { + "id": "56045c5b-9400-4fea-ae82-b357268672f8", + "parent": "deb1eb94-6537-4cb8-a7e6-ea28c4983732", + "children": [ + "fd71446e-d8b4-42dd-980b-624a82848853" + ], + "last_state_change": 1673895963.540343, + "state": 4, + "task_spec": "Event_1uhhxu1", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "fd71446e-d8b4-42dd-980b-624a82848853": { + "id": "fd71446e-d8b4-42dd-980b-624a82848853", + "parent": "56045c5b-9400-4fea-ae82-b357268672f8", + "children": [ + "8960300d-28c1-463d-b7a1-29e872c02d98", + "a6bca2b5-7064-49c9-a172-18c1435d173d" + ], + "last_state_change": 1673895963.5405483, + "state": 4, + "task_spec": "task_2.BoundaryEventParent", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "8960300d-28c1-463d-b7a1-29e872c02d98": { + "id": "8960300d-28c1-463d-b7a1-29e872c02d98", + "parent": "fd71446e-d8b4-42dd-980b-624a82848853", + "children": [ + "6b33df30-07fd-4572-abfd-f29eb9906f0b" + ], + "last_state_change": 1673895963.540891, + "state": 4, + "task_spec": "task_2", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "6b33df30-07fd-4572-abfd-f29eb9906f0b": { + "id": "6b33df30-07fd-4572-abfd-f29eb9906f0b", + "parent": "8960300d-28c1-463d-b7a1-29e872c02d98", + "children": [ + "0d571ca2-ffb1-4d8b-9dda-4e8cbd8b8ae1" + ], + "last_state_change": 1673895963.5411036, + "state": 4, + "task_spec": "Event_1vzwq7p", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "0d571ca2-ffb1-4d8b-9dda-4e8cbd8b8ae1": { + "id": "0d571ca2-ffb1-4d8b-9dda-4e8cbd8b8ae1", + "parent": "6b33df30-07fd-4572-abfd-f29eb9906f0b", + "children": [ + "1e8fc80a-1968-4411-a10b-16cb4261f3b8" + ], + "last_state_change": 1673895963.5413618, + "state": 4, + "task_spec": "migration_test.EndJoin", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "1e8fc80a-1968-4411-a10b-16cb4261f3b8": { + "id": "1e8fc80a-1968-4411-a10b-16cb4261f3b8", + "parent": "0d571ca2-ffb1-4d8b-9dda-4e8cbd8b8ae1", + "children": [], + "last_state_change": 1673895963.541654, + "state": 4, + "task_spec": "End", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + }, + "a6bca2b5-7064-49c9-a172-18c1435d173d": { + "id": "a6bca2b5-7064-49c9-a172-18c1435d173d", + "parent": "fd71446e-d8b4-42dd-980b-624a82848853", + "children": [], + "last_state_change": 1673895963.5408392, + "state": 1, + "task_spec": "Event_1bkh7yi", + "triggered": false, + "workflow_name": "migration_test", + "internal_data": {}, + "data": {} + } + }, + "root": "ccca8dcf-e833-494a-9281-ec133223ab75", + "spec": { + "name": "migration_test", + "description": "migration_test", + "file": "/home/essweine/work/sartography/code/SpiffWorkflow/tests/SpiffWorkflow/bpmn/data/serialization/v1-1.bpmn", + "task_specs": { + "Start": { + "id": "migration_test_1", + "name": "Start", + "description": "", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [], + "outputs": [ + "StartEvent_1" + ], + "typename": "StartTask" + }, + "migration_test.EndJoin": { + "id": "migration_test_2", + "name": "migration_test.EndJoin", + "description": "", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "Event_1vzwq7p" + ], + "outputs": [ + "End" + ], + "typename": "_EndJoin" + }, + "End": { + "id": "migration_test_3", + "name": "End", + "description": "", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "migration_test.EndJoin" + ], + "outputs": [], + "typename": "Simple" + }, + "StartEvent_1": { + "id": "migration_test_4", + "name": "StartEvent_1", + "description": null, + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "Start", + "StartEvent_1" + ], + "outputs": [ + "StartEvent_1", + "task_1" + ], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 179.0, + "y": 79.0 + }, + "data_input_associations": [], + "data_output_associations": [], + "event_definition": { + "internal": true, + "external": true, + "label": "StartEvent_1", + "cycle_definition": "(2,timedelta(seconds=0.1))", + "typename": "CycleTimerEventDefinition" + }, + "typename": "StartEvent", + "extensions": {} + }, + "task_1": { + "id": "migration_test_5", + "name": "task_1", + "description": "Task 1", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "StartEvent_1" + ], + "outputs": [ + "Event_1uhhxu1" + ], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 290.0, + "y": 57.0 + }, + "data_input_associations": [], + "data_output_associations": [], + "script": "pass", + "typename": "ScriptTask", + "extensions": {} + }, + "Event_1uhhxu1": { + "id": "migration_test_6", + "name": "Event_1uhhxu1", + "description": null, + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "task_1" + ], + "outputs": [ + "task_2.BoundaryEventParent" + ], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 452.0, + "y": 79.0 + }, + "data_input_associations": [], + "data_output_associations": [], + "event_definition": { + "internal": true, + "external": true, + "label": "Event_1uhhxu1", + "dateTime": "datetime(2023, 1, 1)", + "typename": "TimerEventDefinition" + }, + "typename": "IntermediateCatchEvent", + "extensions": {} + }, + "task_2": { + "id": "migration_test_7", + "name": "task_2", + "description": "Task 2", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "task_2.BoundaryEventParent" + ], + "outputs": [ + "Event_1vzwq7p" + ], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 560.0, + "y": 57.0 + }, + "data_input_associations": [], + "data_output_associations": [], + "script": "time.sleep(0.5)", + "typename": "ScriptTask", + "extensions": {} + }, + "task_2.BoundaryEventParent": { + "id": "migration_test_8", + "name": "task_2.BoundaryEventParent", + "description": "", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "Event_1uhhxu1" + ], + "outputs": [ + "task_2", + "Event_1bkh7yi" + ], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 0, + "y": 0 + }, + "data_input_associations": [], + "data_output_associations": [], + "main_child_task_spec": "task_2", + "typename": "_BoundaryEventParent" + }, + "Event_1bkh7yi": { + "id": "migration_test_9", + "name": "Event_1bkh7yi", + "description": null, + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "task_2.BoundaryEventParent" + ], + "outputs": [], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 592.0, + "y": 119.0 + }, + "data_input_associations": [], + "data_output_associations": [], + "event_definition": { + "internal": true, + "external": true, + "label": "Event_1bkh7yi", + "dateTime": "timedelta(seconds=0.1)", + "typename": "TimerEventDefinition" + }, + "cancel_activity": true, + "typename": "BoundaryEvent", + "extensions": {} + }, + "Event_1vzwq7p": { + "id": "migration_test_10", + "name": "Event_1vzwq7p", + "description": null, + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "task_2" + ], + "outputs": [ + "migration_test.EndJoin" + ], + "lane": null, + "documentation": null, + "loopTask": false, + "position": { + "x": 742.0, + "y": 79.0 + }, + "data_input_associations": [], + "data_output_associations": [], + "event_definition": { + "internal": false, + "external": false, + "typename": "NoneEventDefinition" + }, + "typename": "EndEvent", + "extensions": {} + }, + "Root": { + "id": "migration_test_11", + "name": "Root", + "description": "", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [], + "outputs": [], + "typename": "Simple" + }, + "return_to_StartEvent_1": { + "id": "migration_test_12", + "name": "return_to_StartEvent_1", + "description": "", + "manual": false, + "internal": false, + "lookahead": 2, + "inputs": [ + "Start", + "StartEvent_1" + ], + "outputs": [], + "destination_id": "34a70bb5-88f7-4a71-9dea-da6893437633", + "destination_spec_name": "StartEvent_1", + "typename": "LoopResetTask" + } + }, + "data_inputs": [], + "data_outputs": [], + "data_objects": {}, + "correlation_keys": {}, + "typename": "BpmnProcessSpec" + }, + "subprocess_specs": {}, + "subprocesses": {}, + "bpmn_messages": [] +} diff --git a/tests/SpiffWorkflow/bpmn/data/timer-cycle-start.bpmn b/tests/SpiffWorkflow/bpmn/data/timer-cycle-start.bpmn index 9d75c9c9e..a79e47785 100644 --- a/tests/SpiffWorkflow/bpmn/data/timer-cycle-start.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/timer-cycle-start.bpmn @@ -22,7 +22,7 @@ Flow_0jtfzsk - (2,timedelta(seconds=0.1)) + "R2/PT0.1S" @@ -37,7 +37,7 @@ Flow_1pahvlr Flow_05ejbm4 - timedelta(seconds=0.5) + "PT0.5S" diff --git a/tests/SpiffWorkflow/bpmn/data/timer-cycle.bpmn b/tests/SpiffWorkflow/bpmn/data/timer-cycle.bpmn index 9252d2f54..0c4a62cc0 100644 --- a/tests/SpiffWorkflow/bpmn/data/timer-cycle.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/timer-cycle.bpmn @@ -1,5 +1,5 @@ - + Flow_1pahvlr @@ -32,12 +32,32 @@ Flow_1pzc4jz - (2,timedelta(seconds=0.01)) + "R2/PT0.1S" + + + + + + + + + + + + + + + + + + + + @@ -50,29 +70,9 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/SpiffWorkflow/bpmn/data/timer-date-start.bpmn b/tests/SpiffWorkflow/bpmn/data/timer-date-start.bpmn index 46f907b9c..f8b341c0c 100644 --- a/tests/SpiffWorkflow/bpmn/data/timer-date-start.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/timer-date-start.bpmn @@ -1,17 +1,10 @@ - + Flow_1i73q45 - - Flow_1i73q45 - Flow_00e79cz - futuredate = datetime.now() + timedelta(0, 1) - timedelta(seconds=.95) -futuredate2 = datetime.strptime('2021-09-01 10:00','%Y-%m-%d %H:%M') - - Flow_00e79cz Flow_1bdrcxy @@ -19,54 +12,46 @@ futuredate2 = datetime.strptime('2021-09-01 10:00','%Y-%m-%d %H:%M')futuredate - - - Flow_1bdrcxy - Flow_0bjksyv - print('yay!') -completed = True - + - Flow_0bjksyv + Flow_1bdrcxy - + + Flow_1i73q45 + Flow_00e79cz + futuredate = (datetime.now() + timedelta(seconds=0.05)).isoformat() + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + - - - - diff --git a/tests/SpiffWorkflow/bpmn/data/timer-non-interrupt-boundary.bpmn b/tests/SpiffWorkflow/bpmn/data/timer-non-interrupt-boundary.bpmn index 25d750e27..d44078c59 100644 --- a/tests/SpiffWorkflow/bpmn/data/timer-non-interrupt-boundary.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/timer-non-interrupt-boundary.bpmn @@ -1,5 +1,5 @@ - + Flow_1hyztad @@ -38,7 +38,7 @@ Flow_03e1mfr - timedelta(seconds=.2) + "PT0.2S" @@ -59,74 +59,46 @@ Flow_0tlkkap Flow_0vper9q - + - Flow_0or6odg - - - - - - - - Flow_0vper9q - Flow_0or6odg - + - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - - - + + + - - - + + + - - + + + + + + + + + - + - - - - - - - @@ -137,32 +109,43 @@ + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + - - - - - - + + + + + diff --git a/tests/SpiffWorkflow/bpmn/data/timer.bpmn b/tests/SpiffWorkflow/bpmn/data/timer.bpmn index fa26d75fb..9700df6a6 100644 --- a/tests/SpiffWorkflow/bpmn/data/timer.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/timer.bpmn @@ -1,68 +1,44 @@ - + Flow_1pahvlr - - Flow_1pahvlr - Flow_1pvkgnu - - Flow_1pvkgnu + Flow_1pahvlr Flow_1elbn9u - timedelta(seconds=.25) + "PT0.25S" - - Flow_1elbn9u - Flow_1ekgt3x - - Flow_1ekgt3x + Flow_1elbn9u - - - - + + + + + + + + + + - - - - + - + - - - - + - - - - - - - - - - - - - - - - diff --git a/tests/SpiffWorkflow/bpmn/data/too_many_loops.bpmn b/tests/SpiffWorkflow/bpmn/data/too_many_loops.bpmn index 8353d16d7..97f663c69 100644 --- a/tests/SpiffWorkflow/bpmn/data/too_many_loops.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/too_many_loops.bpmn @@ -1,5 +1,5 @@ - + Flow_1gb8wca @@ -25,7 +25,7 @@ Days elapsed: {{days_delta }} Flow_0op1a19 Flow_1gb8wca - timedelta(milliseconds=10) + "PT.01S" @@ -57,6 +57,14 @@ Days elapsed: {{days_delta }} + + + + + + + + @@ -85,16 +93,8 @@ Days elapsed: {{days_delta }} - - - - - - - - - - + + @@ -114,12 +114,12 @@ Days elapsed: {{days_delta }} - - - + + + diff --git a/tests/SpiffWorkflow/bpmn/data/too_many_loops_sub_process.bpmn b/tests/SpiffWorkflow/bpmn/data/too_many_loops_sub_process.bpmn index 2f6a8b53a..ed1461dbb 100644 --- a/tests/SpiffWorkflow/bpmn/data/too_many_loops_sub_process.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/too_many_loops_sub_process.bpmn @@ -1,5 +1,5 @@ - + Flow_0q7fkb7 @@ -29,7 +29,7 @@ Days elapsed: {{days_delta }} Flow_1ivr6d7 Flow_1gb8wca - timedelta(milliseconds=10) + "PT0.01S" diff --git a/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py b/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py index 1324d0271..0bd5c5789 100644 --- a/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py +++ b/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py @@ -15,7 +15,7 @@ class ActionManagementTest(BpmnWorkflowTestCase): FINISH_TIME_DELTA=0.10 def now_plus_seconds(self, seconds): - return datetime.datetime.now() + datetime.timedelta(seconds=seconds) + return (datetime.datetime.now() + datetime.timedelta(seconds=seconds)).isoformat() def setUp(self): self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/Action-Management.bpmn20.xml', 'Action Management') diff --git a/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py b/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py new file mode 100644 index 000000000..cb4381a57 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/events/TimeDurationParseTest.py @@ -0,0 +1,60 @@ +import unittest +from datetime import datetime + +from SpiffWorkflow.bpmn.specs.events.event_definitions import TimerEventDefinition + +class TimeDurationParseTest(unittest.TestCase): + "Non-exhaustive ISO durations, but hopefully covers basic support" + + def test_parse_duration(self): + + valid = [ + ("P1Y6M1DT1H1M1S", {'years': 1, 'months': 6, 'days': 1, 'hours': 1, 'minutes': 1, 'seconds': 1 }), # everything + ("P1Y6M1DT1H1M1.5S", {'years': 1, 'months': 6, 'days': 1, 'hours': 1, 'minutes': 1, 'seconds': 1.5 }), # fractional seconds + ("P1YT1H1M1S", {'years': 1, 'hours': 1, 'minutes': 1, 'seconds': 1 }), # minutes but no month + ("P1MT1H", {'months': 1, 'hours':1}), # months but no minutes + ("P4W", {'weeks': 4}), # weeks + ("P1Y6M1D", {'years': 1, 'months': 6, 'days': 1}), # no time + ("PT1H1M1S", {'hours': 1,'minutes': 1,'seconds': 1}), # time only + ("PT1.5H", {'hours': 1.5}), # alt fractional + ("T1,5H", {'hours': 1.5}), # fractional with comma + ("PDT1H1M1S", {'hours': 1, 'minutes': 1, 'seconds': 1}), # empty spec + ("PYMDT1H1M1S", {'hours': 1, 'minutes': 1, 'seconds': 1}), # multiple empty + ] + for duration, parsed_duration in valid: + result = TimerEventDefinition.parse_iso_duration(duration) + self.assertDictEqual(result, parsed_duration) + + invalid = [ + "PT1.5H30S", # fractional duration with subsequent non-fractional + "PT1,5H30S", # with comma + "P1H1M1S", # missing 't' + "P1DT", # 't' without time spec + "P1W1D", # conflicting day specs + "PT1H1M1", # trailing values + ] + for duration in invalid: + self.assertRaises(Exception, TimerEventDefinition.parse_iso_duration, duration) + + def test_calculate_timedelta_from_start(self): + + start, one_day = datetime.fromisoformat("2023-01-01"), 24 * 3600 + # Leap years + self.assertEqual(TimerEventDefinition.get_timedelta_from_start({'years': 1}, start).total_seconds(), 365 * one_day) + self.assertEqual(TimerEventDefinition.get_timedelta_from_start({'years': 2}, start).total_seconds(), (365 + 366) * one_day) + # Increment by month does not change day + for month in range(1, 13): + dt = start + TimerEventDefinition.get_timedelta_from_start({'months': month}, start) + self.assertEqual(dt.day, 1) + + def test_calculate_timedelta_from_end(self): + end, one_day = datetime.fromisoformat("2025-01-01"), 24 * 3600 + # Leap years + self.assertEqual(TimerEventDefinition.get_timedelta_from_end({'years': 1}, end).total_seconds(), 366 * one_day) + self.assertEqual(TimerEventDefinition.get_timedelta_from_end({'years': 2}, end).total_seconds(), (365 + 366) * one_day) + + dt = end - TimerEventDefinition.get_timedelta_from_end({'months': 11}, end) + # Decrement by month does not change day + for month in range(1, 13): + dt = end - TimerEventDefinition.get_timedelta_from_end({'months': month}, end) + self.assertEqual(dt.day, 1) \ No newline at end of file diff --git a/tests/SpiffWorkflow/bpmn/events/TimerCycleStartTest.py b/tests/SpiffWorkflow/bpmn/events/TimerCycleStartTest.py index 98de249c7..bf89912c2 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerCycleStartTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerCycleStartTest.py @@ -5,12 +5,14 @@ import unittest import time from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine -from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'kellym' +# the data doesn't really propagate to the end as in a 'normal' workflow, so I call a +# custom function that records the number of times this got called so that +# we can keep track of how many times the triggered item gets called. counter = 0 def my_custom_function(): global counter @@ -41,31 +43,24 @@ class TimerCycleStartTest(BpmnWorkflowTestCase): def testThroughSaveRestore(self): self.actual_test(save_restore=True) - def actual_test(self,save_restore = False): global counter - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) # Start Event - self.workflow.complete_task_from_id(ready_tasks[0].id) - self.workflow.do_engine_steps() - - # the data doesn't really propagate to the end as in a 'normal' workflow, so I call a - # custom function that records the number of times this got called so that - # we can keep track of how many times the triggered item gets called. counter = 0 - # We have a loop so we can continue to execute waiting tasks when # timers expire. The test workflow has a wait timer that pauses long enough to - # allow the cycle to complete twice -- otherwise the first iteration through the - # cycle process causes the remaining tasks to be cancelled. - for loopcount in range(5): + # allow the cycle to complete three times before being cancelled by the terminate + # event (the timer should only run twice, we want to make sure it doesn't keep + # executing) + for loopcount in range(6): + self.workflow.do_engine_steps() if save_restore: self.save_restore() self.workflow.script_engine = CustomScriptEngine() time.sleep(0.1) self.workflow.refresh_waiting_tasks() - self.workflow.do_engine_steps() + self.assertEqual(counter, 2) + self.assertTrue(self.workflow.is_completed()) def suite(): diff --git a/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py b/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py index 56b527300..5c61f3818 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerCycleTest.py @@ -30,7 +30,7 @@ class CustomScriptEngine(PythonScriptEngine): -class TimerDurationTest(BpmnWorkflowTestCase): +class TimerCycleTest(BpmnWorkflowTestCase): def setUp(self): self.spec, self.subprocesses = self.load_workflow_spec('timer-cycle.bpmn', 'timer') @@ -42,31 +42,34 @@ class TimerDurationTest(BpmnWorkflowTestCase): def testThroughSaveRestore(self): self.actual_test(save_restore=True) - def actual_test(self,save_restore = False): global counter - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) # Start Event - self.workflow.complete_task_from_id(ready_tasks[0].id) - self.workflow.do_engine_steps() - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) # GetCoffee - - # See comments in timer cycle test for more context counter = 0 + # See comments in timer cycle test start for more context for loopcount in range(5): + self.workflow.do_engine_steps() if save_restore: self.save_restore() self.workflow.script_engine = CustomScriptEngine() - time.sleep(0.01) + time.sleep(0.05) self.workflow.refresh_waiting_tasks() - self.workflow.do_engine_steps() - - pass - #self.assertEqual(counter, 2) + events = self.workflow.waiting_events() + if loopcount == 0: + # Wait time is 0.1s, so the first time through, there should still be a waiting event + self.assertEqual(len(events), 1) + else: + # By the second iteration, both should be complete + self.assertEqual(len(events), 0) + # Get coffee still ready + coffee = self.workflow.get_tasks_from_spec_name('Get_Coffee')[0] + self.assertEqual(coffee.state, TaskState.READY) + # Timer completed + timer = self.workflow.get_tasks_from_spec_name('CatchMessage')[0] + self.assertEqual(timer.state, TaskState.COMPLETED) + self.assertEqual(counter, 2) def suite(): - return unittest.TestLoader().loadTestsFromTestCase(TimerDurationTest) + return unittest.TestLoader().loadTestsFromTestCase(TimerCycleTest) if __name__ == '__main__': unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/bpmn/events/TimerDateTest.py b/tests/SpiffWorkflow/bpmn/events/TimerDateTest.py index d6157ecdd..deebd7754 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerDateTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerDateTest.py @@ -4,7 +4,6 @@ import unittest import datetime import time -from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -28,37 +27,22 @@ class TimerDateTest(BpmnWorkflowTestCase): def testThroughSaveRestore(self): self.actual_test(save_restore=True) - def actual_test(self,save_restore = False): - global counter - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) # Start Event - self.workflow.complete_task_from_id(ready_tasks[0].id) self.workflow.do_engine_steps() - + self.assertEqual(len(self.workflow.waiting_events()), 1) loopcount = 0 - # test bpmn has a timeout of .05s - # we should terminate loop before that. starttime = datetime.datetime.now() - counter = 0 - while loopcount < 8: - if len(self.workflow.get_tasks(TaskState.READY)) >= 1: - break + # test bpmn has a timeout of .05s; we should terminate loop before that. + while len(self.workflow.get_waiting_tasks()) > 0 and loopcount < 8: if save_restore: self.save_restore() self.workflow.script_engine = self.script_engine - - - waiting_tasks = self.workflow.get_tasks(TaskState.WAITING) time.sleep(0.01) self.workflow.refresh_waiting_tasks() - loopcount = loopcount +1 + loopcount += 1 endtime = datetime.datetime.now() self.workflow.do_engine_steps() - testdate = datetime.datetime.strptime('2021-09-01 10:00','%Y-%m-%d %H:%M') - self.assertEqual(self.workflow.last_task.data['futuredate2'],testdate) - self.assertTrue('completed' in self.workflow.last_task.data) - self.assertTrue(self.workflow.last_task.data['completed']) + self.assertTrue(self.workflow.is_completed()) self.assertTrue((endtime-starttime) > datetime.timedelta(seconds=.02)) diff --git a/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryOnTaskTest.py b/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryOnTaskTest.py index 9bd1f322b..aff5d4299 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryOnTaskTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryOnTaskTest.py @@ -1,12 +1,9 @@ # -*- coding: utf-8 -*- import unittest -import datetime import time from datetime import timedelta -from SpiffWorkflow.bpmn.specs.events.EndEvent import EndEvent -from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -27,45 +24,23 @@ class TimerDurationTest(BpmnWorkflowTestCase): self.actual_test(save_restore=True) def actual_test(self,save_restore = False): - # In the normal flow of things, the final end event should be the last task - self.workflow.do_engine_steps() - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - self.workflow.complete_task_from_id(ready_tasks[0].id) - self.workflow.do_engine_steps() - self.assertTrue(self.workflow.is_completed()) - end_events = [] - for task in self.workflow.get_tasks(): - if isinstance(task.task_spec, EndEvent): - end_events.append(task) - self.assertEqual(1, len(end_events)) - - # In the event of a timer firing, the last task should STILL - # be the final end event. - - starttime = datetime.datetime.now() - self.workflow = BpmnWorkflow(self.spec) - self.workflow.script_engine = self.script_engine self.workflow.do_engine_steps() if save_restore: self.save_restore() self.workflow.script_engine = self.script_engine - time.sleep(0.1) + time.sleep(1) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() + + # Make sure the timer got called + self.assertEqual(self.workflow.last_task.data['timer_called'],True) + + # Make sure the task can still be called. task = self.workflow.get_ready_user_tasks()[0] - self.workflow.complete_task_from_id(task.id) + task.complete() self.workflow.do_engine_steps() - self.assertTrue(self.workflow.is_completed()) - end_events = [] - - for task in self.workflow.get_tasks(): - if isinstance(task.task_spec, EndEvent): - end_events.append(task) - self.assertEqual(1, len(end_events)) - def suite(): diff --git a/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryTest.py b/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryTest.py index 2297aa271..ce248dae0 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerDurationBoundaryTest.py @@ -3,7 +3,6 @@ import unittest import time -from SpiffWorkflow.bpmn.FeelLikeScriptEngine import FeelLikeScriptEngine from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -23,35 +22,31 @@ class TimerDurationTest(BpmnWorkflowTestCase): self.actual_test(save_restore=True) def actual_test(self,save_restore = False): - self.workflow.script_engine = FeelLikeScriptEngine() - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - self.workflow.complete_task_from_id(ready_tasks[0].id) self.workflow.do_engine_steps() ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - ready_tasks[0].data['answer']='No' - self.workflow.complete_task_from_id(ready_tasks[0].id) + ready_tasks[0].complete() self.workflow.do_engine_steps() loopcount = 0 - # test bpmn has a timeout of .03s - # we should terminate loop before that. - - while loopcount < 11: - ready_tasks = self.workflow.get_tasks(TaskState.READY) - if len(ready_tasks) < 1: - break + # test bpmn has a timeout of .03s; we should terminate loop before that. + while len(self.workflow.get_waiting_tasks()) == 2 and loopcount < 11: if save_restore: self.save_restore() - self.workflow.script_engine = FeelLikeScriptEngine() - #self.assertEqual(1, len(self.workflow.get_tasks(Task.WAITING))) time.sleep(0.01) - self.workflow.complete_task_from_id(ready_tasks[0].id) + self.assertEqual(len(self.workflow.get_tasks(TaskState.READY)), 1) self.workflow.refresh_waiting_tasks() self.workflow.do_engine_steps() - loopcount = loopcount +1 + loopcount += 1 + self.workflow.do_engine_steps() + subworkflow = self.workflow.get_tasks_from_spec_name('Subworkflow')[0] + self.assertEqual(subworkflow.state, TaskState.CANCELLED) + ready_tasks = self.workflow.get_ready_user_tasks() + while len(ready_tasks) > 0: + ready_tasks[0].complete() + ready_tasks = self.workflow.get_ready_user_tasks() + self.workflow.do_engine_steps() + self.assertTrue(self.workflow.is_completed()) # Assure that the loopcount is less than 10, and the timer interrupt fired, rather # than allowing us to continue to loop the full 10 times. self.assertTrue(loopcount < 10) diff --git a/tests/SpiffWorkflow/bpmn/events/TimerDurationTest.py b/tests/SpiffWorkflow/bpmn/events/TimerDurationTest.py index 8026483de..c8e72fcd4 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerDurationTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerDurationTest.py @@ -1,10 +1,8 @@ # -*- coding: utf-8 -*- import unittest -import datetime import time -from datetime import timedelta -from SpiffWorkflow.task import TaskState +from datetime import datetime, timedelta from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase @@ -25,35 +23,25 @@ class TimerDurationTest(BpmnWorkflowTestCase): def testThroughSaveRestore(self): self.actual_test(save_restore=True) - def actual_test(self,save_restore = False): - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - self.workflow.complete_task_from_id(ready_tasks[0].id) - self.workflow.do_engine_steps() - ready_tasks = self.workflow.get_tasks(TaskState.READY) - self.assertEqual(1, len(ready_tasks)) - self.workflow.complete_task_from_id(ready_tasks[0].id) self.workflow.do_engine_steps() + self.assertEqual(len(self.workflow.waiting_events()), 1) loopcount = 0 - # test bpmn has a timeout of .25s - # we should terminate loop before that. - starttime = datetime.datetime.now() - while loopcount < 10: - if len(self.workflow.get_tasks(TaskState.READY)) >= 1: - break + starttime = datetime.now() + # test bpmn has a timeout of .25s; we should terminate loop before that. + while len(self.workflow.get_waiting_tasks()) > 0 and loopcount < 10: if save_restore: self.save_restore() self.workflow.script_engine = self.script_engine - self.assertEqual(1, len(self.workflow.get_tasks(TaskState.WAITING))) time.sleep(0.1) self.workflow.refresh_waiting_tasks() - loopcount = loopcount +1 - endtime = datetime.datetime.now() - duration = endtime-starttime - self.assertEqual(durationdatetime.timedelta(seconds=.2),True) + loopcount += 1 + endtime = datetime.now() + duration = endtime - starttime + self.assertEqual(duration < timedelta(seconds=.5), True) + self.assertEqual(duration > timedelta(seconds=.2), True) + self.assertEqual(len(self.workflow.waiting_events()), 0) def suite(): diff --git a/tests/SpiffWorkflow/bpmn/events/TimerIntermediateTest.py b/tests/SpiffWorkflow/bpmn/events/TimerIntermediateTest.py index 6d8c256a2..f1dce3c5c 100644 --- a/tests/SpiffWorkflow/bpmn/events/TimerIntermediateTest.py +++ b/tests/SpiffWorkflow/bpmn/events/TimerIntermediateTest.py @@ -18,7 +18,7 @@ class TimerIntermediateTest(BpmnWorkflowTestCase): def testRunThroughHappy(self): - due_time = datetime.datetime.now() + datetime.timedelta(seconds=0.01) + due_time = (datetime.datetime.now() + datetime.timedelta(seconds=0.01)).isoformat() self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.workflow.get_tasks(TaskState.READY)[0].set_data(due_time=due_time) diff --git a/tests/SpiffWorkflow/bpmn/serializer/BaseTestCase.py b/tests/SpiffWorkflow/bpmn/serializer/BaseTestCase.py new file mode 100644 index 000000000..e392e5dba --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/serializer/BaseTestCase.py @@ -0,0 +1,27 @@ +import unittest +import os + +from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnParser +from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer +from tests.SpiffWorkflow.bpmn.BpmnLoaderForTests import TestUserTaskConverter + + +class BaseTestCase(unittest.TestCase): + + SERIALIZER_VERSION = "100.1.ANY" + DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data') + + def load_workflow_spec(self, filename, process_name): + parser = BpmnParser() + parser.add_bpmn_files_by_glob(os.path.join(self.DATA_DIR, filename)) + top_level_spec = parser.get_spec(process_name) + subprocesses = parser.get_subprocess_specs(process_name) + return top_level_spec, subprocesses + + def setUp(self): + super(BaseTestCase, self).setUp() + wf_spec_converter = BpmnWorkflowSerializer.configure_workflow_spec_converter([TestUserTaskConverter]) + self.serializer = BpmnWorkflowSerializer(wf_spec_converter, version=self.SERIALIZER_VERSION) + spec, subprocesses = self.load_workflow_spec('random_fact.bpmn', 'random_fact') + self.workflow = BpmnWorkflow(spec, subprocesses) diff --git a/tests/SpiffWorkflow/bpmn/BpmnWorkflowSerializerTest.py b/tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py similarity index 80% rename from tests/SpiffWorkflow/bpmn/BpmnWorkflowSerializerTest.py rename to tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py index e5b771564..ed547952e 100644 --- a/tests/SpiffWorkflow/bpmn/BpmnWorkflowSerializerTest.py +++ b/tests/SpiffWorkflow/bpmn/serializer/BpmnWorkflowSerializerTest.py @@ -1,33 +1,18 @@ -import os import unittest +import os import json -from SpiffWorkflow.task import TaskState from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine -from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnParser from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from tests.SpiffWorkflow.bpmn.BpmnLoaderForTests import TestUserTaskConverter +from .BaseTestCase import BaseTestCase + +class BpmnWorkflowSerializerTest(BaseTestCase): -class BpmnWorkflowSerializerTest(unittest.TestCase): - """Please note that the BpmnSerializer is Deprecated.""" SERIALIZER_VERSION = "100.1.ANY" - - def load_workflow_spec(self, filename, process_name): - f = os.path.join(os.path.dirname(__file__), 'data', filename) - parser = BpmnParser() - parser.add_bpmn_files_by_glob(f) - top_level_spec = parser.get_spec(process_name) - subprocesses = parser.get_subprocess_specs(process_name) - return top_level_spec, subprocesses - - def setUp(self): - super(BpmnWorkflowSerializerTest, self).setUp() - wf_spec_converter = BpmnWorkflowSerializer.configure_workflow_spec_converter([TestUserTaskConverter]) - self.serializer = BpmnWorkflowSerializer(wf_spec_converter, version=self.SERIALIZER_VERSION) - spec, subprocesses = self.load_workflow_spec('random_fact.bpmn', 'random_fact') - self.workflow = BpmnWorkflow(spec, subprocesses) + DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data') def testSerializeWorkflowSpec(self): spec_serialized = self.serializer.serialize_json(self.workflow) @@ -102,12 +87,6 @@ class BpmnWorkflowSerializerTest(unittest.TestCase): def testDeserializeWorkflow(self): self._compare_with_deserialized_copy(self.workflow) - def testSerializeTask(self): - self.serializer.serialize_json(self.workflow) - - def testDeserializeTask(self): - self._compare_with_deserialized_copy(self.workflow) - def testDeserializeActiveWorkflow(self): self.workflow.do_engine_steps() self._compare_with_deserialized_copy(self.workflow) @@ -161,17 +140,6 @@ class BpmnWorkflowSerializerTest(unittest.TestCase): self.assertIsNotNone(wf2.last_task) self._compare_workflows(self.workflow, wf2) - def test_convert_1_0_to_1_1(self): - # The serialization used here comes from NestedSubprocessTest saved at line 25 with version 1.0 - fn = os.path.join(os.path.dirname(__file__), 'data', 'serialization', 'v1.0.json') - wf = self.serializer.deserialize_json(open(fn).read()) - # We should be able to finish the workflow from this point - ready_tasks = wf.get_tasks(TaskState.READY) - self.assertEqual('Action3', ready_tasks[0].task_spec.description) - ready_tasks[0].complete() - wf.do_engine_steps() - self.assertEqual(True, wf.is_completed()) - def test_serialize_workflow_where_script_task_includes_function(self): self.workflow.do_engine_steps() ready_tasks = self.workflow.get_ready_user_tasks() diff --git a/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py b/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py new file mode 100644 index 000000000..cd38b5f82 --- /dev/null +++ b/tests/SpiffWorkflow/bpmn/serializer/VersionMigrationTest.py @@ -0,0 +1,30 @@ +import os +import time + +from SpiffWorkflow.task import TaskState +from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine + +from .BaseTestCase import BaseTestCase + +class VersionMigrationTest(BaseTestCase): + + SERIALIZER_VERSION = "1.2" + + def test_convert_1_0_to_1_1(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') + wf = self.serializer.deserialize_json(open(fn).read()) + # We should be able to finish the workflow from this point + ready_tasks = wf.get_tasks(TaskState.READY) + self.assertEqual('Action3', ready_tasks[0].task_spec.description) + ready_tasks[0].complete() + wf.do_engine_steps() + self.assertEqual(True, wf.is_completed()) + + def test_convert_1_1_to_1_2(self): + fn = os.path.join(self.DATA_DIR, 'serialization', 'v1-1.json') + wf = self.serializer.deserialize_json(open(fn).read()) + wf.script_engine = PythonScriptEngine(default_globals={"time": time}) + wf.refresh_waiting_tasks() + wf.do_engine_steps() + self.assertTrue(wf.is_completed()) \ No newline at end of file diff --git a/tests/SpiffWorkflow/camunda/data/MessageBoundary.bpmn b/tests/SpiffWorkflow/camunda/data/MessageBoundary.bpmn index 5966e0fdb..54a1861c8 100644 --- a/tests/SpiffWorkflow/camunda/data/MessageBoundary.bpmn +++ b/tests/SpiffWorkflow/camunda/data/MessageBoundary.bpmn @@ -1,5 +1,5 @@ - + @@ -78,7 +78,7 @@ Flow_11u0pgk Flow_1rqk2v9 - timedelta(seconds=.01) + "PT0.01S" @@ -107,48 +107,29 @@ - - - - - + + - - - + + + + + - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + @@ -159,76 +140,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -238,6 +195,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/camunda/data/token_trial.bpmn b/tests/SpiffWorkflow/camunda/data/token_trial.bpmn index 89cc6dc0b..488db02b4 100644 --- a/tests/SpiffWorkflow/camunda/data/token_trial.bpmn +++ b/tests/SpiffWorkflow/camunda/data/token_trial.bpmn @@ -1,10 +1,10 @@ - + Flow_03vnrmv - + Flow_0g2wjhu Flow_0ya87hl Flow_1qgke9w @@ -75,28 +75,25 @@ - - - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + @@ -107,18 +104,29 @@ - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + + @@ -128,17 +136,9 @@ - - - - - - - - diff --git a/tests/SpiffWorkflow/camunda/data/token_trial_camunda_clash.bpmn b/tests/SpiffWorkflow/camunda/data/token_trial_camunda_clash.bpmn index ee11331ba..d7aad5de5 100644 --- a/tests/SpiffWorkflow/camunda/data/token_trial_camunda_clash.bpmn +++ b/tests/SpiffWorkflow/camunda/data/token_trial_camunda_clash.bpmn @@ -1,10 +1,10 @@ - + Flow_03vnrmv - + Flow_0g2wjhu Flow_0ya87hl Flow_1qgke9w @@ -73,28 +73,25 @@ - - - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + + + @@ -105,18 +102,29 @@ - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + + @@ -126,17 +134,9 @@ - - - - - - - - diff --git a/tests/SpiffWorkflow/camunda/data/token_trial_parallel_simple.bpmn b/tests/SpiffWorkflow/camunda/data/token_trial_parallel_simple.bpmn index 5c3658575..6d8ae517a 100644 --- a/tests/SpiffWorkflow/camunda/data/token_trial_parallel_simple.bpmn +++ b/tests/SpiffWorkflow/camunda/data/token_trial_parallel_simple.bpmn @@ -1,5 +1,5 @@ - + Flow_1w2tcdp @@ -100,7 +100,7 @@ - + SequenceFlow_00fpfhi Flow_0wycgzo Flow_1vtdwmy @@ -126,6 +126,18 @@ + + + + + + + + + + + + @@ -166,18 +178,12 @@ - - - - - - - - - - - - + + + + + + @@ -202,15 +208,9 @@ - - - - - -