From 39772b97155e4b653cdaa7126da979530ffd963b Mon Sep 17 00:00:00 2001 From: Elizabeth Esswein Date: Tue, 27 Sep 2022 13:32:01 -0400 Subject: [PATCH] add dot notation parsing to forms --- .../services/process_instance_service.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/spiffworkflow_backend/services/process_instance_service.py b/src/spiffworkflow_backend/services/process_instance_service.py index fe232384..e4a5a667 100644 --- a/src/spiffworkflow_backend/services/process_instance_service.py +++ b/src/spiffworkflow_backend/services/process_instance_service.py @@ -307,7 +307,8 @@ class ProcessInstanceService: Abstracted here because we need to do it multiple times when completing all tasks in a multi-instance task. """ - spiff_task.update_data(data) + dot_dct = ProcessInstanceService.create_dot_dict(data) + spiff_task.update_data(dot_dct) # ProcessInstanceService.post_process_form(spiff_task) # some properties may update the data store. processor.complete_task(spiff_task) # Log the action before doing the engine steps, as doing so could effect the state of the task @@ -374,6 +375,13 @@ class ProcessInstanceService: ProcessInstanceService.set_dot_value(field.id, value, data) return data + @staticmethod + def create_dot_dict(data: dict) -> Any: + dot_dict = {} + for key, value in data.items(): + ProcessInstanceService.set_dot_value(key, value, dot_dict) + return dot_dict + @staticmethod def get_dot_value(path: str, source: dict) -> Any: """Get_dot_value."""