diff --git a/crc/services/workflow_processor.py b/crc/services/workflow_processor.py index c2987154..1a6c1fdc 100644 --- a/crc/services/workflow_processor.py +++ b/crc/services/workflow_processor.py @@ -147,6 +147,9 @@ class WorkflowProcessor(object): if hard_reset: # Now that the spec is loaded, get the data and rebuild the bpmn with the new details workflow_model.spec_version = self.hard_reset() + workflow_model.bpmn_workflow_json = WorkflowProcessor._serializer.serialize_workflow(self.bpmn_workflow) + session.add(workflow_model) + def __get_bpmn_workflow(self, workflow_model: WorkflowModel, spec: WorkflowSpec): diff --git a/tests/test_tasks_api.py b/tests/test_tasks_api.py index 9e32dffc..45e69831 100644 --- a/tests/test_tasks_api.py +++ b/tests/test_tasks_api.py @@ -192,6 +192,11 @@ class TestTasksApi(BaseTest): self.assertTrue(workflow_api.spec_version.startswith("v2 ")) self.assertTrue(workflow_api.is_latest_spec) + # Assure this hard_reset sticks (added this after a bug was found) + workflow_api = self.get_workflow_api(workflow) + self.assertTrue(workflow_api.spec_version.startswith("v2 ")) + self.assertTrue(workflow_api.is_latest_spec) + def test_soft_reset_errors_out_and_next_result_is_on_original_version(self): # Start the basic two_forms workflow and complete a task.