HOR-3489 Improvement: the observations are applied in 'Pull Request', the changes are reversed because they are not necessary in the process import...
This commit is contained in:
@@ -1236,7 +1236,8 @@ class Derivation
|
||||
}
|
||||
|
||||
//Check if $taskNextDel is Script-Task
|
||||
if (!is_null($taskNextDel) && ($taskNextDel->getTasType() === "SCRIPT-TASK" || $taskNextDel->getTasType() === "INTERMEDIATE-THROW-EMAIL-EVENT" || $taskNextDel->getTasType() === "INTERMEDIATE-THROW-MESSAGE-EVENT" || $taskNextDel->getTasType() === "SERVICE-TASK")) {
|
||||
$arrayTaskTypeToExclude = ["SCRIPT-TASK", "INTERMEDIATE-THROW-EMAIL-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "SERVICE-TASK", "START-MESSAGE-EVENT"];
|
||||
if (!is_null($taskNextDel) && (in_array($taskNextDel->getTasType(), $arrayTaskTypeToExclude))) {
|
||||
//Get for $nextDel["TAS_UID"] your next Task
|
||||
$currentDelegationAux = array_merge($currentDelegation, array("DEL_INDEX" => $iNewDelIndex, "TAS_UID" => $nextDel["TAS_UID"]));
|
||||
$nextDelegationsAux = array();
|
||||
|
||||
@@ -1986,7 +1986,7 @@ class wsBase
|
||||
|
||||
$task = TaskPeer::retrieveByPK($taskId);
|
||||
|
||||
$arrayTaskTypeToExclude = array("START-TIMER-EVENT");
|
||||
$arrayTaskTypeToExclude = array("START-TIMER-EVENT", "START-MESSAGE-EVENT");
|
||||
|
||||
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $founded == "") {
|
||||
$result = new wsResponse( 14, G::LoadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) );
|
||||
|
||||
@@ -805,9 +805,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
try {
|
||||
if (isset($this->arrayElementTaskRelation[$elementUid])) {
|
||||
$taskUid = $this->arrayElementTaskRelation[$elementUid];
|
||||
//Task - User
|
||||
//Assign to admin
|
||||
$this->assignUserAdminInMessageEvents($elementType, $key, $taskUid);
|
||||
} else {
|
||||
$taskPosX = 0;
|
||||
$taskPosY = 0;
|
||||
@@ -847,9 +844,17 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
"TAS_POSY" => $taskPosY
|
||||
));
|
||||
|
||||
//Task - User
|
||||
//Assign to admin
|
||||
$this->assignUserAdminInMessageEvents($elementType, $key, $taskUid);
|
||||
if ($elementType == "bpmnEvent" &&
|
||||
in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
|
||||
) {
|
||||
if (in_array($key, array("start-message-event", "intermediate-catch-message-event"))) {
|
||||
//Task - User
|
||||
//Assign to admin
|
||||
$task = new \Tasks();
|
||||
|
||||
$result = $task->assignUser($taskUid, "00000000000000000000000000000001", 1);
|
||||
}
|
||||
}
|
||||
|
||||
//Element-Task-Relation - Create
|
||||
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
|
||||
@@ -874,27 +879,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Task - User, Assign 'admin' user in 'start-message-event' and
|
||||
* 'intermediate-catch-message-event' elements.
|
||||
* @param string $elementType
|
||||
* @param string $key
|
||||
* @param string $taskUid
|
||||
*/
|
||||
public function assignUserAdminInMessageEvents($elementType, $key, $taskUid)
|
||||
{
|
||||
try {
|
||||
if ($elementType == "bpmnEvent" && in_array($key, ["start-message-event", "intermediate-catch-message-event"])) {
|
||||
$task = new \Tasks();
|
||||
$task->assignUser($taskUid, "00000000000000000000000000000001", 1);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$context = \Bootstrap::getDefaultContextLog();
|
||||
$context['action'] = $e->getMessage();
|
||||
\Bootstrap::registerMonolog('Import', 300, 'assign user', $context, $context["workspace"], 'processmaker.log');
|
||||
}
|
||||
}
|
||||
|
||||
public function mapBpmnGatewayToWorkflowRoutes($activityUid, $gatewayUid)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user