From fd21f4f301a88aaca8b9a05c1f86f79866fa7168 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Wed, 22 Jan 2020 16:51:25 -0500 Subject: [PATCH] Fixes breaking changes from SpiffWorkflow --- crc/workflow_processor.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crc/workflow_processor.py b/crc/workflow_processor.py index 7592b058..d014b988 100644 --- a/crc/workflow_processor.py +++ b/crc/workflow_processor.py @@ -1,9 +1,10 @@ import xml.etree.ElementTree as ElementTree from SpiffWorkflow.bpmn.BpmnScriptEngine import BpmnScriptEngine +from SpiffWorkflow.bpmn.serializer.BpmnSerializer import BpmnSerializer from SpiffWorkflow.bpmn.workflow import BpmnWorkflow from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser -from SpiffWorkflow.camunda.serializer.CamundaSerializer import CamundaSerializer + from crc import session from crc.models.file import FileDataModel, FileModel @@ -32,10 +33,11 @@ class CustomBpmnScriptEngine(BpmnScriptEngine): class WorkflowProcessor: _script_engine = CustomBpmnScriptEngine() - _serializer = CamundaSerializer() + _serializer = BpmnSerializer() def __init__(self, workflow_spec_id, bpmn_json): - self.bpmn_workflow = self._serializer.deserialize_workflow(bpmn_json, wf_spec=self.get_spec(workflow_spec_id)) + wf_spec = self.get_spec(workflow_spec_id) + self.bpmn_workflow = self._serializer.deserialize_workflow(bpmn_json, workflow_spec=wf_spec) self.bpmn_workflow.script_engine = self._script_engine @staticmethod