From f5b1b8c8d8f50c38d9c0b7f0ebff4881bcea9b32 Mon Sep 17 00:00:00 2001 From: Jon Herron Date: Fri, 25 Nov 2022 15:05:17 -0500 Subject: [PATCH] Just save task_json --- .../spiffworkflow_backend/routes/process_api_blueprint.py | 4 +++- .../services/process_instance_processor.py | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index f079b6ebe..427a08e06 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -1296,7 +1296,9 @@ def process_instance_task_list( .first() ) if step_detail is not None: - process_instance.bpmn_json = json.dumps(step_detail.task_json) + bpmn_json = json.loads(process_instance.bpmn_json) + bpmn_json["tasks"] = step_detail.task_json + process_instance.bpmn_json = json.dumps(bpmn_json) processor = ProcessInstanceProcessor(process_instance) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py index 893a0650f..111d01ec1 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -542,13 +542,8 @@ class ProcessInstanceProcessor: """SaveSpiffStepDetails.""" bpmn_json = self.serialize() wf_json = json.loads(bpmn_json) - task_json = "{}" - if "tasks" in wf_json: - task_json = json.dumps(wf_json["tasks"]) + task_json = wf_json["tasks"] - # TODO want to just save the tasks, something wasn't immediately working - # so after the flow works with the full wf_json revisit this - task_json = wf_json return { "process_instance_id": self.process_instance_model.id, "spiff_step": self.process_instance_model.spiff_step or 1,