BUG 8169 "Recieve An Error in Parallel Task are finished (2.0...." SOLVED
- the problem originally was that never is derivation handling correctly to conditional forks and normal forks - code was improed and handled for both forks at derivation types
This commit is contained in:
@@ -1126,11 +1126,14 @@ class Cases {
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aPrevious = $this->searchOpenPreviousTasks($aRow['TAS_UID'], $sAppUid);
|
||||
if (!(is_array($aPrevious) && count($aPrevious) == 0 ))
|
||||
|
||||
if (is_array($aPrevious) && count($aPrevious) > 0 ) {
|
||||
$aThreads[] = array_merge($aPrevious, $aThreads);
|
||||
}
|
||||
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
|
||||
return $aThreads;
|
||||
} catch (exception $e) {
|
||||
throw ($e);
|
||||
@@ -1154,11 +1157,11 @@ class Cases {
|
||||
|
||||
//check if this task ( $taskUid ) has open delegations
|
||||
$delegations = $this->getReviewedTasks($taskUid, $sAppUid);
|
||||
|
||||
|
||||
if ($delegations !== false) {
|
||||
if ( count($aTaskReviewed['open']) > 0) {
|
||||
if ( count($delegations['open']) > 0) {
|
||||
//there is an open delegation, so we need to return the delegation row
|
||||
return $aTaskReviewed['open'];
|
||||
return $delegations['open'];
|
||||
}
|
||||
else {
|
||||
return array(); //returning empty array
|
||||
@@ -1179,12 +1182,17 @@ class Cases {
|
||||
$delegations = $this->getReviewedTasks($aRow['TAS_UID'], $sAppUid);
|
||||
|
||||
if ($delegations !== false) {
|
||||
if ( count($aTaskReviewed['open']) > 0) {
|
||||
if ( count($delegations['open']) > 0) {
|
||||
//there is an open delegation, so we need to return the delegation row
|
||||
$aTaskReviewed = array_merge($aTaskReviewed, $aTaskReviewed['open']);
|
||||
$aTaskReviewed = array_merge($aTaskReviewed, $delegations['open']);
|
||||
}
|
||||
else {
|
||||
$aTaskReviewed = array_merge($aTaskReviewed, $aTaskReviewed['closed']);
|
||||
if ($aRow['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION') {
|
||||
$aTaskReviewed = array();
|
||||
}
|
||||
else {
|
||||
$aTaskReviewed = array_merge($aTaskReviewed, $delegations['closed']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1193,7 +1201,7 @@ class Cases {
|
||||
$aPreviousTasks[] = $aRow['TAS_UID'];
|
||||
// passing the array of previous tasks in oprder to avoid an infinite loop that prevents
|
||||
$openPreviousTask = $this->searchOpenPreviousTasks($aRow['TAS_UID'], $sAppUid, $aPreviousTasks);
|
||||
|
||||
|
||||
if (count($aPreviousTasks) > 0) {
|
||||
$aTaskReviewed = array_merge($aTaskReviewed, $openPreviousTask);
|
||||
}
|
||||
@@ -1232,7 +1240,7 @@ class Cases {
|
||||
$row = $oDataset2->getRow();
|
||||
|
||||
if ($row['DEL_THREAD_STATUS'] == 'OPEN') {
|
||||
$tasksReviewed[] = $row;
|
||||
$openTasks[] = $row;
|
||||
}
|
||||
else {
|
||||
$closedTasks[] = $row;
|
||||
|
||||
@@ -646,12 +646,15 @@ class Derivation
|
||||
$appFields['APP_FINISH_DATE'] = 'now';
|
||||
$this->verifyIsCaseChild($currentDelegation['APP_UID']);
|
||||
}
|
||||
$appFields['DEL_INDEX'] = (isset($iNewDelIndex) ? $iNewDelIndex : 0);
|
||||
$appFields['TAS_UID'] = $nextDel['TAS_UID'];
|
||||
|
||||
/* Start Block : UPDATES APPLICATION */
|
||||
$this->case->updateCase ( $currentDelegation['APP_UID'], $appFields );
|
||||
/* End Block : UPDATES APPLICATION */
|
||||
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 */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user