@@ -50,6 +50,8 @@ class Derivation
|
|||||||
var $case;
|
var $case;
|
||||||
protected $flagControl;
|
protected $flagControl;
|
||||||
protected $flagControlMulInstance;
|
protected $flagControlMulInstance;
|
||||||
|
protected $sys;
|
||||||
|
protected $context;
|
||||||
private $regexpTaskTypeToInclude;
|
private $regexpTaskTypeToInclude;
|
||||||
public $node;
|
public $node;
|
||||||
public $userLogged = null;
|
public $userLogged = null;
|
||||||
@@ -735,6 +737,9 @@ class Derivation
|
|||||||
$arrayEventExecute = ["BEFORE" => $flagEventExecuteBeforeGateway, "AFTER" => $flagEventExecuteAfterGateway];
|
$arrayEventExecute = ["BEFORE" => $flagEventExecuteBeforeGateway, "AFTER" => $flagEventExecuteAfterGateway];
|
||||||
$positionEventExecute = "BEFORE";
|
$positionEventExecute = "BEFORE";
|
||||||
|
|
||||||
|
$aContext = $this->context;
|
||||||
|
$aContext['appUid'] = $applicationData["APP_UID"];
|
||||||
|
$aContext['proUid'] = $applicationData["PRO_UID"];
|
||||||
if(sizeof($arrayElement)){
|
if(sizeof($arrayElement)){
|
||||||
foreach ($arrayElement as $value) {
|
foreach ($arrayElement as $value) {
|
||||||
switch ($value['type']) {
|
switch ($value['type']) {
|
||||||
@@ -746,11 +751,25 @@ class Derivation
|
|||||||
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'MESSAGETHROW') {
|
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'MESSAGETHROW') {
|
||||||
//Message-Application throw
|
//Message-Application throw
|
||||||
$result = $messageApplication->create($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
|
$result = $messageApplication->create($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
|
||||||
|
|
||||||
|
$aContext['envUid'] = $value['uid'];
|
||||||
|
$aContext['envType'] = $event->getEvnType();
|
||||||
|
$aContext['envMarker'] = $event->getEvnMarker();
|
||||||
|
$aContext['action'] = 'Message application throw';
|
||||||
|
//Logger
|
||||||
|
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'EMAIL') {
|
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'EMAIL') {
|
||||||
//Email-Event throw
|
//Email-Event throw
|
||||||
$result = $emailEvent->sendEmail($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
|
$result = $emailEvent->sendEmail($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
|
||||||
|
|
||||||
|
$aContext['envUid'] = $value['uid'];
|
||||||
|
$aContext['envType'] = $event->getEvnType();
|
||||||
|
$aContext['envMarker'] = $event->getEvnMarker();
|
||||||
|
$aContext['action'] = 'Email event throw';
|
||||||
|
//Logger
|
||||||
|
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -824,6 +843,9 @@ class Derivation
|
|||||||
function derivate(array $currentDelegation, array $nextDelegations, $removeList = true)
|
function derivate(array $currentDelegation, array $nextDelegations, $removeList = true)
|
||||||
{
|
{
|
||||||
$arrayDerivationResult = [];
|
$arrayDerivationResult = [];
|
||||||
|
$this->context = Bootstrap::getDefaultContextLog();
|
||||||
|
$aContext = $this->context;
|
||||||
|
$this->sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
|
||||||
|
|
||||||
//define this...
|
//define this...
|
||||||
if (! defined( 'TASK_FINISH_PROCESS' )) {
|
if (! defined( 'TASK_FINISH_PROCESS' )) {
|
||||||
@@ -837,6 +859,8 @@ class Derivation
|
|||||||
|
|
||||||
//Get data for this DEL_INDEX current
|
//Get data for this DEL_INDEX current
|
||||||
$appFields = $this->case->loadCase( $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'] );
|
$appFields = $this->case->loadCase( $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'] );
|
||||||
|
$aContext['appUid'] = $currentDelegation['APP_UID'];
|
||||||
|
$aContext['delIndex'] = $currentDelegation['DEL_INDEX'];
|
||||||
|
|
||||||
unset($appFields['APP_ROUTING_DATA']);
|
unset($appFields['APP_ROUTING_DATA']);
|
||||||
|
|
||||||
@@ -921,6 +945,7 @@ class Derivation
|
|||||||
|
|
||||||
$flagUpdateList = true;
|
$flagUpdateList = true;
|
||||||
|
|
||||||
|
$aContext['tasUid'] = $nextDel['TAS_UID'];
|
||||||
switch ($nextDel['TAS_UID']) {
|
switch ($nextDel['TAS_UID']) {
|
||||||
case TASK_FINISH_PROCESS:
|
case TASK_FINISH_PROCESS:
|
||||||
/*Close all delegations of $currentDelegation['APP_UID'] */
|
/*Close all delegations of $currentDelegation['APP_UID'] */
|
||||||
@@ -939,6 +964,9 @@ class Derivation
|
|||||||
$this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true);
|
$this->executeEvent($nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$aContext['action'] = 'end-process';
|
||||||
|
//Logger
|
||||||
|
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||||
break;
|
break;
|
||||||
case TASK_FINISH_TASK:
|
case TASK_FINISH_TASK:
|
||||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||||
@@ -950,6 +978,9 @@ class Derivation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->case->closeAppThread($currentDelegation['APP_UID'], $iAppThreadIndex);
|
$this->case->closeAppThread($currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||||
|
$aContext['action'] = 'finish-task';
|
||||||
|
//Logger
|
||||||
|
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//Get all siblingThreads
|
//Get all siblingThreads
|
||||||
|
|||||||
Reference in New Issue
Block a user