From d4fcb868cdcbd9975942ef411cd3b89892c17517 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Tue, 15 May 2012 17:32:30 -0400 Subject: [PATCH] BUG 8951 "In version 2.0.39, case status never changes to 'COMPLETED'" SOLVED - In the APPLICATION.APP_STATUS field in the database, the status never changes from "TO_DO" to "COMPLETED" when finishing the case - The problem was caused by the solution to bug 8169, see http://bugs.processmaker.com/view.php?id=8169 - Solved problem, now APPLICATION.APP_STATUS field, changes to "COMPLETED" when finishing the case --- workflow/engine/classes/class.derivation.php | 33 +++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 90e14caab..a5d3cbd1c 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -641,19 +641,30 @@ class Derivation $appFields['APP_STATUS'] = $currentDelegation['APP_STATUS']; /* Start Block : Count the open threads of $currentDelegation['APP_UID'] */ $openThreads = $this->case->GetOpenThreads( $currentDelegation['APP_UID'] ); - if ($openThreads == 0) {//Close case - $appFields['APP_STATUS'] = 'COMPLETED'; - $appFields['APP_FINISH_DATE'] = 'now'; - $this->verifyIsCaseChild($currentDelegation['APP_UID']); + + /////// + $sw = 0; + + if ($openThreads == 0) { + //Close case + $appFields["APP_STATUS"] = "COMPLETED"; + $appFields["APP_FINISH_DATE"] = "now"; + $this->verifyIsCaseChild($currentDelegation["APP_UID"]); + + $sw = 1; } - + if (isset($iNewDelIndex)) { - $appFields['DEL_INDEX'] = $iNewDelIndex; - $appFields['TAS_UID'] = $nextDel['TAS_UID']; - - /* Start Block : UPDATES APPLICATION */ - $this->case->updateCase ( $currentDelegation['APP_UID'], $appFields ); - /* End Block : UPDATES APPLICATION */ + $appFields["DEL_INDEX"] = $iNewDelIndex; + $appFields["TAS_UID"] = $nextDel["TAS_UID"]; + + $sw = 1; + } + + if ($sw == 1) { + //Start Block : UPDATES APPLICATION + $this->case->updateCase($currentDelegation["APP_UID"], $appFields); + //End Block : UPDATES APPLICATION } }