From 69e814758e4e640bef3e6bcad4f846c410976805 Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 27 Oct 2022 10:50:48 -0400 Subject: [PATCH] Squashed 'SpiffWorkflow/' changes from 12f81480a..d27519a36 d27519a36 Merge pull request #259 from sartography/bugfix/spiff-postscript-execution 21aa8a12c update execution order for postscripts d83fd3d81 Merge pull request #256 from sartography/feature/xml-validation 8303aaab5 uping the sleep time in a test slightly to see if we can get this test to pass consistently in CI. 1d251d55d determine whether to validate by passing in a validator instead of a parameter 2d3daad2d add spiff schema f8c65dc60 Minor changes to BPMN diagrams to assure all tests are run against valid BPMN Diagrams. Changes required: 9e06b25bf add DMN validation 1b7cbeba0 set parser to validate by default 53fdbba52 add schemas & validation option a212d9c5d general cleanup git-subtree-dir: SpiffWorkflow git-subtree-split: d27519a3631b9772094e5f24dba2f478b0c47135 --- .../bpmn/BpmnWorkflowTestCase.py | 6 +- tests/SpiffWorkflow/bpmn/ClashingName2Test.py | 36 -- .../bpmn/ProcessDependencyTest.py | 9 +- tests/SpiffWorkflow/bpmn/data/Approvals.bpmn | 4 +- .../bpmn/data/Approvals_bad.bpmn | 403 ------------------ .../bpmn/data/collaboration.bpmn | 30 +- .../SpiffWorkflow/bpmn/data/correlation.bpmn | 4 +- .../data/correlation_two_conversations.bpmn | 8 +- .../SpiffWorkflow/bpmn/data/data_object.bpmn | 1 - tests/SpiffWorkflow/bpmn/data/io_spec.bpmn | 12 + .../bpmn/events/ActionManagementTest.py | 6 +- .../bpmn/events/CallActivityEscalationTest.py | 2 +- .../bpmn/events/MessageInterruptsSpTest.py | 2 +- .../bpmn/events/MessageInterruptsTest.py | 2 +- .../bpmn/events/MessageNonInterruptTest.py | 2 +- .../bpmn/events/MessageNonInterruptsSpTest.py | 2 +- .../SpiffWorkflow/bpmn/events/MessagesTest.py | 2 +- .../camunda/CamundaParserTest.py | 3 +- .../{serializer => }/UserTaskParserTest.py | 2 +- .../camunda/serializer/CamundaParserTest.py | 28 -- tests/SpiffWorkflow/dmn/DecisionRunner.py | 4 +- .../dmn/Dmn20151101VersionTest.py | 2 +- tests/SpiffWorkflow/spiff/BaseTestCase.py | 6 +- .../spiff/data/business_rule_task.bpmn | 66 ++- .../SpiffWorkflow/spiff/data/correlation.bpmn | 4 +- .../data/correlation_two_conversations.bpmn | 18 +- .../spiff/data/prescript_postscript.bpmn | 1 - .../prescript_postscript_call_activity.bpmn | 6 + .../prescript_postscript_data_object.bpmn | 1 - .../data/prescript_postscript_parent.bpmn | 1 - .../spiff/data/spiff_properties.bpmn | 3 +- 31 files changed, 107 insertions(+), 569 deletions(-) delete mode 100644 tests/SpiffWorkflow/bpmn/ClashingName2Test.py delete mode 100644 tests/SpiffWorkflow/bpmn/data/Approvals_bad.bpmn rename tests/SpiffWorkflow/camunda/{serializer => }/UserTaskParserTest.py (96%) delete mode 100644 tests/SpiffWorkflow/camunda/serializer/CamundaParserTest.py diff --git a/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py b/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py index cb788eb32..5a341188b 100644 --- a/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py +++ b/tests/SpiffWorkflow/bpmn/BpmnWorkflowTestCase.py @@ -3,6 +3,7 @@ import json import os import unittest +from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnValidator from SpiffWorkflow.task import TaskState @@ -18,9 +19,10 @@ class BpmnWorkflowTestCase(unittest.TestCase): serializer = BpmnWorkflowSerializer(wf_spec_converter) - def load_workflow_spec(self, filename, process_name): + def load_workflow_spec(self, filename, process_name, validate=True): f = os.path.join(os.path.dirname(__file__), 'data', filename) - parser = TestBpmnParser() + validator = BpmnValidator() if validate else None + parser = TestBpmnParser(validator=validator) parser.add_bpmn_files_by_glob(f) top_level_spec = parser.get_spec(process_name) subprocesses = parser.get_subprocess_specs(process_name) diff --git a/tests/SpiffWorkflow/bpmn/ClashingName2Test.py b/tests/SpiffWorkflow/bpmn/ClashingName2Test.py deleted file mode 100644 index f906c848c..000000000 --- a/tests/SpiffWorkflow/bpmn/ClashingName2Test.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- - -import sys -import os -import unittest -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..')) - -from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase -from SpiffWorkflow.bpmn.parser.ValidationException import ValidationException -__author__ = 'kellym' - - - -class ClashingNameTest2(BpmnWorkflowTestCase): - """The example bpmn diagram tests both a set cardinality from user input - as well as looping over an existing array.""" - - def setUp(self): - pass - - def loadWorkflow(self): - self.load_workflow_spec('Approvals_bad.bpmn', 'Approvals') - - def testRunThroughHappy(self): - # make sure we raise an exception - # when validating a workflow with multiple - # same IDs in the BPMN workspace - self.assertRaises(ValidationException,self.loadWorkflow) - - - -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(ClashingNameTest2) - -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/bpmn/ProcessDependencyTest.py b/tests/SpiffWorkflow/bpmn/ProcessDependencyTest.py index 414a8abbb..b3a795196 100644 --- a/tests/SpiffWorkflow/bpmn/ProcessDependencyTest.py +++ b/tests/SpiffWorkflow/bpmn/ProcessDependencyTest.py @@ -1,18 +1,10 @@ # -*- coding: utf-8 -*- - - - -import sys import os import unittest from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser -from SpiffWorkflow.dmn.parser.BpmnDmnParser import BpmnDmnParser from SpiffWorkflow.spiff.parser import SpiffBpmnParser -from tests.SpiffWorkflow.bpmn.BpmnLoaderForTests import TestBpmnParser -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..')) -from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase __author__ = 'danfunk' @@ -34,6 +26,7 @@ class ProcessDependencyTest(BpmnWorkflowTestCase): self.actual_test(SpiffBpmnParser()) def actual_test(self, parser): + # We ought to test the parsers in the packages they belong to, not here. filename = 'call_activity_nested' process_name = 'Level1' base_dir = os.path.join(os.path.dirname(__file__), 'data', filename) diff --git a/tests/SpiffWorkflow/bpmn/data/Approvals.bpmn b/tests/SpiffWorkflow/bpmn/data/Approvals.bpmn index 152f7785d..1cc8d2045 100644 --- a/tests/SpiffWorkflow/bpmn/data/Approvals.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/Approvals.bpmn @@ -102,7 +102,7 @@ - + Supervisor_Approval @@ -147,7 +147,7 @@ - + Start3 diff --git a/tests/SpiffWorkflow/bpmn/data/Approvals_bad.bpmn b/tests/SpiffWorkflow/bpmn/data/Approvals_bad.bpmn deleted file mode 100644 index 5e33ada61..000000000 --- a/tests/SpiffWorkflow/bpmn/data/Approvals_bad.bpmn +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - Person who takes the first action to start the process - - - - - - - - - - - Start1 - First_Approval_Wins - End1 - First_Approval_Wins_Done - Parallel_Approvals_Done - Parallel_SP - Parallel_SP_Done - - - - Supervisor_Approval__P_ - Gateway4 - Gateway5 - - - - Manager_Approval__P_ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Supervisor_Approval - Start2 - Supervisor_Approved - - - - Manager_Approval - Manager_Approved - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Start3 - Supervisor_Approval - End2 - - - - Manager_Approval - - - - Step1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/SpiffWorkflow/bpmn/data/collaboration.bpmn b/tests/SpiffWorkflow/bpmn/data/collaboration.bpmn index 534949a99..3d02b4ba4 100644 --- a/tests/SpiffWorkflow/bpmn/data/collaboration.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/collaboration.bpmn @@ -2,31 +2,31 @@ - + - + - + lover_name - + - + - lover_name + lover_name - from_name + from_name - + Flow_1bl6jeh @@ -49,12 +49,12 @@ - - - - - - + + + + + + @@ -109,4 +109,4 @@ - \ No newline at end of file + diff --git a/tests/SpiffWorkflow/bpmn/data/correlation.bpmn b/tests/SpiffWorkflow/bpmn/data/correlation.bpmn index 769bd5696..5319faf6f 100644 --- a/tests/SpiffWorkflow/bpmn/data/correlation.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/correlation.bpmn @@ -9,10 +9,10 @@ - task_num + task_num - init_id + init_id diff --git a/tests/SpiffWorkflow/bpmn/data/correlation_two_conversations.bpmn b/tests/SpiffWorkflow/bpmn/data/correlation_two_conversations.bpmn index 2e52a62f5..f9b1b9fa2 100644 --- a/tests/SpiffWorkflow/bpmn/data/correlation_two_conversations.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/correlation_two_conversations.bpmn @@ -13,18 +13,18 @@ - task_num + task_num - init_id + init_id - task_num + task_num - subprocess + subprocess diff --git a/tests/SpiffWorkflow/bpmn/data/data_object.bpmn b/tests/SpiffWorkflow/bpmn/data/data_object.bpmn index a8f940297..298c5fa2f 100644 --- a/tests/SpiffWorkflow/bpmn/data/data_object.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/data_object.bpmn @@ -1,7 +1,6 @@ - Flow_18858hr diff --git a/tests/SpiffWorkflow/bpmn/data/io_spec.bpmn b/tests/SpiffWorkflow/bpmn/data/io_spec.bpmn index 65356b56f..dc10332f0 100644 --- a/tests/SpiffWorkflow/bpmn/data/io_spec.bpmn +++ b/tests/SpiffWorkflow/bpmn/data/io_spec.bpmn @@ -9,6 +9,18 @@ + + + id_1 + id_2 + + + out_1 + out_2 + + Flow_0n038fc diff --git a/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py b/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py index 699e50c25..1324d0271 100644 --- a/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py +++ b/tests/SpiffWorkflow/bpmn/events/ActionManagementTest.py @@ -11,8 +11,8 @@ __author__ = 'matth' class ActionManagementTest(BpmnWorkflowTestCase): - START_TIME_DELTA=0.01 - FINISH_TIME_DELTA=0.02 + START_TIME_DELTA=0.05 + FINISH_TIME_DELTA=0.10 def now_plus_seconds(self, seconds): return datetime.datetime.now() + datetime.timedelta(seconds=seconds) @@ -27,7 +27,7 @@ class ActionManagementTest(BpmnWorkflowTestCase): self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY))) self.workflow.get_tasks(TaskState.READY)[0].set_data( start_time=start_time, finish_time=finish_time) - + def testRunThroughHappy(self): self.do_next_exclusive_step("Review Action", choice='Approve') self.workflow.do_engine_steps() diff --git a/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py b/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py index 1e19e43b2..6c7ea6e28 100644 --- a/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py +++ b/tests/SpiffWorkflow/bpmn/events/CallActivityEscalationTest.py @@ -41,7 +41,7 @@ def track_workflow(wf_spec, completed_set): class CallActivityEscalationTest(BpmnWorkflowTestCase): def setUp(self): - self.spec, subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'CallActivity-Escalation-Test') + self.spec, subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'CallActivity-Escalation-Test', False) self.workflow = BpmnWorkflow(self.spec, subprocesses) def testShouldEscalate(self): diff --git a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py index f66c3ee31..0b93d1e66 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsSpTest.py @@ -13,7 +13,7 @@ __author__ = 'matth' class MessageInterruptsSpTest(BpmnWorkflowTestCase): def setUp(self): - self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Interrupts SP') + self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Interrupts SP', False) def testRunThroughHappySaveAndRestore(self): diff --git a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py index 55cfa8bf6..bdd6d6c11 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageInterruptsTest.py @@ -13,7 +13,7 @@ __author__ = 'matth' class MessageInterruptsTest(BpmnWorkflowTestCase): def setUp(self): - self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows') + self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows', False) def testRunThroughHappySaveAndRestore(self): diff --git a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py index f7b278bb1..3127cc78c 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptTest.py @@ -13,7 +13,7 @@ __author__ = 'matth' class MessageNonInterruptTest(BpmnWorkflowTestCase): def setUp(self): - self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows') + self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows', False) def testRunThroughHappySaveAndRestore(self): diff --git a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py index d4192a23e..a10f8e93f 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessageNonInterruptsSpTest.py @@ -13,7 +13,7 @@ __author__ = 'matth' class MessageNonInterruptsSpTest(BpmnWorkflowTestCase): def setUp(self): - self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Non Interrupt SP') + self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Non Interrupt SP', False) def testRunThroughHappySaveAndRestore(self): diff --git a/tests/SpiffWorkflow/bpmn/events/MessagesTest.py b/tests/SpiffWorkflow/bpmn/events/MessagesTest.py index 486e53d24..2535daba4 100644 --- a/tests/SpiffWorkflow/bpmn/events/MessagesTest.py +++ b/tests/SpiffWorkflow/bpmn/events/MessagesTest.py @@ -13,7 +13,7 @@ __author__ = 'matth' class MessagesTest(BpmnWorkflowTestCase): def setUp(self): - self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows') + self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows', False) def testRunThroughHappy(self): diff --git a/tests/SpiffWorkflow/camunda/CamundaParserTest.py b/tests/SpiffWorkflow/camunda/CamundaParserTest.py index 1b4534490..21d9ab02d 100644 --- a/tests/SpiffWorkflow/camunda/CamundaParserTest.py +++ b/tests/SpiffWorkflow/camunda/CamundaParserTest.py @@ -1,8 +1,7 @@ from SpiffWorkflow.bpmn.parser.util import full_tag from SpiffWorkflow.camunda.specs.UserTask import UserTask from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser -from SpiffWorkflow.camunda.parser.UserTaskParser import UserTaskParser -from SpiffWorkflow.camunda.parser.business_rule_task import BusinessRuleTaskParser +from SpiffWorkflow.camunda.parser.task_spec import UserTaskParser, BusinessRuleTaskParser from SpiffWorkflow.dmn.specs.BusinessRuleTask import BusinessRuleTask from .BaseTestCase import BaseTestCase diff --git a/tests/SpiffWorkflow/camunda/serializer/UserTaskParserTest.py b/tests/SpiffWorkflow/camunda/UserTaskParserTest.py similarity index 96% rename from tests/SpiffWorkflow/camunda/serializer/UserTaskParserTest.py rename to tests/SpiffWorkflow/camunda/UserTaskParserTest.py index 40d4a3aa0..56c4f4747 100644 --- a/tests/SpiffWorkflow/camunda/serializer/UserTaskParserTest.py +++ b/tests/SpiffWorkflow/camunda/UserTaskParserTest.py @@ -1,6 +1,6 @@ import unittest -from SpiffWorkflow.camunda.parser.UserTaskParser import UserTaskParser +from SpiffWorkflow.camunda.parser.task_spec import UserTaskParser from tests.SpiffWorkflow.camunda.BaseTestCase import BaseTestCase diff --git a/tests/SpiffWorkflow/camunda/serializer/CamundaParserTest.py b/tests/SpiffWorkflow/camunda/serializer/CamundaParserTest.py deleted file mode 100644 index 29760e9db..000000000 --- a/tests/SpiffWorkflow/camunda/serializer/CamundaParserTest.py +++ /dev/null @@ -1,28 +0,0 @@ -import unittest - -from SpiffWorkflow.camunda.parser.UserTaskParser import UserTaskParser -from SpiffWorkflow.camunda.specs.UserTask import UserTask -from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser - - -class CamundaParserTest(unittest.TestCase): - CORRELATE = CamundaParser - - def setUp(self): - self.parser = CamundaParser() - - def test_overrides(self): - expected_key = "{http://www.omg.org/spec/BPMN/20100524/MODEL}userTask" - self.assertIn(expected_key, - self.parser.OVERRIDE_PARSER_CLASSES) - - self.assertEqual((UserTaskParser, UserTask), - self.parser.OVERRIDE_PARSER_CLASSES.get(expected_key)) - - -def suite(): - return unittest.TestLoader().loadTestsFromTestCase(CamundaParserTest) - - -if __name__ == '__main__': - unittest.TextTestRunner(verbosity=2).run(suite()) diff --git a/tests/SpiffWorkflow/dmn/DecisionRunner.py b/tests/SpiffWorkflow/dmn/DecisionRunner.py index 0c266bfd4..e69c5db8b 100644 --- a/tests/SpiffWorkflow/dmn/DecisionRunner.py +++ b/tests/SpiffWorkflow/dmn/DecisionRunner.py @@ -4,7 +4,7 @@ from lxml import etree from SpiffWorkflow.bpmn.PythonScriptEngine import Box from SpiffWorkflow.dmn.engine.DMNEngine import DMNEngine -from SpiffWorkflow.dmn.parser.DMNParser import DMNParser +from SpiffWorkflow.dmn.parser.DMNParser import DMNParser, get_dmn_ns class Workflow: @@ -33,7 +33,7 @@ class DecisionRunner: with open(fn) as fh: node = etree.parse(fh) - self.dmnParser = DMNParser(None, node.getroot()) + self.dmnParser = DMNParser(None, node.getroot(), get_dmn_ns(node.getroot())) self.dmnParser.parse() decision = self.dmnParser.decision diff --git a/tests/SpiffWorkflow/dmn/Dmn20151101VersionTest.py b/tests/SpiffWorkflow/dmn/Dmn20151101VersionTest.py index 8ff40003b..9a98ae2f9 100644 --- a/tests/SpiffWorkflow/dmn/Dmn20151101VersionTest.py +++ b/tests/SpiffWorkflow/dmn/Dmn20151101VersionTest.py @@ -12,7 +12,7 @@ class DmnVersionTest(BpmnWorkflowTestCase): def testLoad(self): dmn = os.path.join(os.path.dirname(__file__), 'data', - 'dmn_version_20191111_test.dmn') + 'dmn_version_20151101_test.dmn') self.assertIsNone(self.parser.add_dmn_file(dmn)) diff --git a/tests/SpiffWorkflow/spiff/BaseTestCase.py b/tests/SpiffWorkflow/spiff/BaseTestCase.py index 248f84a1f..9e882fcb9 100644 --- a/tests/SpiffWorkflow/spiff/BaseTestCase.py +++ b/tests/SpiffWorkflow/spiff/BaseTestCase.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os -from SpiffWorkflow.spiff.parser import SpiffBpmnParser +from SpiffWorkflow.spiff.parser import SpiffBpmnParser, VALIDATOR from SpiffWorkflow.spiff.serializer import NoneTaskConverter, \ ManualTaskConverter, UserTaskConverter, ScriptTaskConverter, \ SubWorkflowTaskConverter, TransactionSubprocessConverter, \ @@ -28,9 +28,9 @@ class BaseTestCase(BpmnWorkflowTestCase): serializer = BpmnWorkflowSerializer(wf_spec_converter) - def load_workflow_spec(self, filename, process_name, dmn_filename=None): + def load_workflow_spec(self, filename, process_name, dmn_filename=None, validate=True): bpmn = os.path.join(os.path.dirname(__file__), 'data', filename) - parser = SpiffBpmnParser() + parser = SpiffBpmnParser(validator=VALIDATOR if validate else None) parser.add_bpmn_files_by_glob(bpmn) if dmn_filename is not None: dmn = os.path.join(os.path.dirname(__file__), 'data', 'dmn', dmn_filename) diff --git a/tests/SpiffWorkflow/spiff/data/business_rule_task.bpmn b/tests/SpiffWorkflow/spiff/data/business_rule_task.bpmn index 8b46dfc3d..cb32afb78 100644 --- a/tests/SpiffWorkflow/spiff/data/business_rule_task.bpmn +++ b/tests/SpiffWorkflow/spiff/data/business_rule_task.bpmn @@ -5,53 +5,51 @@ Flow_0lrg65h - - Flow_0l8nhib - - - - - decision_1 - - - - Flow_1109ldv - Flow_0l8nhib - - Flow_0lrg65h - Flow_1109ldv + Flow_0m1tt51 question = "X" + + + + decision_1 + + Flow_0m1tt51 + Flow_19vr2vt + + + Flow_19vr2vt + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/tests/SpiffWorkflow/spiff/data/correlation.bpmn b/tests/SpiffWorkflow/spiff/data/correlation.bpmn index e1cca32cc..e364fb1d9 100644 --- a/tests/SpiffWorkflow/spiff/data/correlation.bpmn +++ b/tests/SpiffWorkflow/spiff/data/correlation.bpmn @@ -9,10 +9,10 @@ - num + num - init_id + init_id diff --git a/tests/SpiffWorkflow/spiff/data/correlation_two_conversations.bpmn b/tests/SpiffWorkflow/spiff/data/correlation_two_conversations.bpmn index 4865a5c20..b42f50474 100644 --- a/tests/SpiffWorkflow/spiff/data/correlation_two_conversations.bpmn +++ b/tests/SpiffWorkflow/spiff/data/correlation_two_conversations.bpmn @@ -1,6 +1,6 @@ - + @@ -19,18 +19,18 @@ - topica_one + topica_one - payload_var_one.topica + payload_var_one.topica - topicb_one + topicb_one - payload_var_one.topicb + payload_var_one.topicb @@ -117,18 +117,18 @@ del time - topica_two + topica_two - topica_two + topica_two - topicb_two + topicb_two - topicb_two + topicb_two diff --git a/tests/SpiffWorkflow/spiff/data/prescript_postscript.bpmn b/tests/SpiffWorkflow/spiff/data/prescript_postscript.bpmn index ed0557cf6..88fd74f0b 100644 --- a/tests/SpiffWorkflow/spiff/data/prescript_postscript.bpmn +++ b/tests/SpiffWorkflow/spiff/data/prescript_postscript.bpmn @@ -1,7 +1,6 @@ - Flow_1hjrex4 diff --git a/tests/SpiffWorkflow/spiff/data/prescript_postscript_call_activity.bpmn b/tests/SpiffWorkflow/spiff/data/prescript_postscript_call_activity.bpmn index 864f9408d..5e7e0978c 100644 --- a/tests/SpiffWorkflow/spiff/data/prescript_postscript_call_activity.bpmn +++ b/tests/SpiffWorkflow/spiff/data/prescript_postscript_call_activity.bpmn @@ -4,6 +4,12 @@ + + in_data + + + out_data + Flow_1a4nkhi diff --git a/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn b/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn index 8dce85b1f..d6351af01 100644 --- a/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn +++ b/tests/SpiffWorkflow/spiff/data/prescript_postscript_data_object.bpmn @@ -1,7 +1,6 @@ - Flow_1hjrex4 diff --git a/tests/SpiffWorkflow/spiff/data/prescript_postscript_parent.bpmn b/tests/SpiffWorkflow/spiff/data/prescript_postscript_parent.bpmn index 9837fa8df..bd3e0c055 100644 --- a/tests/SpiffWorkflow/spiff/data/prescript_postscript_parent.bpmn +++ b/tests/SpiffWorkflow/spiff/data/prescript_postscript_parent.bpmn @@ -1,7 +1,6 @@ - Flow_1e5oj0e diff --git a/tests/SpiffWorkflow/spiff/data/spiff_properties.bpmn b/tests/SpiffWorkflow/spiff/data/spiff_properties.bpmn index 3e93a3ece..862dae789 100644 --- a/tests/SpiffWorkflow/spiff/data/spiff_properties.bpmn +++ b/tests/SpiffWorkflow/spiff/data/spiff_properties.bpmn @@ -1,7 +1,6 @@ - Flow_1hjrex4 @@ -16,7 +15,7 @@ - 3 + Flow_1hjrex4 Flow_1vlqqxh