From ba32c018aeb13f41b10a3bdbe0cd4cfd3b881d38 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Wed, 28 Sep 2011 12:41:10 -0400 Subject: [PATCH] BUG 7717 7421 -> related to DEL_PREVIOUS from APP_DELEGATION table, FIXED! - fixed -> blame to girish commit 2e97a8 --- workflow/engine/classes/class.case.php | 4 +-- workflow/engine/classes/class.derivation.php | 34 ++++++++++++------- .../engine/classes/model/AppDelegation.php | 5 +-- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 2d89fc968..f71db7e8f 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -1393,10 +1393,10 @@ class Cases { * @return void */ - function newAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sPrevious, $iPriority, $sDelType, $iAppThreadIndex = 1) { + function newAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sPrevious, $iPriority, $sDelType, $iAppThreadIndex = 1, $nextDel=null) { try { $appDel = new AppDelegation(); - return $appDel->createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, 3, false, $sPrevious ); + return $appDel->createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iPriority, false, $sPrevious, $nextDel); } catch (exception $e) { throw ($e); diff --git a/workflow/engine/classes/class.derivation.php b/workflow/engine/classes/class.derivation.php index 96399acd9..945a6985d 100755 --- a/workflow/engine/classes/class.derivation.php +++ b/workflow/engine/classes/class.derivation.php @@ -615,12 +615,17 @@ class Derivation //Incrementing the Del_thread First so that new delegation has new del_thread $iNewAppThreadIndex += 1; //Creating new delegation according to users in group - $iMIDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'], - (isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''), - $currentDelegation['DEL_INDEX'], - $nextDel, - $delType, - $iNewAppThreadIndex); + $iMIDelIndex = $this->case->newAppDelegation( + $appFields['PRO_UID'], + $currentDelegation['APP_UID'], + $nextDel['TAS_UID'], + (isset($aValue['USR_UID']) ? $aValue['USR_UID'] : ''), + $currentDelegation['DEL_INDEX'], + 3, //$nextDel['DEL_PRIORITY'], <- //TODO check this priority alway is 3 + $delType, + $iNewAppThreadIndex, + $nextDel + ); $iNewThreadIndex = $this->case->newAppThread ( $currentDelegation['APP_UID'], $iMIDelIndex, $iAppThreadIndex ); @@ -634,12 +639,17 @@ class Derivation //No Break, need no execute the default ones.... default: // Create new delegation - $iNewDelIndex = $this->case->newAppDelegation( $appFields['PRO_UID'],$currentDelegation['APP_UID'],$nextDel['TAS_UID'], - (isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''), - $currentDelegation['DEL_INDEX'], - $nextDel, - $delType, - $iAppThreadIndex); + $iNewDelIndex = $this->case->newAppDelegation( + $appFields['PRO_UID'], + $currentDelegation['APP_UID'], + $nextDel['TAS_UID'], + (isset($nextDel['USR_UID']) ? $nextDel['USR_UID'] : ''), + $currentDelegation['DEL_INDEX'], + 3, //$nextDel['DEL_PRIORITY'], <- //TODO check this priority alway is 3 + $delType, + $iAppThreadIndex, + $nextDel + ); break; } $iAppThreadIndex = $appFields['DEL_THREAD']; diff --git a/workflow/engine/classes/model/AppDelegation.php b/workflow/engine/classes/model/AppDelegation.php index d526f421b..2f96fed73 100755 --- a/workflow/engine/classes/model/AppDelegation.php +++ b/workflow/engine/classes/model/AppDelegation.php @@ -53,7 +53,8 @@ class AppDelegation extends BaseAppDelegation { * @param $isSubprocess is a subprocess inside a process? * @return delegation index of the application delegation. */ - function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $sNextTasParam=null,$iPriority = 3, $isSubprocess=false ) { + function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null) { + //function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $sNextTasParam=null,$iPriority = 3, $isSubprocess=false ) { if (!isset($sProUid) || strlen($sProUid) == 0 ) { throw ( new Exception ( 'Column "PRO_UID" cannot be null.' ) ); @@ -91,7 +92,7 @@ class AppDelegation extends BaseAppDelegation { $this->setProUid ( $sProUid ); $this->setTasUid ( $sTasUid ); $this->setDelIndex ( $delIndex ); - $this->setDelPrevious ( 0 ); + $this->setDelPrevious ( $sPrevious == -1 ? 0 : $sPrevious ); $this->setUsrUid ( $sUsrUid ); $this->setDelType ( 'NORMAL' ); $this->setDelPriority ( ($iPriority != '' ? $iPriority : '3') );