From 81613f100968cf547be2ba20405a1b2bcb33cede Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Tue, 18 Mar 2014 17:05:30 -0400 Subject: [PATCH 1/5] Se modifica CASES, para reassignCase y routeCase --- workflow/engine/src/BusinessModel/Cases.php | 11 ++++++++--- .../engine/src/Services/Api/ProcessMaker/Cases.php | 11 +++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index be7b66bf6..afceb779b 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -403,10 +403,12 @@ class Cases * * return array Return an array with Task Case */ - public function updateReassignCase($caseUid, $userUid, $delIndex, $userUidSource, $userUidTarget) { try { + if (!$delIndex) { + $delIndex = \AppDelegation::getCurrentIndex($caseUid); + } \G::LoadClass('wsBase'); $ws = new \wsBase(); $fields = $ws->reassignCase($userUid, $caseUid, $delIndex, $userUidSource, $userUidTarget); @@ -533,7 +535,7 @@ class Cases } /** - * Reassign Case + * Route Case * * @param string $caseUid Unique id of Case * @param string $userUid Unique id of User @@ -542,10 +544,12 @@ class Cases * * return array Return an array with Task Case */ - public function updateRouteCase($caseUid, $userUid, $delIndex) { try { + if (!$delIndex) { + $delIndex = \AppDelegation::getCurrentIndex($caseUid); + } \G::LoadClass('wsBase'); $ws = new \wsBase(); $fields = $ws->derivateCase($userUid, $caseUid, $delIndex, $bExecuteTriggersBeforeAssignment = false); @@ -556,6 +560,7 @@ class Cases } } + /** * get all upload document that they have send it * diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php index 75ad956aa..7bcac29ad 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php @@ -240,11 +240,12 @@ class Cases extends Api /** * @url PUT /:cas_uid/reassign-case * - * @param string $del_index {@from body} + * @param string $cas_uid {@from body} {@min 32}{@max 32} * @param string $usr_uid_source {@from body} {@min 32}{@max 32} * @param string $usr_uid_target {@from body} {@min 32}{@max 32} + * @param string $del_index {@from body} */ - public function doPutReassignCase($cas_uid, $del_index, $usr_uid_source, $usr_uid_target) + public function doPutReassignCase($cas_uid, $usr_uid_source, $usr_uid_target, $del_index = null) { try { $userUid = $this->getUserId(); @@ -259,12 +260,10 @@ class Cases extends Api /** * @url PUT /:cas_uid/route-case * + * @param string $cas_uid {@from body} {@min 32}{@max 32} * @param string $del_index {@from body} - * @param string $usr_uid_source {@from body} {@min 32}{@max 32} - * @param string $usr_uid_target {@from body} {@min 32}{@max 32} */ - - public function doPutRouteCase($cas_uid, $del_index) + public function doPutRouteCase($cas_uid, $del_index = null) { try { $userUid = $this->getUserId(); From 3becc1d935a3b326d700014dda81e1eb9cdc50d3 Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Tue, 18 Mar 2014 22:52:17 -0400 Subject: [PATCH 2/5] Modificaciones en las carpetas y avance en behats para las listas --- ...basic_sequence_cases_actions_13_17.feature | 85 +++++++++++ .../main_tests_cases_actions_13_17.feature} | 0 ...egative_tests_cases_actions_13_17.feature} | 0 .../basic_sequence_cases_actions_7_12.feature | 106 +++++++++++++ .../main_tests_cases_actions_7_12.feature} | 0 ...negative_tests_cases_actions_7_12.feature} | 0 .../basic_sequence_case_note.feature | 0 .../main_tests_case_note.feature} | 0 .../negative_tests_case_note.feature} | 0 .../basic_sequence_case_variables.feature | 0 .../main_tests_case_variables.feature} | 0 .../negative_tests_case_variables.feature} | 0 .../basic_sequence_cases_lists_1_6.feature | 144 ++++++++++++++++++ .../main_tests_cases_lists_1_6.feature} | 11 +- .../negative_tests_cases_lists_1_6.feature | 40 +++++ ...basic_sequence_input_document_case.feature | 0 .../main_tests_input_document_case.feature} | 0 ...egative_tests_input_document_case.feature} | 0 ...asic_sequence_output_document_case.feature | 0 ...main_sequence_output_document_case.feature | 0 ...egative_tests_output_document_case.feature | 0 21 files changed, 383 insertions(+), 3 deletions(-) create mode 100644 features/backend/application_cases/case_actions_13-17/basic_sequence_cases_actions_13_17.feature rename features/backend/application_cases/{case note/main_tests_case_note.feature => case_actions_13-17/main_tests_cases_actions_13_17.feature} (100%) rename features/backend/application_cases/{case note/negative_tests_case_note.feature => case_actions_13-17/negative_tests_cases_actions_13_17.feature} (100%) create mode 100644 features/backend/application_cases/case_actions_7-12/basic_sequence_cases_actions_7_12.feature rename features/backend/application_cases/{case variables/main_tests_case_variables.feature => case_actions_7-12/main_tests_cases_actions_7_12.feature} (100%) rename features/backend/application_cases/{case variables/negative_tests_case_variables.feature => case_actions_7-12/negative_tests_cases_actions_7_12.feature} (100%) rename features/backend/application_cases/{case note => case_note}/basic_sequence_case_note.feature (100%) rename features/backend/application_cases/{cases lists 1-6/main_tests_cases_lists_1_6.feature => case_note/main_tests_case_note.feature} (100%) rename features/backend/application_cases/{cases lists 1-6/negative_tests_cases_lists_1_6.feature => case_note/negative_tests_case_note.feature} (100%) rename features/backend/application_cases/{case variables => case_variables}/basic_sequence_case_variables.feature (100%) rename features/backend/application_cases/{input documents_case/main_tests_input_document_case.feature => case_variables/main_tests_case_variables.feature} (100%) rename features/backend/application_cases/{input documents_case/negative_tests_input_document_case.feature => case_variables/negative_tests_case_variables.feature} (100%) create mode 100644 features/backend/application_cases/cases_lists_1-6/basic_sequence_cases_lists_1_6.feature rename features/backend/application_cases/{cases lists 1-6/basic_sequence_cases_lists_1_6.feature => cases_lists_1-6/main_tests_cases_lists_1_6.feature} (74%) create mode 100644 features/backend/application_cases/cases_lists_1-6/negative_tests_cases_lists_1_6.feature rename features/backend/application_cases/{input documents_case => input_documents_case}/basic_sequence_input_document_case.feature (100%) rename features/backend/application_cases/{output document_case/main_sequence_output_document_case.feature => input_documents_case/main_tests_input_document_case.feature} (100%) rename features/backend/application_cases/{output document_case/negative_tests_output_document_case.feature => input_documents_case/negative_tests_input_document_case.feature} (100%) rename features/backend/application_cases/{output document_case => output_document_case}/basic_sequence_output_document_case.feature (100%) create mode 100644 features/backend/application_cases/output_document_case/main_sequence_output_document_case.feature create mode 100644 features/backend/application_cases/output_document_case/negative_tests_output_document_case.feature diff --git a/features/backend/application_cases/case_actions_13-17/basic_sequence_cases_actions_13_17.feature b/features/backend/application_cases/case_actions_13-17/basic_sequence_cases_actions_13_17.feature new file mode 100644 index 000000000..69f573cc4 --- /dev/null +++ b/features/backend/application_cases/case_actions_13-17/basic_sequence_cases_actions_13_17.feature @@ -0,0 +1,85 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Cases Actions - the features in this script are (cancelCase, pauseCase, unpaseCase, executeCase, executeCase, executeTrigger and Delete Case) +Requirements: + a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point" + +Background: + Given that I have a valid access_token + + +Scenario: Cancel Case + Given PUT this data: + """ + { + + + + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/cancel-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + + +Scenario: Pause Case + Given PUT this data: + """ + { + + + + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/pause-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + + +Scenario: Unpause Case + Given PUT this data: + """ + { + + + + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/unpause-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + + + +Scenario: Executes a ProcessMaker trigger for a case + Given POST this data: + """ + { + + + + } + """ + And I request "case{uid}/execute-trigger" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "" in session array + + +Scenario: Delete case of workspace + Given that I want to delete a resource with the key "" stored in session array + And I request "case/{uid}/unpause-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" diff --git a/features/backend/application_cases/case note/main_tests_case_note.feature b/features/backend/application_cases/case_actions_13-17/main_tests_cases_actions_13_17.feature similarity index 100% rename from features/backend/application_cases/case note/main_tests_case_note.feature rename to features/backend/application_cases/case_actions_13-17/main_tests_cases_actions_13_17.feature diff --git a/features/backend/application_cases/case note/negative_tests_case_note.feature b/features/backend/application_cases/case_actions_13-17/negative_tests_cases_actions_13_17.feature similarity index 100% rename from features/backend/application_cases/case note/negative_tests_case_note.feature rename to features/backend/application_cases/case_actions_13-17/negative_tests_cases_actions_13_17.feature diff --git a/features/backend/application_cases/case_actions_7-12/basic_sequence_cases_actions_7_12.feature b/features/backend/application_cases/case_actions_7-12/basic_sequence_cases_actions_7_12.feature new file mode 100644 index 000000000..a3d81314a --- /dev/null +++ b/features/backend/application_cases/case_actions_7-12/basic_sequence_cases_actions_7_12.feature @@ -0,0 +1,106 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Cases Actions - the features in this script are (getCaseInfo, taskCase, newCase, newCaseImpersonate, reassignCase and routeCase) +Requirements: + a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point" + +Background: + Given that I have a valid access_token + + +Scenario: Returns information about a given case + Given I request "case" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the "ca_prj" property equals "ca_prj" + And the "ca_title" property equals "ca_title" + And the "ca_number" property equals "ca_number" + And the "ca_status" property equals "ca_status" + And the "ca_uid" property equals "ca_uid" + And the "ca_creator" property equals "ca_creator" + And the "ca_date" property equals "ca_date" + And the "ca_update" property equals "ca_update" + And the "ca_lastupdate" property equals "ca_lastupdate" + And the "ca_description" property equals "ca_description" + And the "ca_task" property equals "ca_task" + And the "ca_current_user" property equals "ca_current_user" + And the "ca_delegate" property equals "ca_delegate" + And the "ca_init_date" property equals "ca_init_date" + And the "ca_due_date" property equals "ca_duo_date" + And the "ca_finish_date" property equals "ca_finish_date" + + +Scenario: Returns the current task for a given case + Given I request "case/uid/current-task" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the "ca_prj" property equals "ca_prj" + + +Scenario: Create a new case in workspace with process Test Micheangelo + Given POST this data: + """ + { + + + + } + """ + And I request "case" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "" in session array + + +Scenario: Create a new case Impersonate in workspace with process Test Micheangelo + Given POST this data: + """ + { + + + + } + """ + And I request "case/impersonate" + Then the response status code should be 201 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "" in session array + + +Scenario: Reassigns a case to a different user + Given PUT this data: + """ + { + + + + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/reassign-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + + +Scenario: Autoderivate a case to the next task in the process + Given PUT this data: + """ + { + + + + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/route-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" \ No newline at end of file diff --git a/features/backend/application_cases/case variables/main_tests_case_variables.feature b/features/backend/application_cases/case_actions_7-12/main_tests_cases_actions_7_12.feature similarity index 100% rename from features/backend/application_cases/case variables/main_tests_case_variables.feature rename to features/backend/application_cases/case_actions_7-12/main_tests_cases_actions_7_12.feature diff --git a/features/backend/application_cases/case variables/negative_tests_case_variables.feature b/features/backend/application_cases/case_actions_7-12/negative_tests_cases_actions_7_12.feature similarity index 100% rename from features/backend/application_cases/case variables/negative_tests_case_variables.feature rename to features/backend/application_cases/case_actions_7-12/negative_tests_cases_actions_7_12.feature diff --git a/features/backend/application_cases/case note/basic_sequence_case_note.feature b/features/backend/application_cases/case_note/basic_sequence_case_note.feature similarity index 100% rename from features/backend/application_cases/case note/basic_sequence_case_note.feature rename to features/backend/application_cases/case_note/basic_sequence_case_note.feature diff --git a/features/backend/application_cases/cases lists 1-6/main_tests_cases_lists_1_6.feature b/features/backend/application_cases/case_note/main_tests_case_note.feature similarity index 100% rename from features/backend/application_cases/cases lists 1-6/main_tests_cases_lists_1_6.feature rename to features/backend/application_cases/case_note/main_tests_case_note.feature diff --git a/features/backend/application_cases/cases lists 1-6/negative_tests_cases_lists_1_6.feature b/features/backend/application_cases/case_note/negative_tests_case_note.feature similarity index 100% rename from features/backend/application_cases/cases lists 1-6/negative_tests_cases_lists_1_6.feature rename to features/backend/application_cases/case_note/negative_tests_case_note.feature diff --git a/features/backend/application_cases/case variables/basic_sequence_case_variables.feature b/features/backend/application_cases/case_variables/basic_sequence_case_variables.feature similarity index 100% rename from features/backend/application_cases/case variables/basic_sequence_case_variables.feature rename to features/backend/application_cases/case_variables/basic_sequence_case_variables.feature diff --git a/features/backend/application_cases/input documents_case/main_tests_input_document_case.feature b/features/backend/application_cases/case_variables/main_tests_case_variables.feature similarity index 100% rename from features/backend/application_cases/input documents_case/main_tests_input_document_case.feature rename to features/backend/application_cases/case_variables/main_tests_case_variables.feature diff --git a/features/backend/application_cases/input documents_case/negative_tests_input_document_case.feature b/features/backend/application_cases/case_variables/negative_tests_case_variables.feature similarity index 100% rename from features/backend/application_cases/input documents_case/negative_tests_input_document_case.feature rename to features/backend/application_cases/case_variables/negative_tests_case_variables.feature diff --git a/features/backend/application_cases/cases_lists_1-6/basic_sequence_cases_lists_1_6.feature b/features/backend/application_cases/cases_lists_1-6/basic_sequence_cases_lists_1_6.feature new file mode 100644 index 000000000..44e61b055 --- /dev/null +++ b/features/backend/application_cases/cases_lists_1-6/basic_sequence_cases_lists_1_6.feature @@ -0,0 +1,144 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Cases Actions - the features in this script are (inbox, draftCaseList, participatedCaseList, unassignedCaseList, pausedCaseList and advanced Search) and (getCaseInfo, taskCase, newCase, newCaseImpersonate, reassignCase and routeCase) +Requirements: + a workspace with five of the process "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection", "Derivation rules - sequential" + +Background: + Given that I have a valid access_token + + +Scenario: Returns a list of the cases for the logged in user (Inbox) + Given I request "cases" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records + + +Scenario: Returns information about a given case of the list Inbox + Given I request "cases/48177942153275bfa28bd04070312685" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the "guid" property equals "48177942153275bfa28bd04070312685" + And the "name" property equals "16" + And the "status" property equals "TO_DO" + And the "delIndex" property equals "2" + And the "processId" property equals "99209594750ec27ea338927000421575" + + +Scenario: Returns the current task for a given case of the list Inbox + Given I request "cases/48177942153275bfa28bd04070312685/current-task" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the "guid" property equals "73641967750ec281cf015d9009265327" + And the "name" property equals "Cyclical" + And the "delegate" property equals "2" + + +Scenario: Returns a list of the cases for the logged in user (Draft) + Given I request "cases/draft" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records + + +Scenario: Returns a list of the cases for the logged in user (Participated) + Given I request "cases/participated" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 6 records + + +Scenario: Returns a list of the cases for the logged in user (Unassigned) + Given I request "cases/unassigned" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records + + +Scenario: Returns a list of the cases for the logged in user (Paused) + Given I request "cases/paused" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records + + +Scenario Outline: Create a new case in workspace with process "Derivation rules - sequential" + Given POST this data: + """ + { + "prj_uid": "99209594750ec27ea338927000421575", + "act_uid": "68707275350ec281ada1c95068712556", + "variables": [{"name": "admin", "lastname":"admin"}] + } + """ + And I request "cases" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "caseId" in session array as variable "caseId_" + And store "caseNumber" in session array as variable "caseNumber_" + + Examples: + | case_number | + | 1 | + + + +Scenario: Create a new case Impersonate in workspace with process "Derivation rules - sequential" + Given POST this data: + """ + { + "prj_uid": "99209594750ec27ea338927000421575", + "usr_uid": "24166330352d56730cdd525035621101", + "act_uid": "68707275350ec281ada1c95068712556", + "variables": [{"name": "pruebaQA", "amount":"10400"}] + } + """ + And I request "cases/impersonate" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "caseId" in session array as variable "case1" + + +Scenario: Reassigns a case to a different user + Given PUT this data: + """ + { + "del_index": "53643749052af5bdef3ca79050192707", + "usr_uid_source": "62625000752d5672d6661e6072881167", + "usr_uid_target": "24166330352d56730cdd525035621101" + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/reassign-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + + +Scenario: Autoderivate a case to the next task in the process + Given PUT this data: + """ + { + "case_uid": "78ef3ca7905019270643749052af5bd7", + "del_index": "1" + } + """ + And that I want to update a resource with the key "" stored in session array + And I request "case/{uid}/route-case" + Then the response status code should be 200 + And the content type is "application/json" + And the response charset is "UTF-8" + And the type is "object" + \ No newline at end of file diff --git a/features/backend/application_cases/cases lists 1-6/basic_sequence_cases_lists_1_6.feature b/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature similarity index 74% rename from features/backend/application_cases/cases lists 1-6/basic_sequence_cases_lists_1_6.feature rename to features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature index d4a1d8ea9..66972e103 100644 --- a/features/backend/application_cases/cases lists 1-6/basic_sequence_cases_lists_1_6.feature +++ b/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature @@ -1,8 +1,8 @@ @ProcessMakerMichelangelo @RestAPI Feature: Cases Actions - the features in this script are (inbox, draftCaseList, participatedCaseList, unassignedCaseList, pausedCaseList and advanced Search) Requirements: - a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point" - + a workspace with five of the process "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection", "Derivation rules - sequential" + Background: Given that I have a valid access_token @@ -12,6 +12,7 @@ Scenario: Returns a list of the cases for the logged in user (Inbox) Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" + And the response has 1 records Scenario: Returns a list of the cases for the logged in user (Draft) @@ -19,6 +20,7 @@ Scenario: Returns a list of the cases for the logged in user (Draft) Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" + And the response has 1 records Scenario: Returns a list of the cases for the logged in user (Participated) @@ -26,6 +28,7 @@ Scenario: Returns a list of the cases for the logged in user (Participated) Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" + And the response has 9 records Scenario: Returns a list of the cases for the logged in user (Unassigned) @@ -33,10 +36,12 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned) Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" + And the response has 1 records Scenario: Returns a list of the cases for the logged in user (Paused) Given I request "cases/paused" Then the response status code should be 200 And the response charset is "UTF-8" - And the type is "array" \ No newline at end of file + And the type is "array" + And the response has 1 records \ No newline at end of file diff --git a/features/backend/application_cases/cases_lists_1-6/negative_tests_cases_lists_1_6.feature b/features/backend/application_cases/cases_lists_1-6/negative_tests_cases_lists_1_6.feature new file mode 100644 index 000000000..91314ef22 --- /dev/null +++ b/features/backend/application_cases/cases_lists_1-6/negative_tests_cases_lists_1_6.feature @@ -0,0 +1,40 @@ +@ProcessMakerMichelangelo @RestAPI +Feature: Cases Actions - the features in this script are (inbox, draftCaseList, participatedCaseList, unassignedCaseList, pausedCaseList and advanced Search) Negative Tests + +Background: + Given that I have a valid access_token + + +Scenario: Returns a list of the cases for the logged in user (Inbox) + Given I request "cases" + Then the response status code should be 400 + And the response has 4 records + And the response status message should have the following text "" + + +Scenario: Returns a list of the cases for the logged in user (Draft) + Given I request "cases/draft" + Then the response status code should be 400 + And the response has 4 records + And the response status message should have the following text "" + + +Scenario: Returns a list of the cases for the logged in user (Participated) + Given I request "cases/participated" + Then the response status code should be 400 + And the response has 4 records + And the response status message should have the following text "" + + +Scenario: Returns a list of the cases for the logged in user (Unassigned) + Given I request "cases/unassigned" + Then the response status code should be 400 + And the response has 4 records + And the response status message should have the following text "" + + +Scenario: Returns a list of the cases for the logged in user (Paused) + Given I request "cases/paused" + Then the response status code should be 400 + And the response has 4 records + And the response status message should have the following text "" \ No newline at end of file diff --git a/features/backend/application_cases/input documents_case/basic_sequence_input_document_case.feature b/features/backend/application_cases/input_documents_case/basic_sequence_input_document_case.feature similarity index 100% rename from features/backend/application_cases/input documents_case/basic_sequence_input_document_case.feature rename to features/backend/application_cases/input_documents_case/basic_sequence_input_document_case.feature diff --git a/features/backend/application_cases/output document_case/main_sequence_output_document_case.feature b/features/backend/application_cases/input_documents_case/main_tests_input_document_case.feature similarity index 100% rename from features/backend/application_cases/output document_case/main_sequence_output_document_case.feature rename to features/backend/application_cases/input_documents_case/main_tests_input_document_case.feature diff --git a/features/backend/application_cases/output document_case/negative_tests_output_document_case.feature b/features/backend/application_cases/input_documents_case/negative_tests_input_document_case.feature similarity index 100% rename from features/backend/application_cases/output document_case/negative_tests_output_document_case.feature rename to features/backend/application_cases/input_documents_case/negative_tests_input_document_case.feature diff --git a/features/backend/application_cases/output document_case/basic_sequence_output_document_case.feature b/features/backend/application_cases/output_document_case/basic_sequence_output_document_case.feature similarity index 100% rename from features/backend/application_cases/output document_case/basic_sequence_output_document_case.feature rename to features/backend/application_cases/output_document_case/basic_sequence_output_document_case.feature diff --git a/features/backend/application_cases/output_document_case/main_sequence_output_document_case.feature b/features/backend/application_cases/output_document_case/main_sequence_output_document_case.feature new file mode 100644 index 000000000..e69de29bb diff --git a/features/backend/application_cases/output_document_case/negative_tests_output_document_case.feature b/features/backend/application_cases/output_document_case/negative_tests_output_document_case.feature new file mode 100644 index 000000000..e69de29bb From a68a7b004054b3d0ed2a7980fa41b756c53e2b7f Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 19 Mar 2014 09:32:45 -0400 Subject: [PATCH 3/5] Correcion de access public --- workflow/engine/src/Services/Api/ProcessMaker/Cases.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php index 7bcac29ad..447471ef8 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php @@ -18,7 +18,6 @@ class Cases extends Api /** * Get list Cases To Do * - * @access public * @param array $request_data , Data for list * @return array * @@ -43,7 +42,6 @@ class Cases extends Api /** * Get list Cases Draft * - * @access public * @param array $request_data , Data for list * @return array * @@ -68,7 +66,6 @@ class Cases extends Api /** * Get list Cases Participated * - * @access public * @param array $request_data , Data for list * @return array * @@ -93,7 +90,6 @@ class Cases extends Api /** * Get list Cases Unassigned * - * @access public * @param array $request_data , Data for list * @return array * @@ -118,7 +114,6 @@ class Cases extends Api /** * Get list Cases Paused * - * @access public * @param array $request_data , Data for list * @return array * @@ -143,7 +138,6 @@ class Cases extends Api /** * Get list Cases Advanced Search * - * @access public * @param array $request_data , Data for list * @return array * From 7b88baec4d9783f292296bc1a16c34671fc73a08 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Wed, 19 Mar 2014 09:49:15 -0400 Subject: [PATCH 4/5] Refactoring, replacing dbArray use by ArrayUtil::sort() implementation --- .../engine/src/BusinessModel/CaseTracker.php | 51 +++---------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/workflow/engine/src/BusinessModel/CaseTracker.php b/workflow/engine/src/BusinessModel/CaseTracker.php index 445abbc76..8dbf2a8a2 100644 --- a/workflow/engine/src/BusinessModel/CaseTracker.php +++ b/workflow/engine/src/BusinessModel/CaseTracker.php @@ -297,30 +297,11 @@ class CaseTracker ); } - //Set data - \G::LoadClass("ArrayPeer"); - - global $_DBArray; - - $_DBArray = (isset($_SESSION["_DBArray"]))? $_SESSION["_DBArray"] : ""; - $_DBArray["CASE_TRACKER_OBJECT"] = $arrayCaseTrackerObject; - - $_SESSION["_DBArray"] = $_DBArray; - - $criteria = new \Criteria("dbarray"); - - $criteria->setDBArrayTable("CASE_TRACKER_OBJECT"); - $criteria->addAscendingOrderByColumn("obj_type"); - $criteria->addAscendingOrderByColumn("obj_title"); - - $rsCriteria = \ArrayBasePeer::doSelectRS($criteria); - $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - while ($rsCriteria->next()) { - $row = $rsCriteria->getRow(); - - $arrayAvailableCaseTrackerObject[] = $row; - } + $arrayAvailableCaseTrackerObject = \ProcessMaker\Util\ArrayUtil::sort( + $arrayAvailableCaseTrackerObject, + array("obj_type", "obj_title"), + SORT_ASC + ); return $arrayAvailableCaseTrackerObject; } catch (\Exception $e) { @@ -411,27 +392,7 @@ class CaseTracker //Set data \G::LoadClass("ArrayPeer"); - - global $_DBArray; - - $_DBArray = (isset($_SESSION["_DBArray"]))? $_SESSION["_DBArray"] : ""; - $_DBArray["CASE_TRACKER_OBJECT"] = $arraydbCaseTrackerObject; - - $_SESSION["_DBArray"] = $_DBArray; - - $criteria = new \Criteria("dbarray"); - - $criteria->setDBArrayTable("CASE_TRACKER_OBJECT"); - $criteria->addAscendingOrderByColumn("cto_position"); - - $rsCriteria = \ArrayBasePeer::doSelectRS($criteria); - $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - while ($rsCriteria->next()) { - $row = $rsCriteria->getRow(); - - $arrayCaseTrackerObject[] = $row; - } + $arraydbCaseTrackerObject = \ProcessMaker\Util\ArrayUtil::sort($arraydbCaseTrackerObject, array("cto_position"), SORT_ASC); return $arrayCaseTrackerObject; } catch (\Exception $e) { From 2742702f88371c1b9566c0c5c0ef81e6fd9c7a62 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Wed, 19 Mar 2014 10:02:46 -0400 Subject: [PATCH 5/5] Refactoring, replacing dbArray use by ArrayUtil::sort() implementation --- workflow/engine/src/ProcessMaker/Util/ArrayUtil.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/Util/ArrayUtil.php b/workflow/engine/src/ProcessMaker/Util/ArrayUtil.php index 228944fd2..679d727a2 100644 --- a/workflow/engine/src/ProcessMaker/Util/ArrayUtil.php +++ b/workflow/engine/src/ProcessMaker/Util/ArrayUtil.php @@ -69,6 +69,10 @@ class ArrayUtil */ public static function sort($data, $columns, $direction = SORT_ASC) { + if (empty($data)) { + return $data; + } + $composedData = array(); if (is_array($direction)) { @@ -92,7 +96,7 @@ class ArrayUtil $composedData[] = & $data; - if (PHP_VERSION_ID < 54000) { + if (PHP_VERSION_ID < 50400) { switch (count($columns)) { case 1: array_multisort($composedData[0], $composedData[1], $composedData[2]); break; case 2: array_multisort($composedData[0], $composedData[1], $composedData[2], $composedData[3], $composedData[4]); break;