public function addRoute($taskUid, $nextTaskUid, $type, $condition = "")
 {
     try {
         //Verify data
         if ($type == "SEC-JOIN") {
             throw new \Exception(\G::LoadTranslation("ID_ROUTE_IS_SECJOIN"));
         }
         //Route
         $result = parent::addRoute($taskUid, $nextTaskUid, $type, $condition);
         //BPMN
         $arrayBpmnGatewayType = array("EVALUATE" => "EXCLUSIVE", "SELECT" => "COMPLEX", "PARALLEL" => "PARALLEL", "PARALLEL-BY-EVALUATION" => "INCLUSIVE");
         $arrayTaskData = $this->getTask($taskUid);
         $activityUid = $arrayTaskData["TAS_UID"];
         $activityBouX = (int) $arrayTaskData["TAS_POSX"];
         $activityBouY = (int) $arrayTaskData["TAS_POSY"];
         $activityBouWidth = (int) $arrayTaskData["TAS_WIDTH"];
         $activityBouHeight = (int) $arrayTaskData["TAS_HEIGHT"];
         switch ($type) {
             case "EVALUATE":
             case "SELECT":
             case "PARALLEL":
             case "PARALLEL-BY-EVALUATION":
                 $result = $this->bp->getGatewayByDirectionActivityAndFlow("DIVERGING", $activityUid);
                 if (!is_array($result)) {
                     $gatewayUid = $this->routeToBpmnGateway("bpmnActivity", $activityUid, $activityBouX, $activityBouY, $activityBouWidth, $activityBouHeight, "", $arrayBpmnGatewayType[$type], "DIVERGING");
                     $arrayGatewayData = $this->bp->getGateway2($gatewayUid);
                 } else {
                     $arrayGatewayData = $result;
                 }
                 $gatewayUid = $arrayGatewayData["GAT_UID"];
                 $gatewayType = $arrayGatewayData["GAT_TYPE"];
                 $gatewayBouX = $arrayGatewayData["BOU_X"];
                 $gatewayBouY = $arrayGatewayData["BOU_Y"];
                 $gatewayBouWidth = $arrayGatewayData["BOU_WIDTH"];
                 $gatewayBouHeight = $arrayGatewayData["BOU_HEIGHT"];
                 if ($nextTaskUid != "-1") {
                     $arrayTaskData = $this->getTask($nextTaskUid);
                     $flowUid = $this->routeToBpmnFlow("bpmnGateway", $gatewayUid, $gatewayBouX, $gatewayBouY, $gatewayBouWidth, $gatewayBouHeight, "bpmnActivity", $arrayTaskData["TAS_UID"], (int) $arrayTaskData["TAS_POSX"], (int) $arrayTaskData["TAS_POSY"], (int) $arrayTaskData["TAS_WIDTH"], (int) $arrayTaskData["TAS_HEIGHT"], $condition);
                 } else {
                     $eventUid = $this->startTaskEndProcessToBpmnEvent("bpmnGateway", $gatewayUid, $gatewayBouX, $gatewayBouY, $gatewayBouWidth, $gatewayBouHeight, "", "END", $condition);
                 }
                 break;
             case "SEQUENTIAL":
                 if ($nextTaskUid != "-1") {
                     $arrayTaskData = $this->getTask($nextTaskUid);
                     $flowUid = $this->routeToBpmnFlow("bpmnActivity", $activityUid, $activityBouX, $activityBouY, $activityBouWidth, $activityBouHeight, "bpmnActivity", $arrayTaskData["TAS_UID"], (int) $arrayTaskData["TAS_POSX"], (int) $arrayTaskData["TAS_POSY"], (int) $arrayTaskData["TAS_WIDTH"], (int) $arrayTaskData["TAS_HEIGHT"]);
                 } else {
                     $eventUid = $this->startTaskEndProcessToBpmnEvent("bpmnActivity", $activityUid, $activityBouX, $activityBouY, $activityBouWidth, $activityBouHeight, "", "END");
                 }
                 break;
         }
         //Return
         return $result;
     } catch (\Exception $e) {
         throw $e;
     }
 }