From a310773ff2f20069457495ebb3781f4929c3650c Mon Sep 17 00:00:00 2001 From: Sanja Date: Tue, 6 Feb 2024 14:06:17 -0800 Subject: [PATCH 1/2] Add helperProcessRequestId Property to Controller Data --- .../js/components/templates/mixins/wizardHelperProcessModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/js/components/templates/mixins/wizardHelperProcessModal.js b/resources/js/components/templates/mixins/wizardHelperProcessModal.js index 083105da3f..74520b6585 100644 --- a/resources/js/components/templates/mixins/wizardHelperProcessModal.js +++ b/resources/js/components/templates/mixins/wizardHelperProcessModal.js @@ -109,6 +109,7 @@ export default { process_category_id: this.template.process.process_category_id, projects: null, wizardTemplateUuid: this.template.uuid, + helperProcessRequestId: this.task.process_request_id, }).then((response) => { if (response.data?.existingAssets) { this.handleExistingAssets(response.data); From 8d84314a090b451d7391d71bd99bced566a86b81 Mon Sep 17 00:00:00 2001 From: Sanja Date: Tue, 6 Feb 2024 14:08:10 -0800 Subject: [PATCH 2/2] Store Helper Process Request ID in Properties Attribute --- ProcessMaker/Templates/ProcessTemplate.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ProcessMaker/Templates/ProcessTemplate.php b/ProcessMaker/Templates/ProcessTemplate.php index 09e480a1c4..ee61cf3c02 100644 --- a/ProcessMaker/Templates/ProcessTemplate.php +++ b/ProcessMaker/Templates/ProcessTemplate.php @@ -248,9 +248,15 @@ public function create($request) : JsonResponse $payload['export'][$key]['attributes']['description'] = $requestData['description']; $payload['export'][$key]['attributes']['process_category_id'] = $requestData['process_category_id']; // Store the wizard template uuid on the process to rerun the helper process - if (isset($request->wizardTemplateUuid)) { + if (isset($requestData['wizardTemplateUuid'])) { $properties = json_decode($payload['export'][$key]['attributes']['properties'], true); - $properties['wizardTemplateUuid'] = $request->wizardTemplateUuid; + $properties['wizardTemplateUuid'] = $requestData['wizardTemplateUuid']; + $payload['export'][$key]['attributes']['properties'] = json_encode($properties); + } + // Store the helper process request id that initiated the process creation + if (isset($requestData['helperProcessRequestId'])) { + $properties = json_decode($payload['export'][$key]['attributes']['properties'], true); + $properties['helperProcessRequestId'] = $requestData['helperProcessRequestId']; $payload['export'][$key]['attributes']['properties'] = json_encode($properties); }