add dot notation parsing to forms

This commit is contained in:
Elizabeth Esswein 2022-09-27 13:32:01 -04:00
parent 9082bb53c0
commit 39772b9715
1 changed files with 9 additions and 1 deletions

View File

@ -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."""