@@ -54,7 +54,7 @@ class Derivation
|
|||||||
*
|
*
|
||||||
* @param array $arrayTaskData Task data (derivation)
|
* @param array $arrayTaskData Task data (derivation)
|
||||||
*
|
*
|
||||||
* return array Return array
|
* @return array Return array
|
||||||
*/
|
*/
|
||||||
private function prepareInformationTask(array $arrayTaskData)
|
private function prepareInformationTask(array $arrayTaskData)
|
||||||
{
|
{
|
||||||
@@ -130,7 +130,7 @@ class Derivation
|
|||||||
* @param array $arrayData Data
|
* @param array $arrayData Data
|
||||||
* @param string $taskUid Unique id of Task
|
* @param string $taskUid Unique id of Task
|
||||||
*
|
*
|
||||||
* return array Return array
|
* @return array Return array
|
||||||
*/
|
*/
|
||||||
public function prepareInformation(array $arrayData, $taskUid = "")
|
public function prepareInformation(array $arrayData, $taskUid = "")
|
||||||
{
|
{
|
||||||
@@ -641,7 +641,7 @@ class Derivation
|
|||||||
* @param mixed $aSp
|
* @param mixed $aSp
|
||||||
* @param bool $removeList
|
* @param bool $removeList
|
||||||
*
|
*
|
||||||
* return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function derivateUpdateCounters(array $arrayCurrentDelegationData, array $arrayNextDelegationData, $taskNextDelegation, array $arrayApplicationData, $delIndexNew, $aSp, $removeList)
|
private function derivateUpdateCounters(array $arrayCurrentDelegationData, array $arrayNextDelegationData, $taskNextDelegation, array $arrayApplicationData, $delIndexNew, $aSp, $removeList)
|
||||||
{
|
{
|
||||||
@@ -690,9 +690,7 @@ class Derivation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$regexpTaskTypeToExclude = "SCRIPT-TASK";
|
if ($removeList) {
|
||||||
|
|
||||||
if (!preg_match("/^(?:" . $regexpTaskTypeToExclude . ")$/", $taskNextDelegation->getTasType()) && $removeList) {
|
|
||||||
$application = ApplicationPeer::retrieveByPK($arrayApplicationData["APP_UID"]);
|
$application = ApplicationPeer::retrieveByPK($arrayApplicationData["APP_UID"]);
|
||||||
|
|
||||||
if ($application->getAppStatus() == "DRAFT") {
|
if ($application->getAppStatus() == "DRAFT") {
|
||||||
@@ -710,13 +708,15 @@ class Derivation
|
|||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* derivate
|
/** Derivate
|
||||||
*
|
*
|
||||||
* @param array $currentDelegation
|
* @param array $currentDelegation
|
||||||
* @param array $nextDelegations
|
* @param array $nextDelegations
|
||||||
* @return void
|
* @param bool $removeList
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function derivate($currentDelegation = array(), $nextDelegations = array(), $removeList = true)
|
function derivate(array $currentDelegation, array $nextDelegations, $removeList = true)
|
||||||
{
|
{
|
||||||
//define this...
|
//define this...
|
||||||
if (! defined( 'TASK_FINISH_PROCESS' )) {
|
if (! defined( 'TASK_FINISH_PROCESS' )) {
|
||||||
@@ -750,9 +750,7 @@ class Derivation
|
|||||||
$currentDelegation["TAS_MI_COMPLETE_VARIABLE"] = $task->getTasMiCompleteVariable();
|
$currentDelegation["TAS_MI_COMPLETE_VARIABLE"] = $task->getTasMiCompleteVariable();
|
||||||
$currentDelegation["TAS_MI_INSTANCE_VARIABLE"] = $task->getTasMiInstanceVariable();
|
$currentDelegation["TAS_MI_INSTANCE_VARIABLE"] = $task->getTasMiInstanceVariable();
|
||||||
|
|
||||||
//Count how many tasks should be derivated.
|
$arrayNextDerivation = array();
|
||||||
//$countNextTask = count($nextDelegations);
|
|
||||||
//$removeList = true;
|
|
||||||
|
|
||||||
foreach ($nextDelegations as $nextDel) {
|
foreach ($nextDelegations as $nextDel) {
|
||||||
//BpmnEvent - END-MESSAGE-EVENT, END-EMAIL-EVENT
|
//BpmnEvent - END-MESSAGE-EVENT, END-EMAIL-EVENT
|
||||||
@@ -951,28 +949,41 @@ class Derivation
|
|||||||
|
|
||||||
//Check if $taskNextDel is Script-Task
|
//Check if $taskNextDel is Script-Task
|
||||||
if (!is_null($taskNextDel) && $taskNextDel->getTasType() == "SCRIPT-TASK") {
|
if (!is_null($taskNextDel) && $taskNextDel->getTasType() == "SCRIPT-TASK") {
|
||||||
$this->case->CloseCurrentDelegation($currentDelegation["APP_UID"], $iNewDelIndex);
|
|
||||||
|
|
||||||
//Get for $nextDel["TAS_UID"] your next Task
|
//Get for $nextDel["TAS_UID"] your next Task
|
||||||
$taskNextDelNextDelegations = $this->prepareInformation(array(
|
$currentDelegationAux = array_merge($currentDelegation, array("DEL_INDEX" => $iNewDelIndex, "TAS_UID" => $nextDel["TAS_UID"]));
|
||||||
|
$nextDelegationsAux = array();
|
||||||
|
|
||||||
|
$taskNextDelNextDelRouType = "";
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
$arrayTaskNextDelNextDelegations = $this->prepareInformation(array(
|
||||||
"USER_UID" => $_SESSION["USER_LOGGED"],
|
"USER_UID" => $_SESSION["USER_LOGGED"],
|
||||||
"APP_UID" => $_SESSION["APPLICATION"],
|
"APP_UID" => $currentDelegation["APP_UID"],
|
||||||
"DEL_INDEX" => $iNewDelIndex
|
"DEL_INDEX" => $iNewDelIndex
|
||||||
));
|
));
|
||||||
|
|
||||||
//New next delegation
|
foreach ($arrayTaskNextDelNextDelegations as $key2 => $value2) {
|
||||||
$newNextDelegation = array();
|
$arrayTaskNextDelNextDel = $value2;
|
||||||
|
|
||||||
$newNextDelegation[1] = array(
|
if (!isset($arrayTaskNextDelNextDel["NEXT_TASK"]["USER_ASSIGNED"]["USR_UID"])) {
|
||||||
"TAS_UID" => $taskNextDelNextDelegations[1]["NEXT_TASK"]["TAS_UID"],
|
throw new Exception(G::LoadTranslation("ID_NO_USERS"));
|
||||||
"USR_UID" => $taskNextDelNextDelegations[1]["NEXT_TASK"]["USER_ASSIGNED"]["USR_UID"],
|
}
|
||||||
"TAS_ASSIGN_TYPE" => $taskNextDelNextDelegations[1]["NEXT_TASK"]["TAS_ASSIGN_TYPE"],
|
|
||||||
"TAS_DEF_PROC_CODE" => "",
|
|
||||||
"DEL_PRIORITY" => "",
|
|
||||||
"TAS_PARENT" => ""
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->derivate($currentDelegation, $newNextDelegation, $removeList);
|
$taskNextDelNextDelRouType = $arrayTaskNextDelNextDel["ROU_TYPE"];
|
||||||
|
|
||||||
|
$nextDelegationsAux[++$i] = array(
|
||||||
|
"TAS_UID" => $arrayTaskNextDelNextDel["NEXT_TASK"]["TAS_UID"],
|
||||||
|
"USR_UID" => $arrayTaskNextDelNextDel["NEXT_TASK"]["USER_ASSIGNED"]["USR_UID"],
|
||||||
|
"TAS_ASSIGN_TYPE" => $arrayTaskNextDelNextDel["NEXT_TASK"]["TAS_ASSIGN_TYPE"],
|
||||||
|
"TAS_DEF_PROC_CODE" => $arrayTaskNextDelNextDel["NEXT_TASK"]["TAS_DEF_PROC_CODE"],
|
||||||
|
"DEL_PRIORITY" => "",
|
||||||
|
"TAS_PARENT" => $arrayTaskNextDelNextDel["NEXT_TASK"]["TAS_PARENT"]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentDelegationAux["ROU_TYPE"] = $taskNextDelNextDelRouType;
|
||||||
|
|
||||||
|
$arrayNextDerivation[] = array("currentDelegation" => $currentDelegationAux, "nextDelegations" => $nextDelegationsAux);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//when the task doesnt generate a new AppDelegation
|
//when the task doesnt generate a new AppDelegation
|
||||||
@@ -1035,6 +1046,13 @@ class Derivation
|
|||||||
$this->case->updateCase( $currentDelegation["APP_UID"], $appFields );
|
$this->case->updateCase( $currentDelegation["APP_UID"], $appFields );
|
||||||
//End Block : UPDATES APPLICATION
|
//End Block : UPDATES APPLICATION
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Start the next derivations (Script-Task)
|
||||||
|
if (!empty($arrayNextDerivation)) {
|
||||||
|
foreach ($arrayNextDerivation as $value) {
|
||||||
|
$this->derivate($value["currentDelegation"], $value["nextDelegations"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function doDerivation ($currentDelegation, $nextDel, $appFields, $aSP = null)
|
function doDerivation ($currentDelegation, $nextDel, $appFields, $aSP = null)
|
||||||
|
|||||||
@@ -112,6 +112,19 @@ try {
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (isset($record["DEL_PREVIOUS_USR_UID"])) {
|
if (isset($record["DEL_PREVIOUS_USR_UID"])) {
|
||||||
|
if ($record["DEL_PREVIOUS_USR_UID"] == "") {
|
||||||
|
$appDelegation = AppDelegationPeer::retrieveByPK($record["APP_UID"], $record["DEL_INDEX"]);
|
||||||
|
$appDelegationPrevious = AppDelegationPeer::retrieveByPK($record["APP_UID"], $appDelegation->getDelPrevious());
|
||||||
|
|
||||||
|
$taskPrevious = TaskPeer::retrieveByPK($appDelegationPrevious->getTasUid());
|
||||||
|
|
||||||
|
switch ($taskPrevious->getTasType()) {
|
||||||
|
case "SCRIPT-TASK":
|
||||||
|
$record["DEL_PREVIOUS_USR_UID"] = $taskPrevious->getTasType();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$record["PREVIOUS_USR_UID"] = $record["DEL_PREVIOUS_USR_UID"];
|
$record["PREVIOUS_USR_UID"] = $record["DEL_PREVIOUS_USR_UID"];
|
||||||
$record["PREVIOUS_USR_USERNAME"] = $record["DEL_PREVIOUS_USR_USERNAME"];
|
$record["PREVIOUS_USR_USERNAME"] = $record["DEL_PREVIOUS_USR_USERNAME"];
|
||||||
$record["PREVIOUS_USR_FIRSTNAME"] = $record["DEL_PREVIOUS_USR_FIRSTNAME"];
|
$record["PREVIOUS_USR_FIRSTNAME"] = $record["DEL_PREVIOUS_USR_FIRSTNAME"];
|
||||||
|
|||||||
@@ -582,9 +582,15 @@ Ext.onReady ( function() {
|
|||||||
|
|
||||||
previous_full_name = function(v, x, s) {
|
previous_full_name = function(v, x, s) {
|
||||||
if (s.data.PREVIOUS_USR_UID) {
|
if (s.data.PREVIOUS_USR_UID) {
|
||||||
return _FNF(s.data.PREVIOUS_USR_USERNAME, s.data.PREVIOUS_USR_FIRSTNAME, s.data.PREVIOUS_USR_LASTNAME);
|
switch (s.data.PREVIOUS_USR_UID) {
|
||||||
}
|
case "SCRIPT-TASK":
|
||||||
else {
|
return _("ID_SCRIPT_TASK");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return _FNF(s.data.PREVIOUS_USR_USERNAME, s.data.PREVIOUS_USR_FIRSTNAME, s.data.PREVIOUS_USR_LASTNAME);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user