From 6ac4de70fab813225ab33ccac640db2eb34466a1 Mon Sep 17 00:00:00 2001 From: auslin-aot <99173163+auslin-aot@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:47:42 +0530 Subject: [PATCH] FWF-4055: [Bugfix] On duplicate form create process with processType & data from payload --- .../formsflow_api/services/form_process_mapper.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/forms-flow-api/src/formsflow_api/services/form_process_mapper.py b/forms-flow-api/src/formsflow_api/services/form_process_mapper.py index 55f17a172..d9d8caf45 100644 --- a/forms-flow-api/src/formsflow_api/services/form_process_mapper.py +++ b/forms-flow-api/src/formsflow_api/services/form_process_mapper.py @@ -460,8 +460,16 @@ def create_form(data, is_designer, **kwargs): # pylint:disable=too-many-locals process_name = ( updated_process_name if updated_process_name else process_name ) - # create entry in process with default flow. - FormProcessMapperService.create_default_process(process_name) + process_data = data.get("processData") + process_type = data.get("processType") + if process_data and process_type: + # Incase of duplicate form we get process data from payload + ProcessService.create_process( + process_data, process_type, process_name, process_name + ) + else: + # create entry in process with default flow. + FormProcessMapperService.create_default_process(process_name) return response def _remove_tenant_key(self, form_json, tenant_key):