From d935def56797f001b021e8c59630ee97135b0c09 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 11 Sep 2023 16:56:27 -0400 Subject: [PATCH] debugging function --- spiffworkflow-backend/.gitignore | 1 + .../services/process_instance_processor.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/spiffworkflow-backend/.gitignore b/spiffworkflow-backend/.gitignore index ac2b0d106..0d420dae2 100644 --- a/spiffworkflow-backend/.gitignore +++ b/spiffworkflow-backend/.gitignore @@ -21,3 +21,4 @@ node_modules *null-ls_* /local_wheels/*.whl /some_cache_dir +/process.json 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 41c3487b3..cd4c56f2c 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -1728,6 +1728,11 @@ class ProcessInstanceProcessor: return task return None + # for debugging, get the full json representation into a file on disk + def dump_to_disk(self, filename: str = "process.json") -> None: + with open(filename, "w") as f: + f.write(json.dumps(self.serialize(), indent=2)) + def remove_spiff_tasks_for_termination(self) -> None: start_time = time.time() deleted_tasks = self.bpmn_process_instance.cancel() or []