diff --git a/features/backend/pm_user/main_tests_pm_user.feature b/features/backend/pm_user/main_tests_pm_user.feature index 440eadbc3..40a0d822a 100644 --- a/features/backend/pm_user/main_tests_pm_user.feature +++ b/features/backend/pm_user/main_tests_pm_user.feature @@ -112,8 +112,8 @@ Feature: User Main Tests | Create without replaced by, calendar | 1 | /home/wendy/photo/pic1.jpg | | Create without calendar | 2 | /home/wendy/photo/pic2.jpg | | Create with all fields | 3 | /home/wendy/photo/pic3.jpg | - | Create user Inactive | 4 | ~/userPhoto/abcd.jpg | - | Create user Vacation | 5 | ~/userPhoto/abcd.jpg | + | Create user Inactive | 4 | | + | Create user Vacation | 5 | | Scenario: Get the users List when there are exactly 63 users diff --git a/features/backend/sub_process/basic_sequence_web_entry.feature b/features/backend/sub_process/basic_sequence_web_entry.feature deleted file mode 100644 index 07c64d050..000000000 --- a/features/backend/sub_process/basic_sequence_web_entry.feature +++ /dev/null @@ -1,68 +0,0 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Sub Processs - - Scenario: List all the Sub Processs (result 0 Sub Processs) - Given that I have a valid access_token - And I request "project/9821342145305125d48cb88069229840/sub-process/61578996253051263872061082298948" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "spr_name" is set to "Sub-Proces" - - - Scenario: Update a Sub Process - Given that I have a valid access_token - And PUT this data: - """ - { - "spr_pro": "4728335905305113b8880c9007635110", - "spr_tas": "6238856655305113e127929067843487", - "spr_name": "test", - "spr_synchronous": "1", - "spr_variables_out": { - "@@APPLICATION": "@@APPLICATION", - "zzzzz": "asaaaa", - "aaaa": "ssss" - } - } - """ - And I request "project/9821342145305125d48cb88069229840/sub-process/61578996253051263872061082298948" - Then the response status code should be 200 - - - Scenario: List all the Sub Processs (result 0 Sub Processs) - Given that I have a valid access_token - And I request "project/9821342145305125d48cb88069229840/sub-process/61578996253051263872061082298948" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "spr_name" is set to "test" - - - Scenario: Update a Sub Process - Given that I have a valid access_token - And PUT this data: - """ - { - "spr_pro": "4728335905305113b8880c9007635110", - "spr_tas": "6238856655305113e127929067843487", - "spr_name": "Sub-Proces", - "spr_synchronous": "1", - "spr_variables_out": { - "@@APPLICATION": "@@APPLICATION", - "zzzzz": "asaaaa", - "aaaa": "ssss" - } - } - """ - And I request "project/9821342145305125d48cb88069229840/sub-process/61578996253051263872061082298948" - Then the response status code should be 200 - - - Scenario: List all the Sub Processs (result 0 Sub Processs) - Given that I have a valid access_token - And I request "project/9821342145305125d48cb88069229840/sub-process/61578996253051263872061082298948" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "spr_name" is set to "Sub-Proces" \ No newline at end of file diff --git a/workflow/engine/src/BusinessModel/Step/Trigger.php b/workflow/engine/src/BusinessModel/Step/Trigger.php index 60dbbfa9f..efdc11b15 100644 --- a/workflow/engine/src/BusinessModel/Step/Trigger.php +++ b/workflow/engine/src/BusinessModel/Step/Trigger.php @@ -127,7 +127,7 @@ class Trigger "ST_POSITION" => $posIni )); - $arrayData = $this->update($stepUidIni, $typeIni, $taskUid, $triggerUid, $arrayData); + $arrayData = $this->update($stepUid, $typeIni, $taskUid, $triggerUid, $arrayData); return $arrayData; } catch (\Exception $e) { @@ -151,7 +151,7 @@ class Trigger try { $flagStepAssignTask = 0; - if ($stepUid == "") { + if (($stepUid == "") || ($stepUid == "-1") || ($stepUid == "-2")) { $flagStepAssignTask = 1; switch ($type) { @@ -207,7 +207,6 @@ class Trigger if (isset($tempPos)) { $this->moveStepTriggers($taskUid, $stepUid, $triggerUid, $type, $tempPos); } - return array_change_key_case($arrayUpdateData, CASE_LOWER); } catch (\Exception $e) { throw $e; @@ -375,9 +374,21 @@ class Trigger */ public function moveStepTriggers($tasUid, $stepUid, $triUid, $type, $newPos) { $stepTrigger = new \BusinessModel\Step(); - $aStepTriggers = $stepTrigger->getTriggers($stepUid, $tasUid); + $tempStep = $stepUid; + $typeCompare = $type; + if ($tempStep == '-1' || $tempStep == '-2') { + $tempStep = ''; + if (($stepUid == '-1') && ($type == 'BEFORE')) { + $typeCompare = "BEFORE_ASSIGNMENT"; + } elseif (($stepUid == '-2') && ($type == 'BEFORE')) { + $typeCompare = "BEFORE_ROUTING"; + } elseif (($stepUid == '-2') && ($type == 'AFTER')) { + $typeCompare = "AFTER_ROUTING"; + } + } + $aStepTriggers = $stepTrigger->getTriggers($tempStep, $tasUid); foreach ($aStepTriggers as $dataStep) { - if (($dataStep['st_type'] == $type) && ($dataStep['tri_uid'] == $triUid)) { + if (($dataStep['st_type'] == $typeCompare) && ($dataStep['tri_uid'] == $triUid)) { $prStepPos = (int)$dataStep['st_position']; } } @@ -400,7 +411,7 @@ class Trigger $range = range($iniPos, $finPos); foreach ($aStepTriggers as $dataStep) { - if (($dataStep['st_type'] == $type) && (in_array($dataStep['st_position'], $range)) && ($dataStep['tri_uid'] != $triUid)) { + if (($dataStep['st_type'] == $typeCompare) && (in_array($dataStep['st_position'], $range)) && ($dataStep['tri_uid'] != $triUid)) { $stepChangeIds[] = $dataStep['tri_uid']; $stepChangePos[] = $dataStep['st_position']; }