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:
Roly Rudy Gutierrez Pinto
2017-07-13 16:34:49 -04:00
parent 18d8e8904a
commit fda20185ca
3 changed files with 14 additions and 29 deletions

View File

@@ -1236,7 +1236,8 @@ class Derivation
} }
//Check if $taskNextDel is Script-Task //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 //Get for $nextDel["TAS_UID"] your next Task
$currentDelegationAux = array_merge($currentDelegation, array("DEL_INDEX" => $iNewDelIndex, "TAS_UID" => $nextDel["TAS_UID"])); $currentDelegationAux = array_merge($currentDelegation, array("DEL_INDEX" => $iNewDelIndex, "TAS_UID" => $nextDel["TAS_UID"]));
$nextDelegationsAux = array(); $nextDelegationsAux = array();

View File

@@ -1986,7 +1986,7 @@ class wsBase
$task = TaskPeer::retrieveByPK($taskId); $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 == "") { if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $founded == "") {
$result = new wsResponse( 14, G::LoadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) ); $result = new wsResponse( 14, G::LoadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) );

View File

@@ -805,9 +805,6 @@ class BpmnWorkflow extends Project\Bpmn
try { try {
if (isset($this->arrayElementTaskRelation[$elementUid])) { if (isset($this->arrayElementTaskRelation[$elementUid])) {
$taskUid = $this->arrayElementTaskRelation[$elementUid]; $taskUid = $this->arrayElementTaskRelation[$elementUid];
//Task - User
//Assign to admin
$this->assignUserAdminInMessageEvents($elementType, $key, $taskUid);
} else { } else {
$taskPosX = 0; $taskPosX = 0;
$taskPosY = 0; $taskPosY = 0;
@@ -847,9 +844,17 @@ class BpmnWorkflow extends Project\Bpmn
"TAS_POSY" => $taskPosY "TAS_POSY" => $taskPosY
)); ));
//Task - User if ($elementType == "bpmnEvent" &&
//Assign to admin in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
$this->assignUserAdminInMessageEvents($elementType, $key, $taskUid); ) {
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 //Element-Task-Relation - Create
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation(); $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) public function mapBpmnGatewayToWorkflowRoutes($activityUid, $gatewayUid)
{ {
try { try {