From c6d02f1c212fa689e89c0c3aea5a0765372554c6 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 28 Sep 2021 14:29:18 -0400 Subject: [PATCH] PMCORE-3317-2 --- workflow/engine/classes/Cases.php | 1 + workflow/engine/classes/Derivation.php | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/workflow/engine/classes/Cases.php b/workflow/engine/classes/Cases.php index b72b2d999..4e0848a42 100644 --- a/workflow/engine/classes/Cases.php +++ b/workflow/engine/classes/Cases.php @@ -649,6 +649,7 @@ class Cases * @return array * * @see Cases::updateCase() + * @see Derivation::derivate() */ public function updateThreadTitle(string $appUid, int $appNumber, int $delIndex, $caseData = []) { diff --git a/workflow/engine/classes/Derivation.php b/workflow/engine/classes/Derivation.php index bf21cde34..fec982e0c 100644 --- a/workflow/engine/classes/Derivation.php +++ b/workflow/engine/classes/Derivation.php @@ -1086,11 +1086,14 @@ class Derivation break; default: $iNewDelIndex = $this->doDerivation($currentDelegation, $nextDel, $appFields, $aSP); + $appUid = $currentDelegation['APP_UID']; // Load Case Data again because the information could be change in method "doDerivation" - $verifyApplication = $this->case->loadCase($currentDelegation['APP_UID']); - $appFields['APP_DATA'] = $verifyApplication['APP_DATA']; - //When the users route the case in the same time - if($iNewDelIndex !== 0){ + $lastData = $this->case->loadCase($appUid); + // Update the thread title related to the last index created + $this->case->updateThreadTitle($appUid, $lastData['APP_NUMBER'], $iNewDelIndex, $lastData['APP_DATA']); + $appFields['APP_DATA'] = $lastData['APP_DATA']; + // When the users route the case in the same time + if($iNewDelIndex !== 0) { $arrayDerivationResult[] = [ 'DEL_INDEX' => $iNewDelIndex, 'TAS_UID' => $nextDel['TAS_UID'],