From cf7e156048b2293b93a0dbe2ae5c051d2c5d661b Mon Sep 17 00:00:00 2001 From: jasquat Date: Fri, 14 Oct 2022 15:42:16 -0400 Subject: [PATCH] Squashed 'SpiffWorkflow/' changes from 9d597627..d9fcd45a d9fcd45a Updating release numbers e0d04877 Merge pull request #251 from sartography/bugfix/make-data-objects-available-to-prescripts 7d260c36 Merge pull request #252 from sartography/bug/data_object_serializer_fix 3de54d97 Fixing a failing test. 27c5d3e1 A minor fix during deserialization to avoid issues for some users that upgraded between official releases. 250311d6 copy data objects before prescript execution git-subtree-dir: SpiffWorkflow git-subtree-split: d9fcd45a384f8376a669cf58677564289d2c661c --- doc/conf.py | 2 +- setup.py | 2 +- .../spiff/PrescriptPostscriptTest.py | 13 ++++ .../prescript_postscript_data_object.bpmn | 65 +++++++++++++++++++ 4 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn diff --git a/doc/conf.py b/doc/conf.py index ae9037ba..ca10c199 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -22,7 +22,7 @@ copyright = '2022, Sartography' author = 'Sartography' # The full version, including alpha/beta/rc tags - +release = '1.2.0' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 03a0e4ee..30adfa29 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() setup(name='SpiffWorkflow', - version='1.1.7', + version='1.2.0', description='A workflow framework and BPMN/DMN Processor', long_description=README, long_description_content_type="text/markdown", diff --git a/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py b/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py index a0734109..52077059 100644 --- a/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py +++ b/tests/SpiffWorkflow/spiff/PrescriptPostscriptTest.py @@ -17,6 +17,19 @@ class PrescriptPostsciptTest(BaseTestCase): def testCallActivitySaveRestore(self): self.call_activity_test(True) + def testDataObject(self): + + spec, subprocesses = self.load_workflow_spec('prescript_postscript_data_object.bpmn', 'Process_1') + self.workflow = BpmnWorkflow(spec, subprocesses) + # Set a on the workflow and b in the first task. + self.workflow.data['a'] = 1 + self.set_process_data({'b': 2}) + ready_tasks = self.workflow.get_tasks(TaskState.READY) + # This execute the same script as task_test + ready_tasks[0].complete() + # a should be removed, b should be unchanged, and c and z should be present (but not x & y) + self.assertDictEqual({'b': 2, 'c': 12, 'z': 6}, ready_tasks[0].data) + def task_test(self, save_restore=False): spec, subprocesses = self.load_workflow_spec('prescript_postscript.bpmn', 'Process_1') diff --git a/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn b/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn new file mode 100644 index 00000000..8dce85b1 --- /dev/null +++ b/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn @@ -0,0 +1,65 @@ + + + + + + Flow_1hjrex4 + + + + x = a * 2 +y = b * 2 +z = x + y + c = z * 2 +del x +del y + + Flow_1hjrex4 + Flow_1xndbxy + + + DataObjectReference_15lldo2 + Property_1bj3qrk + + + + + Flow_1xndbxy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +