From 4e56cb82807c60a8b20d9e2c817281759fedd7a6 Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Fri, 21 Mar 2014 16:27:30 -0400 Subject: [PATCH 01/17] Avance del feature cases list y cases actions --- .../basic_sequence_cases_actions_7_12.feature | 102 +++++++----- .../main_tests_cases_actions_7_12.feature | 155 ++++++++++++++++++ .../basic_sequence_cases_lists_1_6.feature | 109 +----------- .../main_tests_cases_lists_1_6.feature | 14 +- .../negative_tests_cases_lists_1_6.feature | 6 + 5 files changed, 235 insertions(+), 151 deletions(-) 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 index a3d81314a..c9a5f36b2 100644 --- 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 @@ -6,82 +6,95 @@ Requirements: Background: Given that I have a valid access_token - -Scenario: Returns information about a given case - Given I request "case" +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 "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" + And the "app_uid" property equals "48177942153275bfa28bd04070312685" + And the "app_number" property equals 16 + And the "app_name" property equals "#16" + And the "app_status" property equals "TO_DO" + And the "app_init_usr_uid" property equals "00000000000000000000000000000001" + And the "app_init_usr_username" property equals "Administrator" + And the "pro_uid" property equals "99209594750ec27ea338927000421575" + And the "pro_name" property equals "Derivation rules - sequential" + And the "app_create_date" property equals "2014-03-17 16:32:58" + And the "app_update_date" property equals "2014-03-17 16:33:01" + - -Scenario: Returns the current task for a given case - Given I request "case/uid/current-task" +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 "ca_prj" property equals "ca_prj" + And the "tas_uid" property equals "73641967750ec281cf015d9009265327" + And the "tas_title" property equals "Cyclical" + And the "del_index" property equals "2" -Scenario: Create a new case in workspace with process Test Micheangelo +Scenario Outline: Create a new case in workspace with process "Derivation rules - sequential" Given POST this data: """ { - - - + "pro_uid": "99209594750ec27ea338927000421575", + "tas_uid": "68707275350ec281ada1c95068712556", + "variables": [{"name": "admin", "lastname":"admin"}] } """ - And I request "case" - Then the response status code should be 201 + 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 "" in session array + 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 Test Micheangelo +Scenario Outline: Create a new case Impersonate in workspace with process "Derivation rules - sequential" Given POST this data: """ { - - - + "pro_uid": "99209594750ec27ea338927000421575", + "usr_uid": "24166330352d56730cdd525035621101", + "tas_uid": "68707275350ec281ada1c95068712556", + "variables": [{"name": "pruebaQA", "amount":"10400"}] } """ - And I request "case/impersonate" - Then the response status code should be 201 + 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 "" in session array + And store "caseId" in session array as variable "caseId_" + And store "caseNumber" in session array as variable "caseNumber_" + + Examples: + | case_number | + | 1 | + + +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 2 records Scenario: Reassigns a case to a different user Given PUT this data: """ { - - - + "usr_uid_source": "62625000752d5672d6661e6072881167", + "usr_uid_target": "24166330352d56730cdd525035621101", } """ - And that I want to update a resource with the key "" stored in session array + And that I want to update a resource with the key "case_number" 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" @@ -93,9 +106,8 @@ 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 @@ -103,4 +115,4 @@ Scenario: Autoderivate a case to the next task in the process 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 + And the type is "object" \ No newline at end of file diff --git a/features/backend/application_cases/case_actions_7-12/main_tests_cases_actions_7_12.feature b/features/backend/application_cases/case_actions_7-12/main_tests_cases_actions_7_12.feature index e69de29bb..932b782ec 100644 --- a/features/backend/application_cases/case_actions_7-12/main_tests_cases_actions_7_12.feature +++ b/features/backend/application_cases/case_actions_7-12/main_tests_cases_actions_7_12.feature @@ -0,0 +1,155 @@ +@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 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 "app_uid" property equals "48177942153275bfa28bd04070312685" + And the "app_number" property equals 16 + And the "app_name" property equals "#16" + And the "app_status" property equals "TO_DO" + And the "app_init_usr_uid" property equals "00000000000000000000000000000001" + And the "app_init_usr_username" property equals "Administrator" + And the "pro_uid" property equals "99209594750ec27ea338927000421575" + And the "pro_name" property equals "Derivation rules - sequential" + And the "app_create_date" property equals "2014-03-17 16:32:58" + And the "app_update_date" property equals "2014-03-17 16:33:01" + + +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 "tas_uid" property equals "73641967750ec281cf015d9009265327" + And the "tas_title" property equals "Cyclical" + And the "del_index" property equals "2" + + +Scenario Outline: Create a new case in workspace with process "Derivation rules - sequential", "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection" + Given POST this data: + """ + { + "pro_uid": "", + "tas_uid": "", + "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 "app_uid" in session array as variable "app_uid_" + And store "app_number" in session array as variable "app_number_" + + Examples: + | Description | app_uid_number | pro_uid | tas_uid | variables | + | Create new case with process "Derivation rules - sequential" | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | | + | Create new case with process "Derivation rules - evaluation" | 2 | 46279907250ec73b9b25a78031279680 | 99371337850ec73c0a38eb6024620271 | | + | Create new case with process "Derivation rules - Parallel" | 3 | 35894775350ec7daa099378048029617 | 52838134750ec7dd0989fc0015625952 | | + | Create new case with process "Derivation rules - parallel evaluation" | 4 | 34579467750ec8d55e8b115057818502 | 89648437550ec8d593c2159010276089 | | + | Create new case with process "Derivation rules - selection" | 5 | 82458496050ec668981ecc7039804404 | 56900024450ec668e4a9243080698854 | | + + + +Scenario Outline: Create a new case Impersonate in workspace with process "Derivation rules - sequential", "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection" + Given POST this data: + """ + { + "pro_uid": "", + "usr_uid": "", + "tas_uid": "", + "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 "app_uid" in session array as variable "app_uid_" + And store "app_number" in session array as variable "app_number_" + + Examples: + | Description | app_uid_number | pro_uid | usr_uid | tas_uid | variables | + | Create new case with process "Derivation rules - sequential" - Case Start with chris | 6 | 99209594750ec27ea338927000421575 | 24166330352d56730cdd525035621101 | 68707275350ec281ada1c95068712556 | | + | Create new case with process "Derivation rules - evaluation" - Case Start with adam | 7 | 46279907250ec73b9b25a78031279680 | 44811996752d567110634a1013636964 | 99371337850ec73c0a38eb6024620271 | | + | Create new case with process "Derivation rules - Parallel" - Case Start with aaron | 8 | 35894775350ec7daa099378048029617 | 51049032352d56710347233042615067 | 52838134750ec7dd0989fc0015625952 | | + | Create new case with process "Derivation rules - parallel evaluation"- Case Start with jeremiah | 9 | 34579467750ec8d55e8b115057818502 | 86677227852d5671f40ba25017213081 | 89648437550ec8d593c2159010276089 | | + | Create new case with process "Derivation rules - selection" - Case Start with admin | 10 | 82458496050ec668981ecc7039804404 | 62625000752d5672d6661e6072881167 | 56900024450ec668e4a9243080698854 | | + + + +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 11 records + + +Scenario Outline: Reassigns a case to a different user + Given PUT this data: + """ + { + "usr_uid_source": "", + "usr_uid_target": "", + } + """ + And that I want to update a resource with the key "app_uid_" stored in session array + And I request "case/app_uid/reassign-case" with the key "app_uid" stored in session array as variable "app_uid_" + 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" + + Examples: + + | Description | app_uid_number | usr_uid_source | usr_uid_target | + | Reassign the user adam | 1 | 00000000000000000000000000000001 | 44811996752d567110634a1013636964 | + | Reassign the user aaron | 2 | 00000000000000000000000000000001 | 51049032352d56710347233042615067 | + | Reassign the user jeremiah | 3 | 00000000000000000000000000000001 | 86677227852d5671f40ba25017213081 | + | Reassign the user chris | 4 | 00000000000000000000000000000001 | 24166330352d56730cdd525035621101 | + | Reassign the user zachary | 5 | 00000000000000000000000000000001 | 62625000752d5672d6661e6072881167 | + | Reassign the user admin | 6 | 24166330352d56730cdd525035621101 | 00000000000000000000000000000001 | + | Reassign the user admin | 7 | 44811996752d567110634a1013636964 | 00000000000000000000000000000001 | + | Reassign the user admin | 8 | 51049032352d56710347233042615067 | 00000000000000000000000000000001 | + | Reassign the user admin | 9 | 86677227852d5671f40ba25017213081 | 00000000000000000000000000000001 | + | Reassign the user admin | 10 | 62625000752d5672d6661e6072881167 | 00000000000000000000000000000001 | + + +Scenario Outline: Route a case to the next task in the process + Given PUT this data: + """ + { + + } + """ + And that I want to update a resource with the key "app_uid_" stored in session array + And I request "case/app_uid/route-case" with the key "app_uid" stored in session array as variable "app_uid_" + 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" + + Examples: + + | Description | app_uid_number | + | Route next activity "Derivation rules - sequential" | 1 | + | Route next activity "Derivation rules - evaluation" | 2 | + | Route next activity "Derivation rules - Parallel" | 3 | + | Route next activity "Derivation rules - parallel evaluation" | 4 | + | Route next activity "Derivation rules - selection" | 5 | + | Route next activity "Derivation rules - sequential" | 6 | + | Route next activity "Derivation rules - evaluation" | 7 | + | Route next activity "Derivation rules - Parallel" | 8 | + | Route next activity "Derivation rules - parallel evaluation" | 9 | + | Route next activity "Derivation rules - selection" | 10 | 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 index 18d6fab12..683d54cf7 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/basic_sequence_cases_lists_1_6.feature @@ -15,28 +15,6 @@ Scenario: Returns a list of the cases for the logged in user (Inbox) 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 @@ -69,84 +47,9 @@ Scenario: Returns a list of the cases for the logged in user (Paused) 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 Outline: 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 "caseId_" - And store "caseNumber" in session array as variable "caseNumber_" - - Examples: - | case_number | - | 1 | - - - -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 +Scenario: Returns a list of the cases for the logged in user (Advanced Search) + Given I request "cases/advanced-search" + 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 \ No newline at end of file diff --git a/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature b/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature index 66972e103..683d54cf7 100644 --- a/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature +++ b/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature @@ -1,5 +1,5 @@ @ProcessMakerMichelangelo @RestAPI -Feature: Cases Actions - the features in this script are (inbox, draftCaseList, participatedCaseList, unassignedCaseList, pausedCaseList and advanced Search) +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" @@ -13,7 +13,7 @@ Scenario: Returns a list of the cases for the logged in user (Inbox) 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) Given I request "cases/draft" @@ -28,7 +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 + And the response has 6 records Scenario: Returns a list of the cases for the logged in user (Unassigned) @@ -44,4 +44,12 @@ Scenario: Returns a list of the cases for the logged in user (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: Returns a list of the cases for the logged in user (Advanced Search) + Given I request "cases/advanced-search" + 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 \ 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 index 91314ef22..bb386ba8f 100644 --- 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 @@ -37,4 +37,10 @@ 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 "" + +Scenario: Returns a list of the cases for the logged in user (Advanced Search) + Given I request "cases/advanced-search" + 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 From 33463282d2ca48bc913a6200a86e791137b19365 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Fri, 21 Mar 2014 16:40:02 -0400 Subject: [PATCH 02/17] Se modifica CasesTest, adicionando test para getCaseInfo, getTaskCase, NewCase, NewCaseImpersonate, RouteCase, ReassingCase. Se modifican respuestas en Cases --- workflow/engine/src/BusinessModel/Cases.php | 3 +- .../src/Tests/BusinessModel/CasesTest.php | 104 ++++++++++++++++++ 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index aa40fb568..3133a920e 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -349,7 +349,7 @@ class Cases for ($i = 0; $i<=count($array['current_task'])-1; $i++) { $current_task = $array['current_task'][$i]; $current_task['usr_uid'] = $current_task['userId']; - $current_task['usr_name'] = $current_task['userName']; + $current_task['usr_name'] = trim($current_task['userName']); $current_task['tas_uid'] = $current_task['taskId']; $current_task['tas_title'] = $current_task['taskName']; $current_task['del_index'] = $current_task['delIndex']; @@ -432,7 +432,6 @@ class Cases if(empty($result)) { throw (new \Exception('Incorrect or unavailable information about this case: ' .$applicationUid)); } else { - $result = json_decode(json_encode($result), false); return $result; } } catch (\Exception $e) { diff --git a/workflow/engine/src/Tests/BusinessModel/CasesTest.php b/workflow/engine/src/Tests/BusinessModel/CasesTest.php index 4ff197711..94f370b6d 100644 --- a/workflow/engine/src/Tests/BusinessModel/CasesTest.php +++ b/workflow/engine/src/Tests/BusinessModel/CasesTest.php @@ -171,5 +171,109 @@ class CasesTest extends \PHPUnit_Framework_TestCase $this->assertTrue(is_numeric($response['totalCount'])); $this->assertTrue(is_array($response['data'])); } + + /** + * Test add Case + * + * @covers \BusinessModel\Cases::addCase + * + * @copyright Colosa - Bolivia + */ + public function testAddCase() + { + $response = $this->oCases->addCase('1265557095225ff5c688f46031700471', '46941969352af5be2ab3f39001216717', '00000000000000000000000000000001', array('name' => 'John', 'lastname' => 'Petersson')); + $this->assertTrue(is_object($response)); + $aResponse = json_decode(json_encode($response), true); + return $aResponse; + } + + /** + * Test get Task Case + * + * @covers \BusinessModel\Cases::getTaskCase + * @depends testAddCase + * @param array $aResponse, Data for parent department + * + * @copyright Colosa - Bolivia + */ + public function testGetTaskCase(array $aResponse) + { + $response = $this->oCases->getTaskCase($aResponse['app_uid'], '00000000000000000000000000000001'); + $this->assertTrue(is_array($response)); + } + + /** + * Test get Case Info + * + * @covers \BusinessModel\Cases::getCaseInfo + * @depends testAddCase + * @param array $aResponse + * + * @copyright Colosa - Bolivia + */ + public function testGetCaseInfo(array $aResponse) + { + $response = $this->oCases->getCaseInfo($aResponse['app_uid'], '00000000000000000000000000000001'); + $this->assertTrue(is_object($response)); + } + + /** + * Test put reassign case + * + * @covers \BusinessModel\Cases::getCaseInfo + * @depends testAddCase + * @param array $aResponse + * + * @copyright Colosa - Bolivia + */ + public function testUpdateReassignCase(array $aResponse) + { + $response = $this->oCases->updateReassignCase($aResponse['app_uid'], '00000000000000000000000000000001', null, '00000000000000000000000000000001', '23063198853206b666e2bd0085065170'); + $this->assertTrue(empty($response)); + } + + /** + * Test add Case to test route case + * + * @covers \BusinessModel\Cases::addCase + * + * @copyright Colosa - Bolivia + */ + public function testAddCaseRouteCase() + { + $response = $this->oCases->addCase('1265557095225ff5c688f46031700471', '46941969352af5be2ab3f39001216717', '00000000000000000000000000000001', array('name' => 'John', 'lastname' => 'Petersson')); + $this->assertTrue(is_object($response)); + $aResponseRouteCase = json_decode(json_encode($response), true); + return $aResponseRouteCase; + } + + /** + * Test put route case + * + * @covers \BusinessModel\Cases::updateRouteCase + * @depends testAddCaseRouteCase + * @param array $aResponseRouteCase + * + * @copyright Colosa - Bolivia + */ + public function testUpdateRouteCase(array $aResponseRouteCase) + { + $response = $this->oCases->updateRouteCase($aResponseRouteCase['app_uid'], '00000000000000000000000000000001', null); + $this->assertTrue(empty($response)); + } + + /** + * Test add Case impersonate to test route case + * + * @covers \BusinessModel\Cases::addCaseImpersonate + * + * @copyright Colosa - Bolivia + */ + public function testAddCaseImpersonate() + { + $response = $this->oCases->addCaseImpersonate('1265557095225ff5c688f46031700471', '23063198853206b666e2bd0085065170', '46941969352af5be2ab3f39001216717', array('name' => 'John', 'lastname' => 'Petersson')); + $this->assertTrue(is_object($response)); + } + } From f804ea13ffbfdafcb7d41c24594f680e188eb4fc Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Fri, 21 Mar 2014 16:45:35 -0400 Subject: [PATCH 03/17] Se modifican respuestas en Cases --- workflow/engine/src/BusinessModel/Cases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index 3133a920e..84b662901 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -258,7 +258,7 @@ class Cases for ($i = 0; $i<=count($array['current_task'])-1; $i++) { $current_task = $array['current_task'][$i]; $current_task['usr_uid'] = $current_task['userId']; - $current_task['usr_name'] = $current_task['userName']; + $current_task['usr_name'] = trim($current_task['userName']); $current_task['tas_uid'] = $current_task['taskId']; $current_task['tas_title'] = $current_task['taskName']; $current_task['del_index'] = $current_task['delIndex']; From ac7eb0c553ca3b62bd59d90828a53e80b4bcfec0 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Mon, 24 Mar 2014 10:17:18 -0400 Subject: [PATCH 04/17] Improvement report tables - bug 14504- 14505 --- workflow/engine/templates/pmTables/list.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workflow/engine/templates/pmTables/list.js b/workflow/engine/templates/pmTables/list.js index b471944f7..384ac39eb 100755 --- a/workflow/engine/templates/pmTables/list.js +++ b/workflow/engine/templates/pmTables/list.js @@ -449,7 +449,7 @@ EditPMTable = function(){ if (row.data.TYPE != 'CLASSIC') { tableType = row.data.PRO_UID ? 'report' : 'table'; proParam = PRO_UID !== false ? '&PRO_UID='+PRO_UID : ''; - location.href = 'pmTables/edit?id='+row.data.ADD_TAB_UID+'&tableType=' + tableType + proParam; + location.href = 'pmTables/edit?id='+row.data.ADD_TAB_UID+'&flagProcessmap='+flagProcessmap+'&tableType=' + tableType + proParam; } else { //edit old report table location.href = 'reportTables/reportTables_Edit?REP_TAB_UID='+row.data.ADD_TAB_UID @@ -498,6 +498,10 @@ DeletePMTable = function() { Ext.Msg.alert( _('ID_ERROR'), resp.result.message); } }); + editButton.disable(); + deleteButton.disable(); + exportButton.disable(); + dataButton.disable(); } } ); From 1498149099bf8163b7392d9595b39096409503c5 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Mon, 24 Mar 2014 10:37:38 -0400 Subject: [PATCH 05/17] Se modifica PHPUNIT para newCaseImpersonate y se ajusta id de usuario --- workflow/engine/src/Tests/BusinessModel/CasesTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/workflow/engine/src/Tests/BusinessModel/CasesTest.php b/workflow/engine/src/Tests/BusinessModel/CasesTest.php index 94f370b6d..8e3064a13 100644 --- a/workflow/engine/src/Tests/BusinessModel/CasesTest.php +++ b/workflow/engine/src/Tests/BusinessModel/CasesTest.php @@ -228,7 +228,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase */ public function testUpdateReassignCase(array $aResponse) { - $response = $this->oCases->updateReassignCase($aResponse['app_uid'], '00000000000000000000000000000001', null, '00000000000000000000000000000001', '23063198853206b666e2bd0085065170'); + $response = $this->oCases->updateReassignCase($aResponse['app_uid'], '00000000000000000000000000000001', null, '00000000000000000000000000000001', '73005191052d56727901138030694610'); $this->assertTrue(empty($response)); } @@ -263,7 +263,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase } /** - * Test add Case impersonate to test route case + * Test add Case impersonate * * @covers \BusinessModel\Cases::addCaseImpersonate * @@ -271,9 +271,8 @@ class CasesTest extends \PHPUnit_Framework_TestCase */ public function testAddCaseImpersonate() { - $response = $this->oCases->addCaseImpersonate('1265557095225ff5c688f46031700471', '23063198853206b666e2bd0085065170', '46941969352af5be2ab3f39001216717', array('name' => 'John', 'lastname' => 'Petersson')); + $response = $this->oCases->addCaseImpersonate('1265557095225ff5c688f46031700471', '73005191052d56727901138030694610', '46941969352af5be2ab3f39001216717', array(array('name' => 'John', 'lastname' => 'Petersson'))); $this->assertTrue(is_object($response)); } - } From 4dc4fa65dd38c0e46f6426624a05afaba2a8c181 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Mon, 24 Mar 2014 10:39:05 -0400 Subject: [PATCH 06/17] Correcion de conflicto --- .../engine/classes/class.applications.php | 9 +- .../src/Services/Api/ProcessMaker/Cases.php | 504 ++++++++++++++++-- 2 files changed, 479 insertions(+), 34 deletions(-) diff --git a/workflow/engine/classes/class.applications.php b/workflow/engine/classes/class.applications.php index 911e4c9bb..440d70375 100755 --- a/workflow/engine/classes/class.applications.php +++ b/workflow/engine/classes/class.applications.php @@ -17,7 +17,8 @@ class Applications $dir = null, $sort = "APP_CACHE_VIEW.APP_NUMBER", $category = null, - $configuration = true + $configuration = true, + $paged = false ) { $callback = isset($callback)? $callback : "stcCallback1001"; $dir = isset($dir)? $dir : "DESC"; @@ -363,7 +364,7 @@ class Applications //here we count how many records exists for this criteria. //BUT there are some special cases, and if we dont optimize them the server will crash. - $doCountAlreadyExecuted = false; + $doCountAlreadyExecuted = $paged; //case 1. when the SEARCH action is selected and none filter, search criteria is defined, //we need to count using the table APPLICATION, because APP_CACHE_VIEW takes 3 seconds @@ -378,8 +379,8 @@ class Applications } */ $tableNameAux = ''; - - if ($doCountAlreadyExecuted == false) { + $totalCount = 0; + if ($doCountAlreadyExecuted == true) { // in the case of reassign the distinct attribute shows a diferent count result comparing to the // original list //Check also $distinct in the method getListCounters(), this in AppCacheView.php diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php index 02df83ee6..82cefbd78 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php @@ -18,7 +18,13 @@ class Cases extends Api /** * Get list Cases To Do * - * @param array $request_data , Data for list + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} * @return array * * @author Brayan Pereyra (Cochalo) @@ -26,13 +32,77 @@ class Cases extends Api * * @url GET */ - public function doGetCasesListToDo($request_data = array()) + public function doGetCasesListToDo( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) { try { - $request_data['action'] = 'todo'; - $request_data['userId'] = $this->getUserId(); + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'todo'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); - $response = $oCases->getList($request_data); + $response = $oCases->getList($dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get list Cases To Do with paged + * + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /paged + */ + public function doGetCasesListToDoPaged( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) + { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'todo'; + $dataList['paged'] = true; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; + $oCases = new \BusinessModel\Cases(); + $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -42,7 +112,13 @@ class Cases extends Api /** * Get list Cases Draft * - * @param array $request_data , Data for list + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} * @return array * * @author Brayan Pereyra (Cochalo) @@ -50,13 +126,77 @@ class Cases extends Api * * @url GET /draft */ - public function doGetCasesListDraft($request_data = array()) + public function doGetCasesListDraft( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) { try { - $request_data['action'] = 'draft'; - $request_data['userId'] = $this->getUserId(); + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'draft'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); - $response = $oCases->getList($request_data); + $response = $oCases->getList($dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get list Cases Draft with paged + * + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /draft/paged + */ + public function doGetCasesListDraftPaged( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) + { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'draft'; + $dataList['paged'] = true; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; + $oCases = new \BusinessModel\Cases(); + $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -66,7 +206,13 @@ class Cases extends Api /** * Get list Cases Participated * - * @param array $request_data , Data for list + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} * @return array * * @author Brayan Pereyra (Cochalo) @@ -74,13 +220,77 @@ class Cases extends Api * * @url GET /participated */ - public function doGetCasesListParticipated($request_data = array()) + public function doGetCasesListParticipated( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) { try { - $request_data['action'] = 'sent'; - $request_data['userId'] = $this->getUserId(); + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'sent'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); - $response = $oCases->getList($request_data); + $response = $oCases->getList($dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get list Cases Participated with paged + * + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /participated/paged + */ + public function doGetCasesListParticipatedPaged( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) + { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'sent'; + $dataList['paged'] = true; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; + $oCases = new \BusinessModel\Cases(); + $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -90,7 +300,13 @@ class Cases extends Api /** * Get list Cases Unassigned * - * @param array $request_data , Data for list + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} * @return array * * @author Brayan Pereyra (Cochalo) @@ -98,13 +314,77 @@ class Cases extends Api * * @url GET /unassigned */ - public function doGetCasesListUnassigned($request_data = array()) + public function doGetCasesListUnassigned( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) { try { - $request_data['action'] = 'unassigned'; - $request_data['userId'] = $this->getUserId(); + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'unassigned'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); - $response = $oCases->getList($request_data); + $response = $oCases->getList($dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get list Cases Unassigned with paged + * + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /unassigned/paged + */ + public function doGetCasesListUnassignedPaged( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) + { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'unassigned'; + $dataList['paged'] = true; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; + $oCases = new \BusinessModel\Cases(); + $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -114,7 +394,13 @@ class Cases extends Api /** * Get list Cases Paused * - * @param array $request_data , Data for list + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} * @return array * * @author Brayan Pereyra (Cochalo) @@ -122,13 +408,77 @@ class Cases extends Api * * @url GET /paused */ - public function doGetCasesListPaused($request_data = array()) + public function doGetCasesListPaused( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) { try { - $request_data['action'] = 'paused'; - $request_data['userId'] = $this->getUserId(); + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'paused'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); - $response = $oCases->getList($request_data); + $response = $oCases->getList($dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get list Cases Paused with paged + * + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $search {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /paused/paged + */ + public function doGetCasesListPausedPaged( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $search = '' + ) + { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'paused'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['search'] = $search; + $oCases = new \BusinessModel\Cases(); + $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -138,7 +488,17 @@ class Cases extends Api /** * Get list Cases Advanced Search * - * @param array $request_data , Data for list + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $status {@from path} + * @param string $user {@from path} + * @param string $dateFrom {@from path} + * @param string $dateTo {@from path} + * @param string $search {@from path} * @return array * * @author Brayan Pereyra (Cochalo) @@ -146,13 +506,97 @@ class Cases extends Api * * @url GET /advanced-search */ - public function doGetCasesListAdvancedSearch($request_data = array()) + public function doGetCasesListAdvancedSearch( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $status = '', + $user = '', + $dateFrom = '', + $dateTo = '', + $search = '' + ) { try { - $request_data['action'] = 'search'; - $request_data['userId'] = $this->getUserId(); + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'search'; + $dataList['paged'] = false; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['status'] = $status; + $dataList['user'] = $user; + $dataList['dateFrom'] = $dateFrom; + $dataList['dateTo'] = $dateTo; + $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); - $response = $oCases->getList($request_data); + $response = $oCases->getList($dataList); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Get list Cases Advanced Search with Paged + * + * @param string $paged {@from path} + * @param string $start {@from path} + * @param string $limit {@from path} + * @param string $dir {@from path} + * @param string $category {@from path} + * @param string $process {@from path} + * @param string $status {@from path} + * @param string $user {@from path} + * @param string $dateFrom {@from path} + * @param string $dateTo {@from path} + * @param string $search {@from path} + * @return array + * + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @url GET /advanced-search/paged + */ + public function doGetCasesListAdvancedSearchPaged( + $start = 0, + $limit = 25, + $sort = 'APP_CACHE_VIEW.APP_NUMBER', + $dir = 'DESC', + $category = '', + $process = '', + $status = '', + $user = '', + $dateFrom = '', + $dateTo = '', + $search = '' + ) + { + try { + $dataList['userId'] = $this->getUserId(); + $dataList['action'] = 'search'; + $dataList['paged'] = true; + + $dataList['start'] = $start; + $dataList['limit'] = $limit; + $dataList['sort'] = $sort; + $dataList['dir'] = $dir; + $dataList['category'] = $category; + $dataList['process'] = $process; + $dataList['status'] = $status; + $dataList['user'] = $user; + $dataList['dateFrom'] = $dateFrom; + $dataList['dateTo'] = $dateTo; + $dataList['search'] = $search; + $oCases = new \BusinessModel\Cases(); + $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); From aa15d5c8005032723c555cdf22afa352b4a7d696 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Mon, 24 Mar 2014 10:52:36 -0400 Subject: [PATCH 07/17] Arreglos para CASES LIST --- workflow/engine/src/BusinessModel/Cases.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index 84b662901..7f57b9467 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -45,6 +45,7 @@ class Cases $user = isset( $dataList["user"] ) ? $dataList["user"] : ""; $search = isset( $dataList["search"] ) ? $dataList["search"] : ""; $action = isset( $dataList["action"] ) ? $dataList["action"] : "todo"; + $paged = isset( $dataList["paged"] ) ? $dataList["paged"] : true; $type = "extjs"; $dateFrom = isset( $dataList["dateFrom"] ) ? substr( $dataList["dateFrom"], 0, 10 ) : ""; $dateTo = isset( $dataList["dateTo"] ) ? substr( $dataList["dateTo"], 0, 10 ) : ""; @@ -123,7 +124,9 @@ class Cases $callback, $dir, (strpos($sort, ".") !== false)? $sort : "APP_CACHE_VIEW." . $sort, - $category + $category, + true, + $paged ); } if (!empty($result['data'])) { @@ -131,6 +134,19 @@ class Cases $value = array_change_key_case($value, CASE_LOWER); } } + if ($paged == false) { + $result = $result['data']; + } else { + $result['total'] = $result['totalCount']; + unset($result['totalCount']); + + $result['start'] = $start; + $result['limit'] = $limit; + $result['sort'] = $sort; + $result['category'] = $category; + $result['process'] = $process; + $result['search'] = $search; + } return $result; } From 3b29266b2834a3cd2053afee758488badeb77d6f Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Mon, 24 Mar 2014 11:03:23 -0400 Subject: [PATCH 08/17] Se modifican newCaseImpersonate para que acepte array vacio --- workflow/engine/src/BusinessModel/Cases.php | 2 ++ workflow/engine/src/Services/Api/ProcessMaker/Cases.php | 1 + 2 files changed, 3 insertions(+) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index 84b662901..2c95c1d2c 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -495,6 +495,8 @@ class Cases $ws = new \wsBase(); if ($variables) { $variables = array_shift($variables); + } elseif ($variables == null) { + $variables = array(array()); } $fields = $ws->newCaseImpersonate($processUid, $userUid, $variables, $taskUid); $array = json_decode(json_encode($fields), true); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php index 02df83ee6..14b5901f9 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php @@ -220,6 +220,7 @@ class Cases extends Api * @param string $usr_uid {@from body} {@min 32}{@max 32} * @param string $tas_uid {@from body} {@min 32}{@max 32} * @param array $variables {@from body} + * */ public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables=null) { From 98adaa6a4e2262325fe814f1ea67d1a599ae7fe6 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Mon, 24 Mar 2014 11:26:26 -0400 Subject: [PATCH 09/17] Little fix, typo in static class name call Is important call classes such as this was declared, for auto-loading reasons --- workflow/engine/classes/class.processes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index 7a00a291a..039e4d293 100755 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -1501,8 +1501,8 @@ class Processes try { $aInput = array (); $oCriteria = new Criteria( 'workflow' ); - $oCriteria->add( InputdocumentPeer::PRO_UID, $sProUid ); - $oDataset = InputdocumentPeer::doSelectRS( $oCriteria ); + $oCriteria->add( InputDocumentPeer::PRO_UID, $sProUid ); + $oDataset = InputDocumentPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { From 9e4c3d599793128b4789c8dc124c6dd2a6750719 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Mon, 24 Mar 2014 12:00:40 -0400 Subject: [PATCH 10/17] Little fix, typo in static class name call, OutputdocumentPeer -> OutputDocumentPeer Is important call classes such as this was declared, for auto-loading reasons --- workflow/engine/classes/class.processes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index 039e4d293..1abad7803 100755 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -1597,8 +1597,8 @@ class Processes try { $aOutput = array (); $oCriteria = new Criteria( 'workflow' ); - $oCriteria->add( OutputdocumentPeer::PRO_UID, $sProUid ); - $oDataset = OutputdocumentPeer::doSelectRS( $oCriteria ); + $oCriteria->add( OutputDocumentPeer::PRO_UID, $sProUid ); + $oDataset = OutputDocumentPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); while ($aRow = $oDataset->getRow()) { From f6030e8ac70fcec73ff586de4ea98cb34c6a2eac Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Mon, 24 Mar 2014 16:40:01 -0400 Subject: [PATCH 11/17] Arreglo de conflictos --- .../engine/classes/model/ProcessCategory.php | 6 +++ .../engine/src/BusinessModel/Validator.php | 50 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/workflow/engine/classes/model/ProcessCategory.php b/workflow/engine/classes/model/ProcessCategory.php index c293374e3..b0de98507 100755 --- a/workflow/engine/classes/model/ProcessCategory.php +++ b/workflow/engine/classes/model/ProcessCategory.php @@ -54,5 +54,11 @@ class ProcessCategory extends BaseProcessCategory $aRow = $dataset->getRow(); return $aRow; } + + public function exists ($catUid) + { + $oProCat = ProcessCategoryPeer::retrieveByPk( $catUid ); + return (is_object( $oProCat ) && get_class( $oProCat ) == 'ProcessCategory'); + } } diff --git a/workflow/engine/src/BusinessModel/Validator.php b/workflow/engine/src/BusinessModel/Validator.php index 85324878e..de3b01f1c 100644 --- a/workflow/engine/src/BusinessModel/Validator.php +++ b/workflow/engine/src/BusinessModel/Validator.php @@ -171,6 +171,56 @@ class Validator{ return $tri_uid; } + /** + * Validate pro_uid + * + * @param string $pro_uid, Uid for process + * @param string $nameField . Name of field for message + * + * @access public + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return string + */ + static public function proUid($pro_uid, $nameField = 'pro_uid') + { + $pro_uid = trim($pro_uid); + if ($pro_uid == '') { + throw (new \Exception("The process with $nameField: '' does not exist.")); + } + $oProcess = new \Process(); + if (!($oProcess->exists($pro_uid))) { + throw (new \Exception("The process with $nameField: '$pro_uid' does not exist.")); + } + return $pro_uid; + } + + /** + * Validate cat_uid + * + * @param string $cat_uid, Uid for category + * @param string $nameField . Name of field for message + * + * @access public + * @author Brayan Pereyra (Cochalo) + * @copyright Colosa - Bolivia + * + * @return string + */ + static public function catUid($cat_uid, $nameField = 'cat_uid') + { + $cat_uid = trim($cat_uid); + if ($cat_uid == '') { + throw (new \Exception("The category with $nameField: '' does not exist.")); + } + $oCategory = new \ProcessCategory(); + if (!($oCategory->exists($cat_uid))) { + throw (new \Exception("The category with $nameField: '$cat_uid' does not exist.")); + } + return $cat_uid; + } + /** * Validate date * From 78ec8d82f6c44ec642ee8cc0ab6a41d82c813d4c Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Mon, 24 Mar 2014 16:45:26 -0400 Subject: [PATCH 12/17] Correccion de parametros en CASES LIST --- workflow/engine/src/BusinessModel/Cases.php | 71 +++++++- .../src/Services/Api/ProcessMaker/Cases.php | 172 +++++++++--------- 2 files changed, 149 insertions(+), 94 deletions(-) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index 121d1d833..81275f248 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -37,7 +37,7 @@ class Cases $dir = isset( $dataList["dir"] ) ? $dataList["dir"] : "DESC"; $sort = isset( $dataList["sort"] ) ? $dataList["sort"] : "APP_CACHE_VIEW.APP_NUMBER"; $start = isset( $dataList["start"] ) ? $dataList["start"] : "0"; - $limit = isset( $dataList["limit"] ) ? $dataList["limit"] : "25"; + $limit = isset( $dataList["limit"] ) ? $dataList["limit"] : "config"; $filter = isset( $dataList["filter"] ) ? $dataList["filter"] : ""; $process = isset( $dataList["process"] ) ? $dataList["process"] : ""; $category = isset( $dataList["category"] ) ? $dataList["category"] : ""; @@ -47,8 +47,8 @@ class Cases $action = isset( $dataList["action"] ) ? $dataList["action"] : "todo"; $paged = isset( $dataList["paged"] ) ? $dataList["paged"] : true; $type = "extjs"; - $dateFrom = isset( $dataList["dateFrom"] ) ? substr( $dataList["dateFrom"], 0, 10 ) : ""; - $dateTo = isset( $dataList["dateTo"] ) ? substr( $dataList["dateTo"], 0, 10 ) : ""; + $dateFrom = (!empty( $dataList["dateFrom"] )) ? substr( $dataList["dateFrom"], 0, 10 ) : ""; + $dateTo = (!empty( $dataList["dateTo"] )) ? substr( $dataList["dateTo"], 0, 10 ) : ""; $first = isset( $dataList["first"] ) ? true :false; $valuesCorrect = array('todo', 'draft', 'paused', 'sent', 'selfservice', 'unassigned', 'search'); @@ -56,6 +56,55 @@ class Cases throw (new \Exception('The value for $action is incorrect.')); } + $start = (int)$start; + $start = abs($start); + if ($start != 0) { + $start--; + } + if ($limit == 'config') { + G::LoadClass("configuration"); + $conf = new \Configurations(); + $generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', ''); + if (isset($generalConfCasesList['casesListRowNumber'])) { + $limit = (int)$generalConfCasesList['casesListRowNumber']; + } else { + $limit = 25; + } + } else { + $limit = (int)$limit; + } + if ($sort != 'APP_CACHE_VIEW.APP_NUMBER') { + $sort = G::toUpper($sort); + $columnsAppCacheView = \AppCacheViewPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME); + if (!(in_array($sort, $columnsAppCacheView))) { + $sort = 'APP_CACHE_VIEW.APP_NUMBER'; + } + } + $dir = G::toUpper($dir); + if (!($dir == 'DESC' || $dir == 'ASC')) { + $dir = 'DESC'; + } + if ($process != '') { + Validator::proUid($process, '$pro_uid'); + } + if ($category != '') { + Validator::catUid($category, '$cat_uid'); + } + $status = G::toUpper($status); + $listStatus = array('TODO', 'DRAFT', 'COMPLETED', 'CANCEL', 'OPEN', 'CLOSE'); + if (!(in_array($status, $listStatus))) { + $status = ''; + } + if ($user != '') { + Validator::usrUid($user, '$usr_uid'); + } + if ($dateFrom != '') { + Validator::isDate($dateFrom, 'Y-m-d', '$date_from'); + } + if ($dateTo != '') { + Validator::isDate($dateTo, 'Y-m-d', '$date_to'); + } + if ($action == 'search' || $action == 'to_reassign') { $userUid = ($user == "CURRENT_USER") ? $userUid : $user; if ($first) { @@ -139,13 +188,19 @@ class Cases } else { $result['total'] = $result['totalCount']; unset($result['totalCount']); - - $result['start'] = $start; + $result['start'] = $start+1; $result['limit'] = $limit; - $result['sort'] = $sort; - $result['category'] = $category; - $result['process'] = $process; + $result['sort'] = G::toLower($sort); + $result['dir'] = G::toLower($dir); + $result['cat_uid'] = $category; + $result['pro_uid'] = $process; $result['search'] = $search; + if ($action == 'search') { + $result['app_status'] = G::toLower($status); + $result['usr_uid'] = $user; + $result['date_from'] = $dateFrom; + $result['date_to'] = $dateTo; + } } return $result; } diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php index 03a0389ed..822c4e5af 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php @@ -22,8 +22,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -37,8 +37,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -51,8 +51,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -69,8 +69,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -84,8 +84,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -98,8 +98,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -116,8 +116,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -131,8 +131,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -145,8 +145,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -163,8 +163,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -178,8 +178,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -192,8 +192,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -210,8 +210,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -225,8 +225,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -239,8 +239,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -257,8 +257,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -272,8 +272,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -286,8 +286,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -304,8 +304,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -319,8 +319,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -333,8 +333,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -351,8 +351,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -366,8 +366,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -380,8 +380,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -398,8 +398,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -413,8 +413,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -427,8 +427,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -445,8 +445,8 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} * @param string $search {@from path} * @return array * @@ -460,8 +460,8 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', + $cat_uid = '', + $pro_uid = '', $search = '' ) { @@ -474,8 +474,8 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); @@ -492,9 +492,9 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} - * @param string $status {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} + * @param string $app_status {@from path} * @param string $user {@from path} * @param string $dateFrom {@from path} * @param string $dateTo {@from path} @@ -511,9 +511,9 @@ class Cases extends Api $limit = 25, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', - $status = '', + $cat_uid = '', + $pro_uid = '', + $app_status = '', $user = '', $dateFrom = '', $dateTo = '', @@ -529,9 +529,9 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; - $dataList['status'] = $status; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; + $dataList['status'] = $app_status; $dataList['user'] = $user; $dataList['dateFrom'] = $dateFrom; $dataList['dateTo'] = $dateTo; @@ -551,10 +551,10 @@ class Cases extends Api * @param string $start {@from path} * @param string $limit {@from path} * @param string $dir {@from path} - * @param string $category {@from path} - * @param string $process {@from path} - * @param string $status {@from path} - * @param string $user {@from path} + * @param string $cat_uid {@from path} + * @param string $pro_uid {@from path} + * @param string $app_status {@from path} + * @param string $usr_uid {@from path} * @param string $dateFrom {@from path} * @param string $dateTo {@from path} * @param string $search {@from path} @@ -567,15 +567,15 @@ class Cases extends Api */ public function doGetCasesListAdvancedSearchPaged( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', - $category = '', - $process = '', - $status = '', - $user = '', - $dateFrom = '', - $dateTo = '', + $cat_uid = '', + $pro_uid = '', + $app_status = '', + $usr_uid = '', + $date_from = '', + $date_to = '', $search = '' ) { @@ -588,12 +588,12 @@ class Cases extends Api $dataList['limit'] = $limit; $dataList['sort'] = $sort; $dataList['dir'] = $dir; - $dataList['category'] = $category; - $dataList['process'] = $process; - $dataList['status'] = $status; - $dataList['user'] = $user; - $dataList['dateFrom'] = $dateFrom; - $dataList['dateTo'] = $dateTo; + $dataList['category'] = $cat_uid; + $dataList['process'] = $pro_uid; + $dataList['status'] = $app_status; + $dataList['user'] = $usr_uid; + $dataList['dateFrom'] = $date_from; + $dataList['dateTo'] = $date_to; $dataList['search'] = $search; $oCases = new \BusinessModel\Cases(); $response = $oCases->getList($dataList); From 7bd9623f1af579dedcd5c977d3639623b437f4de Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Mon, 24 Mar 2014 16:59:03 -0400 Subject: [PATCH 13/17] Se agregan metodos para InputDocuments y OutputDocuments --- workflow/engine/src/BusinessModel/Cases.php | 229 +++++++++++++++++++- workflow/engine/src/Services/api.ini | 3 +- 2 files changed, 230 insertions(+), 2 deletions(-) diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index 81275f248..bcc76ad65 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -770,7 +770,6 @@ class Cases } } - /** * get all upload document that they have send it * @@ -1062,4 +1061,232 @@ class Cases $oCriteria->addDescendingOrderByColumn('CREATE_DATE'); return $oCriteria; } + + /* + * get all generate document + * + * @name getAllGeneratedDocumentsCriteria + * @param string $sProcessUID + * @param string $sApplicationUID + * @param string $sTasKUID + * @param string $sUserUID + * @return object + */ + public function getAllGeneratedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID) + { + \G::LoadClass("configuration"); + $conf = new \Configurations(); + $confEnvSetting = $conf->getFormats(); + //verifica si la tabla OBJECT_PERMISSION + $cases = new \cases(); + $cases->verifyTable(); + $listing = false; + $oPluginRegistry = & \PMPluginRegistry::getSingleton(); + if ($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) { + $folderData = new \folderData(null, null, $sApplicationUID, null, $sUserUID); + $folderData->PMType = "OUTPUT"; + $folderData->returnList = true; + //$oPluginRegistry = & PMPluginRegistry::getSingleton(); + $listing = $oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData); + } + $aObjectPermissions = $cases->getAllObjects($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID); + if (!is_array($aObjectPermissions)) { + $aObjectPermissions = array('DYNAFORMS' => array(-1),'INPUT_DOCUMENTS' => array(-1),'OUTPUT_DOCUMENTS' => array(-1)); + } + if (!isset($aObjectPermissions['DYNAFORMS'])) { + $aObjectPermissions['DYNAFORMS'] = array(-1); + } else { + if (!is_array($aObjectPermissions['DYNAFORMS'])) { + $aObjectPermissions['DYNAFORMS'] = array(-1); + } + } + if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) { + $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1); + } else { + if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) { + $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1); + } + } + if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) { + $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1); + } else { + if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) { + $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1); + } + } + $aDelete = $cases->getAllObjectsFrom($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID, 'DELETE'); + $oAppDocument = new \AppDocument(); + $oCriteria = new \Criteria('workflow'); + $oCriteria->add(\AppDocumentPeer::APP_UID, $sApplicationUID); + $oCriteria->add(\AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT'); + $oCriteria->add(\AppDocumentPeer::APP_DOC_STATUS, array('ACTIVE'), \Criteria::IN); + //$oCriteria->add(AppDocumentPeer::APP_DOC_UID, $aObjectPermissions['OUTPUT_DOCUMENTS'], Criteria::IN); + $oCriteria->add( + $oCriteria->getNewCriterion( + \AppDocumentPeer::APP_DOC_UID, $aObjectPermissions['OUTPUT_DOCUMENTS'], \Criteria::IN)->addOr($oCriteria->getNewCriterion(\AppDocumentPeer::USR_UID, $sUserUID, \Criteria::EQUAL)) + ); + $aConditions = array(); + $aConditions[] = array(\AppDocumentPeer::APP_UID, \AppDelegationPeer::APP_UID); + $aConditions[] = array(\AppDocumentPeer::DEL_INDEX, \AppDelegationPeer::DEL_INDEX); + $oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN); + $oCriteria->add(\AppDelegationPeer::PRO_UID, $sProcessUID); + $oCriteria->addAscendingOrderByColumn(\AppDocumentPeer::APP_DOC_INDEX); + $oDataset = \AppDocumentPeer::doSelectRS($oCriteria); + $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + $oDataset->next(); + $aOutputDocuments = array(); + $aOutputDocuments[] = array( + 'APP_DOC_UID' => 'char', + 'DOC_UID' => 'char', + 'APP_DOC_COMMENT' => 'char', + 'APP_DOC_FILENAME' => 'char', + 'APP_DOC_INDEX' => 'integer' + ); + $oUser = new \Users(); + while ($aRow = $oDataset->getRow()) { + $oCriteria2 = new \Criteria('workflow'); + $oCriteria2->add(\AppDelegationPeer::APP_UID, $sApplicationUID); + $oCriteria2->add(\AppDelegationPeer::DEL_INDEX, $aRow['DEL_INDEX']); + $oDataset2 = \AppDelegationPeer::doSelectRS($oCriteria2); + $oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + $oDataset2->next(); + $aRow2 = $oDataset2->getRow(); + $oTask = new \Task(); + if ($oTask->taskExists($aRow2['TAS_UID'])) { + $aTask = $oTask->load($aRow2['TAS_UID']); + } else { + $aTask = array('TAS_TITLE' => '(TASK DELETED)'); + } + $lastVersion = $oAppDocument->getLastDocVersion($aRow['DOC_UID'], $sApplicationUID); + if ($lastVersion == $aRow['DOC_VERSION']) { + //Only show last document Version + $aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']); + //Get output Document information + $oOutputDocument = new \OutputDocument(); + $aGields = $oOutputDocument->load($aRow['DOC_UID']); + //OUTPUTDOCUMENT + $outDocTitle = $aGields['OUT_DOC_TITLE']; + switch ($aGields['OUT_DOC_GENERATE']) { + //G::LoadTranslation(ID_DOWNLOAD) + case "PDF": + $fileDoc = 'javascript:alert("NO DOC")'; + $fileDocLabel = " "; + $filePdf = 'cases_ShowOutputDocument?a=' . + $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=pdf&random=' . rand(); + $filePdfLabel = ".pdf"; + if (is_array($listing)) { + foreach ($listing as $folderitem) { + if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "PDF")) { + $filePdfLabel = \G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .pdf"; + $filePdf = $folderitem->downloadScript; + continue; + } + } + } + break; + case "DOC": + $fileDoc = 'cases_ShowOutputDocument?a=' . + $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=doc&random=' . rand(); + $fileDocLabel = ".doc"; + $filePdf = 'javascript:alert("NO PDF")'; + $filePdfLabel = " "; + if (is_array($listing)) { + foreach ($listing as $folderitem) { + if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "DOC")) { + $fileDocLabel = \G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .doc"; + $fileDoc = $folderitem->downloadScript; + continue; + } + } + } + break; + case "BOTH": + $fileDoc = 'cases_ShowOutputDocument?a=' . + $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=doc&random=' . rand(); + $fileDocLabel = ".doc"; + if (is_array($listing)) { + foreach ($listing as $folderitem) { + if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "DOC")) { + $fileDocLabel = G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .doc"; + $fileDoc = $folderitem->downloadScript; + continue; + } + } + } + $filePdf = 'cases_ShowOutputDocument?a=' . + $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=pdf&random=' . rand(); + $filePdfLabel = ".pdf"; + + if (is_array($listing)) { + foreach ($listing as $folderitem) { + if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "PDF")) { + $filePdfLabel = \G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .pdf"; + $filePdf = $folderitem->downloadScript; + continue; + } + } + } + break; + } + try { + $aAux1 = $oUser->load($aAux['USR_UID']); + $sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]); + } catch (\Exception $oException) { + $sUser = '(USER DELETED)'; + } + //if both documents were generated, we choose the pdf one, only if doc was + //generate then choose the doc file. + $firstDocLink = $filePdf; + $firstDocLabel = $filePdfLabel; + if ($aGields['OUT_DOC_GENERATE'] == 'DOC') { + $firstDocLink = $fileDoc; + $firstDocLabel = $fileDocLabel; + } + $aFields = array( + 'APP_DOC_UID' => $aAux['APP_DOC_UID'], + 'DOC_UID' => $aAux['DOC_UID'], + 'APP_DOC_COMMENT' => $aAux['APP_DOC_COMMENT'], + 'APP_DOC_FILENAME' => $aAux['APP_DOC_FILENAME'], + 'APP_DOC_INDEX' => $aAux['APP_DOC_INDEX'], + 'ORIGIN' => $aTask['TAS_TITLE'], + 'CREATE_DATE' => $aAux['APP_DOC_CREATE_DATE'], + 'CREATED_BY' => $sUser, + 'FILEDOC' => $fileDoc, + 'FILEPDF' => $filePdf, + 'OUTDOCTITLE' => $outDocTitle, + 'DOC_VERSION' => $aAux['DOC_VERSION'], + 'TYPE' => $aAux['APP_DOC_TYPE'] . ' ' . $aGields['OUT_DOC_GENERATE'], + 'DOWNLOAD_LINK' => $firstDocLink, + 'DOWNLOAD_FILE' => $aAux['APP_DOC_FILENAME'] . $firstDocLabel + ); + if (trim($fileDocLabel) != '') { + $aFields['FILEDOCLABEL'] = $fileDocLabel; + } + if (trim($filePdfLabel) != '') { + $aFields['FILEPDFLABEL'] = $filePdfLabel; + } + if ($aFields['APP_DOC_FILENAME'] != '') { + $aFields['TITLE'] = $aFields['APP_DOC_FILENAME']; + } else { + $aFields['TITLE'] = $aFields['APP_DOC_COMMENT']; + } + //$aFields['POSITION'] = $_SESSION['STEP_POSITION']; + $aFields['CONFIRM'] = \G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT'); + if (in_array($aRow['APP_DOC_UID'], $aObjectPermissions['OUTPUT_DOCUMENTS'])) { + if (in_array($aRow['APP_DOC_UID'], $aDelete['OUTPUT_DOCUMENTS'])) { + $aFields['ID_DELETE'] = \G::LoadTranslation('ID_DELETE'); + } + } + $aOutputDocuments[] = $aFields; + } + $oDataset->next(); + } + global $_DBArray; + $_DBArray['outputDocuments'] = $aOutputDocuments; + \G::LoadClass('ArrayPeer'); + $oCriteria = new \Criteria('dbarray'); + $oCriteria->setDBArrayTable('outputDocuments'); + $oCriteria->addDescendingOrderByColumn('CREATE_DATE'); + return $oCriteria; + } } \ No newline at end of file diff --git a/workflow/engine/src/Services/api.ini b/workflow/engine/src/Services/api.ini index 5eed15c6e..1d9365fd5 100644 --- a/workflow/engine/src/Services/api.ini +++ b/workflow/engine/src/Services/api.ini @@ -64,4 +64,5 @@ debug = 1 [alias: cases] case = "Services\Api\ProcessMaker\Case" - input-document = "Services\Api\ProcessMaker\Cases\InputDocument" \ No newline at end of file + input-document = "Services\Api\ProcessMaker\Cases\InputDocument" + output-document = "Services\Api\ProcessMaker\Cases\OutputDocument" \ No newline at end of file From 71bbb46b57ded842ce7bf16a546a985abae41211 Mon Sep 17 00:00:00 2001 From: Wendy Nestor Date: Mon, 24 Mar 2014 17:02:28 -0400 Subject: [PATCH 14/17] Avance del feature cases list --- .../basic_sequence_cases_lists_1_6.feature | 296 +++++++- .../main_tests_cases_lists_1_6.feature | 639 +++++++++++++++++- 2 files changed, 933 insertions(+), 2 deletions(-) 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 index 683d54cf7..ef951e6e7 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/basic_sequence_cases_lists_1_6.feature @@ -15,6 +15,55 @@ Scenario: Returns a list of the cases for the logged in user (Inbox) And the response has 1 records +Scenario: Get paging of list inbox + Given I request "cases/paged" + 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 "array" + And the response has 1 records + + +Scenario: Get order type of Descending + Given I request "cases?dir=DESC" + 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 "array" + + +Scenario: Get order type of Acending + Given I request "cases?dir=ASC" + 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 "array" + + +Scenario: Get order type of Process Category + Given I request "cases?category=4177095085330818c324501061677193" + 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 "array" + + +Scenario: Get order type of Process + Given I request "cases?process=99209594750ec27ea338927000421575" + 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 "array" + + +Scenario: Get order type of Search + Given I request "cases?search=92535130653271a60de2e73021469732" + 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 "array" + + 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 @@ -23,6 +72,55 @@ Scenario: Returns a list of the cases for the logged in user (Draft) And the response has 1 records +Scenario: Get paging of list Draft + Given I request "cases/draft/paged" + 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 "array" + And the response has 1 records + + +Scenario: Get order type of Descending + Given I request "cases/draft?dir=DESC" + 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 "array" + + +Scenario: Get order type of Acending + Given I request "cases/draft?dir=ASC" + 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 "array" + + +Scenario: Get order type of Process Category + Given I request "cases/draft?category=4177095085330818c324501061677193" + 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 "array" + + +Scenario: Get order type of Process + Given I request "cases/draft?process=99209594750ec27ea338927000421575" + 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 "array" + + +Scenario: Get order type of Search + Given I request "cases/draft?search=92535130653271a60de2e73021469732" + 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 "array" + + 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 @@ -31,6 +129,55 @@ Scenario: Returns a list of the cases for the logged in user (Participated) And the response has 6 records +Scenario: Get paging of list Participated + Given I request "cases/participated/paged" + 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 "array" + And the response has 1 records + + +Scenario: Get order type of Descending + Given I request "cases/participated?dir=DESC" + 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 "array" + + +Scenario: Get order type of Acending + Given I request "cases/participated?dir=ASC" + 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 "array" + + +Scenario: Get order type of Process Category + Given I request "cases/participated?category=4177095085330818c324501061677193" + 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 "array" + + +Scenario: Get order type of Process + Given I request "cases/participated?process=99209594750ec27ea338927000421575" + 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 "array" + + +Scenario: Get order type of Search + Given I request "cases/participated?search=92535130653271a60de2e73021469732" + 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 "array" + + 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 @@ -39,6 +186,55 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned) And the response has 1 records +Scenario: Get paging of list Unassigned + Given I request "cases/unassigned/paged" + 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 "array" + And the response has 1 records + + +Scenario: Get order type of Descending + Given I request "cases/unassigned?dir=DESC" + 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 "array" + + +Scenario: Get order type of Acending + Given I request "cases/unassigned?dir=ASC" + 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 "array" + + +Scenario: Get order type of Process Category + Given I request "cases/unassigned?category=4177095085330818c324501061677193" + 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 "array" + + +Scenario: Get order type of Process + Given I request "cases/unassigned?process=99209594750ec27ea338927000421575" + 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 "array" + + +Scenario: Get order type of Search + Given I request "cases/unassigned?search=92535130653271a60de2e73021469732" + 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 "array" + + 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 @@ -47,9 +243,107 @@ Scenario: Returns a list of the cases for the logged in user (Paused) And the response has 1 records +Scenario: Get paging of list Paused + Given I request "cases/paused/paged" + 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 "array" + And the response has 1 records + + +Scenario: Get order type of Descending + Given I request "cases/paused?dir=DESC" + 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 "array" + + +Scenario: Get order type of Acending + Given I request "cases/paused?dir=ASC" + 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 "array" + + +Scenario: Get order type of Process Category + Given I request "cases/paused?category=4177095085330818c324501061677193" + 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 "array" + + +Scenario: Get order type of Process + Given I request "cases/paused?process=99209594750ec27ea338927000421575" + 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 "array" + + +Scenario: Get order type of Search + Given I request "cases/paused?search=92535130653271a60de2e73021469732" + 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 "array" + + Scenario: Returns a list of the cases for the logged in user (Advanced Search) Given I request "cases/advanced-search" 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 \ No newline at end of file + And the response has 1 records + + +Scenario: Get paging of list Advanced Search + Given I request "cases/advanced-search/paged" + 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 "array" + And the response has 1 records + + +Scenario: Get order type of Descending + Given I request "cases/advanced-search?dir=DESC" + 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 "array" + + +Scenario: Get order type of Acending + Given I request "cases/advanced-search?dir=ASC" + 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 "array" + + +Scenario: Get order type of Process Category + Given I request "cases/advanced-search?category=4177095085330818c324501061677193" + 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 "array" + + +Scenario: Get order type of Process + Given I request "cases/advanced-search?process=99209594750ec27ea338927000421575" + 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 "array" + + +Scenario: Get order type of Search + Given I request "cases/advanced-search?search=92535130653271a60de2e73021469732" + 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 "array" \ No newline at end of file diff --git a/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature b/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature index 683d54cf7..7d53eed58 100644 --- a/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature +++ b/features/backend/application_cases/cases_lists_1-6/main_tests_cases_lists_1_6.feature @@ -15,6 +15,103 @@ Scenario: Returns a list of the cases for the logged in user (Inbox) And the response has 1 records +Scenario Outline: Get paging of list inbox + Given I request "cases/paged?Start=&limit=" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And the response has records + + Examples: + + | test_description | start | limit | records | http_code | type | + | lowercase in Start | a | 1 | | 200 | array | + | uppercase in Start | A | 1 | | 200 | array | + | lowercase in Limit | 1 | a | | 200 | array | + | uppercase in Limit | 1 | A | | 200 | array | + | limit=3 | 1 | 3 | | 200 | array | + | start=3 | 3 | 3 | | 200 | array | + | limit and start =3 | 3 | 3 | | 200 | array | + | high number for start | 1000 | 1 | | 200 | array | + | high number for start | 1000 | 0 | | 200 | array | + | empty result | 1 | 0 | | 200 | array | + | empty string | 1 | 10000 | | 200 | array | + | invalid start | b | 25 | | 400 | string | + | invalid limit | 1 | c | | 400 | string | + | start equals zero | 0 | 20 | | 400 | string | + | search 0 | 0 | 0 | | 200 | array | + | search 0 | 0 | 100 | | 200 | array | + | negative numbers in start | -10 | 25 | | 400 | string | + | negative numbers in limit | 1 | -25 | | 400 | string | + | real numbers | 0.0 | 1.0 | | 200 | string | + | real numbers in start | 0.0 | 25 | | 200 | string | + | real numbers in limit | 1 | 1.4599 | | 400 | string | + | only start | 1 | | | 400 | string | + | only limit | | 25 | | 400 | string | + | without start and limit | | | | 400 | string | + + +Scenario Outline: Get order type of Descending and Acending + Given I request "cases?dir=" + 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 "array" + And the response has records + +Examples: + + | test_description | dir | records | + | Order for Acending | asc | | + | Order for Descending | desc | | + + +Scenario Outline: Get order type of Process Category + Given I request "cases?cat_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | cat_uid | records | + | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | + | Filter all categories | | | + + +Scenario Outline: Get order type of Process + Given I request "cases?pro_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | pro_uid | records | + | Filter for cases "Derivation rules - sequential" | 99209594750ec27ea338927000421575 | | + | Filter all cases | | | + + +Scenario Outline: Get order type of Search of number the process + Given I request "cases?search=" + 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 "array" + And the response has records + +Examples: + + | test_description | search | records | + | Filter for cases "Derivation rules - Parallel -> Case number 6" | 92535130653271a60de2e73021469732 | | + | Filter all cases | | | + + 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 @@ -23,6 +120,104 @@ Scenario: Returns a list of the cases for the logged in user (Draft) And the response has 1 records +Scenario Outline: Get paging of list Draft + Given I request "cases/draft/paged?Start=&limit=" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And the response has records + + Examples: + + | test_description | start | limit | records | http_code | type | + | lowercase in Start | a | 1 | | 200 | array | + | uppercase in Start | A | 1 | | 200 | array | + | lowercase in Limit | 1 | a | | 200 | array | + | uppercase in Limit | 1 | A | | 200 | array | + | limit=3 | 1 | 3 | | 200 | array | + | start=3 | 3 | 3 | | 200 | array | + | limit and start =3 | 3 | 3 | | 200 | array | + | high number for start | 1000 | 1 | | 200 | array | + | high number for start | 1000 | 0 | | 200 | array | + | empty result | 1 | 0 | | 200 | array | + | empty string | 1 | 10000 | | 200 | array | + | invalid start | b | 25 | | 400 | string | + | invalid limit | 1 | c | | 400 | string | + | start equals zero | 0 | 20 | | 400 | string | + | search 0 | 0 | 0 | | 200 | array | + | search 0 | 0 | 100 | | 200 | array | + | negative numbers in start | -10 | 25 | | 400 | string | + | negative numbers in limit | 1 | -25 | | 400 | string | + | real numbers | 0.0 | 1.0 | | 200 | string | + | real numbers in start | 0.0 | 25 | | 200 | string | + | real numbers in limit | 1 | 1.4599 | | 400 | string | + | only start | 1 | | | 400 | string | + | only limit | | 25 | | 400 | string | + | without start and limit | | | | 400 | string | + + +Scenario Outline: Get order type of Descending and Ascending + Given I request "cases/draft?dir=" + 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 "array" + And the response has records + +Examples: + + | test_description | dir | records | + | Order for Acending | asc | | + | Order for Descending | desc | | + + + +Scenario Outline: Get order type of Process Category + Given I request "cases/draft?cat_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | cat_uid | records | + | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | + | Filter all categories | | | + + +Scenario Outline: Get order type of Process + Given I request "cases/draft?pro_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | pro_uid | records | + | Filter for cases "Derivation rules - sequential" | 99209594750ec27ea338927000421575 | | + | Filter all cases | | | + + +Scenario Outline: Get order type of Search of the process + Given I request "cases/draft?search=" + 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 "array" + And the response has records + +Examples: + + | test_description | search | records | + | Filter for cases "Derivation rules - Parallel -> Case number 6" | 92535130653271a60de2e73021469732 | | + | Filter all cases | | | + + 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 @@ -31,6 +226,105 @@ Scenario: Returns a list of the cases for the logged in user (Participated) And the response has 6 records +Scenario Outline: Get paging of list Participated + Given I request "cases/participated/paged?Start=&limit=" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And the response has records + + Examples: + + | test_description | start | limit | records | http_code | type | + | lowercase in Start | a | 1 | | 200 | array | + | uppercase in Start | A | 1 | | 200 | array | + | lowercase in Limit | 1 | a | | 200 | array | + | uppercase in Limit | 1 | A | | 200 | array | + | limit=3 | 1 | 3 | | 200 | array | + | start=3 | 3 | 3 | | 200 | array | + | limit and start =3 | 3 | 3 | | 200 | array | + | high number for start | 1000 | 1 | | 200 | array | + | high number for start | 1000 | 0 | | 200 | array | + | empty result | 1 | 0 | | 200 | array | + | empty string | 1 | 10000 | | 200 | array | + | invalid start | b | 25 | | 400 | string | + | invalid limit | 1 | c | | 400 | string | + | start equals zero | 0 | 20 | | 400 | string | + | search 0 | 0 | 0 | | 200 | array | + | search 0 | 0 | 100 | | 200 | array | + | negative numbers in start | -10 | 25 | | 400 | string | + | negative numbers in limit | 1 | -25 | | 400 | string | + | real numbers | 0.0 | 1.0 | | 200 | string | + | real numbers in start | 0.0 | 25 | | 200 | string | + | real numbers in limit | 1 | 1.4599 | | 400 | string | + | only start | 1 | | | 400 | string | + | only limit | | 25 | | 400 | string | + | without start and limit | | | | 400 | string | + + +Scenario Outline: Get order type of Descending an Descending + Given I request "cases/participated?dir=" + 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 "array" + And the response has records + +Examples: + + | test_description | dir | records | + | Order for Acending | asc | | + | Order for Descending | desc | | + + + +Scenario Outline: Get order type of Process Category + Given I request "cases/participated?cat_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | cat_uid | records | + | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | + | Filter all categories | | | + + +Scenario Outline: Get order type of Process + Given I request "cases/participated?pro_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | pro_uid | records | + | Filter for cases "Derivation rules - sequential" | 99209594750ec27ea338927000421575 | | + | Filter all cases | | | + + + +Scenario Outline: Get order type of Search + Given I request "cases/participated?search=" + 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 "array" + And the response has records + +Examples: + + | test_description | search | records | + | Filter for cases "Derivation rules - Parallel -> Case number 6" | 92535130653271a60de2e73021469732 | | + | Filter all cases | | | + + 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 @@ -39,6 +333,104 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned) And the response has 1 records +Scenario Outline: Get paging of list Unassigned + Given I request "cases/Unassigned/paged?Start=&limit=" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And the response has records + + Examples: + + | test_description | start | limit | records | http_code | type | + | lowercase in Start | a | 1 | | 200 | array | + | uppercase in Start | A | 1 | | 200 | array | + | lowercase in Limit | 1 | a | | 200 | array | + | uppercase in Limit | 1 | A | | 200 | array | + | limit=3 | 1 | 3 | | 200 | array | + | start=3 | 3 | 3 | | 200 | array | + | limit and start =3 | 3 | 3 | | 200 | array | + | high number for start | 1000 | 1 | | 200 | array | + | high number for start | 1000 | 0 | | 200 | array | + | empty result | 1 | 0 | | 200 | array | + | empty string | 1 | 10000 | | 200 | array | + | invalid start | b | 25 | | 400 | string | + | invalid limit | 1 | c | | 400 | string | + | start equals zero | 0 | 20 | | 400 | string | + | search 0 | 0 | 0 | | 200 | array | + | search 0 | 0 | 100 | | 200 | array | + | negative numbers in start | -10 | 25 | | 400 | string | + | negative numbers in limit | 1 | -25 | | 400 | string | + | real numbers | 0.0 | 1.0 | | 200 | string | + | real numbers in start | 0.0 | 25 | | 200 | string | + | real numbers in limit | 1 | 1.4599 | | 400 | string | + | only start | 1 | | | 400 | string | + | only limit | | 25 | | 400 | string | + | without start and limit | | | | 400 | string | + + +Scenario Outline: Get order type of Descending and Acending + Given I request "cases/unassigned?dir=" + 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 "array" + And the response has records + +Examples: + + | test_description | dir | records | + | Order for Acending | asc | | + | Order for Descending | desc | | + + +Scenario Outline: Get order type of Process Category + Given I request "cases/unassigned?cat_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | cat_uid | records | + | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | + | Filter all categories | | | + + +Scenario Outline: Get order type of Process + Given I request "cases/unassigned?pro_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | pro_uid | records | + | Filter for cases "Derivation rules - sequential" | 99209594750ec27ea338927000421575 | | + | Filter all cases | | | + + +Scenario Outline: Get order type of Search + Given I request "cases/unassigned?search=" + 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 "array" + And the response has records + +Examples: + + | test_description | search | records | + | Filter for cases "Derivation rules - Parallel -> Case number 6" | 92535130653271a60de2e73021469732 | | + | Filter all cases | | | + + + 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 @@ -47,9 +439,254 @@ Scenario: Returns a list of the cases for the logged in user (Paused) And the response has 1 records +Scenario Outline: Get paging of list Paused + Given I request "cases/paused/paged?Start=&limit=" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And the response has records + + Examples: + + | test_description | start | limit | records | http_code | type | + | lowercase in Start | a | 1 | | 200 | array | + | uppercase in Start | A | 1 | | 200 | array | + | lowercase in Limit | 1 | a | | 200 | array | + | uppercase in Limit | 1 | A | | 200 | array | + | limit=3 | 1 | 3 | | 200 | array | + | start=3 | 3 | 3 | | 200 | array | + | limit and start =3 | 3 | 3 | | 200 | array | + | high number for start | 1000 | 1 | | 200 | array | + | high number for start | 1000 | 0 | | 200 | array | + | empty result | 1 | 0 | | 200 | array | + | empty string | 1 | 10000 | | 200 | array | + | invalid start | b | 25 | | 400 | string | + | invalid limit | 1 | c | | 400 | string | + | start equals zero | 0 | 20 | | 400 | string | + | search 0 | 0 | 0 | | 200 | array | + | search 0 | 0 | 100 | | 200 | array | + | negative numbers in start | -10 | 25 | | 400 | string | + | negative numbers in limit | 1 | -25 | | 400 | string | + | real numbers | 0.0 | 1.0 | | 200 | string | + | real numbers in start | 0.0 | 25 | | 200 | string | + | real numbers in limit | 1 | 1.4599 | | 400 | string | + | only start | 1 | | | 400 | string | + | only limit | | 25 | | 400 | string | + | without start and limit | | | | 400 | string | + + +Scenario Outline: Get order type of Descending and Acending + Given I request "cases/paused?dir=" + 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 "array" + And the response has records + +Examples: + + | test_description | dir | records | + | Order for Acending | asc | | + | Order for Descending | desc | | + + +Scenario Outline: Get order type of Process Category + Given I request "cases/paused?cat_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | cat_uid | records | + | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | + | Filter all categories | | | + + +Scenario Outline: Get order type of Process + Given I request "cases/paused?pro_uid=" + 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 "array" + And the response has records + +Examples: + + | test_description | pro_uid | records | + | Filter for cases "Derivation rules - sequential" | 99209594750ec27ea338927000421575 | | + | Filter all cases | | | + + +Scenario Outline: Get order type of Search + Given I request "cases/paused?search=" + 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 "array" + And the response has records + +Examples: + + | test_description | search | records | + | Filter for cases "Derivation rules - Parallel -> Case number 6" | 92535130653271a60de2e73021469732 | | + | Filter all cases | | | + + Scenario: Returns a list of the cases for the logged in user (Advanced Search) Given I request "cases/advanced-search" 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 \ No newline at end of file + And the response has 1 records + + +Scenario Outline: Get paging of list Advanced Search + Given I request "cases/advanced-search/paged?Start=&limit=" + Then the response status code should be + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "" + And the response has records + + Examples: + + | test_description | start | limit | records | http_code | type | + | lowercase in Start | a | 1 | | 200 | array | + | uppercase in Start | A | 1 | | 200 | array | + | lowercase in Limit | 1 | a | | 200 | array | + | uppercase in Limit | 1 | A | | 200 | array | + | limit=3 | 1 | 3 | | 200 | array | + | start=3 | 3 | 3 | | 200 | array | + | limit and start =3 | 3 | 3 | | 200 | array | + | high number for start | 1000 | 1 | | 200 | array | + | high number for start | 1000 | 0 | | 200 | array | + | empty result | 1 | 0 | | 200 | array | + | empty string | 1 | 10000 | | 200 | array | + | invalid start | b | 25 | | 400 | string | + | invalid limit | 1 | c | | 400 | string | + | start equals zero | 0 | 20 | | 400 | string | + | search 0 | 0 | 0 | | 200 | array | + | search 0 | 0 | 100 | | 200 | array | + | negative numbers in start | -10 | 25 | | 400 | string | + | negative numbers in limit | 1 | -25 | | 400 | string | + | real numbers | 0.0 | 1.0 | | 200 | string | + | real numbers in start | 0.0 | 25 | | 200 | string | + | real numbers in limit | 1 | 1.4599 | | 400 | string | + | only start | 1 | | | 400 | string | + | only limit | | 25 | | 400 | string | + | without start and limit | | | | 400 | string | + + +Scenario Outline: Get order type of Descending and Acending + Given I request "cases/advanced-search?dir=" + 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 "array" + And the response has records + + Examples: + + | test_description | dir | records | + | Order for Acending | asc | | + | Order for Descending | desc | | + + +Scenario Outline: Get order type of Process Category + Given I request "cases/advanced-search?cat_uid=" + 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 "array" + And the response has records + + Examples: + + | test_description | cat_uid | records | + | Filter for Category "Category Cases Lists" | 4177095085330818c324501061677193 | | + | Filter all categories | | | + + + +Scenario Outline: Get order type of Process + Given I request "cases/advanced-search?pro_uid=" + 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 "array" + And the response has records + + Examples: + + | test_description | pro_uid | records | + | Filter for cases "Derivation rules - sequential" | 99209594750ec27ea338927000421575 | | + | Filter all cases | | | + + + +Scenario Outline: Get order type of Search + Given I request "cases/advanced-search?search=" + 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 "array" + And the response has records + + Examples: + + | test_description | search | records | + | Filter for cases "Derivation rules - Parallel -> Case number 6" | 92535130653271a60de2e73021469732 | | + | Filter all cases | | | + + +Scenario Outline: Get order for Status + Given I request "cases/advanced-search?app_status=" + 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 "array" + And the response has records + + Examples: + + | test_description | app_status | records | + | Filter Status = All Status | | | + | Filter Status = Completed | COMPLETED | | + | Filter Status = Draft | DRAFT | | + | Filter Status = To Do | TO_DO | | + + +Scenario Outline: Get order for User + Given I request "cases/advanced-search?usr_uid=" + 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 "array" + And the response has records + + Examples: + + | test_description | usr_uid | records | + | Filter Status = All User | | | + | Filter Status = aaron | 51049032352d56710347233042615067 | | + | Filter Status = admin | 00000000000000000000000000000001 | | + | Filter Status = chris | 24166330352d56730cdd525035621101 | | + + +Scenario Outline: Get order for date + Given I request "cases/advanced-search?date_from=&date_to=" + 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 "array" + And the response has records + + Examples: + + | test_description | date_from | date_to | records | + | Filter date = 2014-03-01 | 2014-03-01 | 2014-03-20 | | + | Filter date = 2014-03-15 | 2014-03-15 | 2014-03-20 | | \ No newline at end of file From 16b42af67177d8dd45601c58ba06c22ae86b4c09 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Mon, 24 Mar 2014 17:03:13 -0400 Subject: [PATCH 15/17] Se agregan metodos para InputDocuments y OutputDocuments --- .../src/BusinessModel/Cases/InputDocument.php | 234 ++++++++++++++++++ .../BusinessModel/Cases/OutputDocument.php | 230 +++++++++++++++++ .../Api/ProcessMaker/Cases/InputDocument.php | 83 +++++++ .../Api/ProcessMaker/Cases/OutputDocument.php | 81 ++++++ 4 files changed, 628 insertions(+) create mode 100644 workflow/engine/src/BusinessModel/Cases/InputDocument.php create mode 100644 workflow/engine/src/BusinessModel/Cases/OutputDocument.php create mode 100644 workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php create mode 100644 workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php diff --git a/workflow/engine/src/BusinessModel/Cases/InputDocument.php b/workflow/engine/src/BusinessModel/Cases/InputDocument.php new file mode 100644 index 000000000..bdbae4943 --- /dev/null +++ b/workflow/engine/src/BusinessModel/Cases/InputDocument.php @@ -0,0 +1,234 @@ +loadCase( $sApplicationUID ); + $sProcessUID = $fields['PRO_UID']; + $sTaskUID = ''; + $oCaseRest = new \BusinessModel\Cases(); + $oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID); + $result = array (); + global $_DBArray; + foreach ($_DBArray['inputDocuments'] as $key => $row) { + if (isset( $row['DOC_VERSION'] )) { + $docrow = array (); + $docrow['app_doc_uid'] = $row['APP_DOC_UID']; + $docrow['app_doc_filename'] = $row['APP_DOC_FILENAME']; + $docrow['doc_uid'] = $row['DOC_UID']; + $docrow['app_doc_version'] = $row['DOC_VERSION']; + $docrow['app_doc_create_date'] = $row['CREATE_DATE']; + $docrow['app_doc_create_user'] = $row['CREATED_BY']; + $docrow['app_doc_type'] = $row['TYPE']; + $docrow['app_doc_index'] = $row['APP_DOC_INDEX']; + $docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK']; + $result[] = $docrow; + } + } + return $result; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get data of Cases InputDocument + * + * @param string $caseUid + * @param string $userUid + * @param string $inputDocumentUid + * + * return array Return an array with data of an InputDocument + */ + public function getCasesInputDocument($caseUid, $userUid, $inputDocumentUid) + { + try { + $sApplicationUID = $caseUid; + $sUserUID = $userUid; + \G::LoadClass('case'); + $oCase = new \Cases(); + $fields = $oCase->loadCase( $sApplicationUID ); + $sProcessUID = $fields['PRO_UID']; + $sTaskUID = ''; + $oCaseRest = new \BusinessModel\Cases(); + $oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); + $result = array (); + global $_DBArray; + foreach ($_DBArray['inputDocuments'] as $key => $row) { + if (isset( $row['DOC_VERSION'] )) { + $docrow = array (); + $docrow['app_doc_uid'] = $row['APP_DOC_UID']; + $docrow['app_doc_filename'] = $row['APP_DOC_FILENAME']; + $docrow['doc_uid'] = $row['DOC_UID']; + $docrow['app_doc_version'] = $row['DOC_VERSION']; + $docrow['app_doc_create_date'] = $row['CREATE_DATE']; + $docrow['app_doc_create_user'] = $row['CREATED_BY']; + $docrow['app_doc_type'] = $row['TYPE']; + $docrow['app_doc_index'] = $row['APP_DOC_INDEX']; + $docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK']; + if ($docrow['app_doc_uid'] == $inputDocumentUid) { + $result = $docrow; + } + } + } + return $result; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Delete InputDocument + * + * @param string $inputDocumentUid + * + * return array Return an array with data of an InputDocument + */ + public function removeInputDocument($inputDocumentUid) + { + try { + $oAppDocument = \AppDocumentPeer::retrieveByPK( $inputDocumentUid, 1 ); + if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') { + throw (new \Exception('This row doesn\'t exist!')); + } + \G::LoadClass('wsBase'); + $ws = new \wsBase(); + $ws->removeDocument($inputDocumentUid); + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get data of Cases InputDocument + * + * @param string $caseUid + * @param string $inputDocumentUid + * @param string $userUid + * + * return array Return an array with data of an InputDocument + */ + public function addCasesInputDocument($caseUid, $inputDocumentUid, $userUid) + { + try { + if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME'] != 0)) { + $code = $_FILES['form']['error']['APP_DOC_FILENAME']; + switch ($code) { + case UPLOAD_ERR_INI_SIZE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' ); + break; + case UPLOAD_ERR_FORM_SIZE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' ); + break; + case UPLOAD_ERR_PARTIAL: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' ); + break; + case UPLOAD_ERR_NO_FILE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' ); + break; + case UPLOAD_ERR_NO_TMP_DIR: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' ); + break; + case UPLOAD_ERR_CANT_WRITE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' ); + break; + case UPLOAD_ERR_EXTENSION: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' ); + break; + default: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' ); + break; + } + \G::SendMessageText( $message, "ERROR" ); + $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] ); + \G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] ); + die(); + } + + \G::LoadClass("case"); + + //$inputDocumentUid = $_GET["UID"]; //$_POST["form"]["DOC_UID"] + $appDocUid = ''; + //$appDocUid = $_POST["form"]["APP_DOC_UID"]; + $docVersion = ''; + //$docVersion = intval($_POST["form"]["docVersion"]); + $appDocType = 'INPUT'; + //$appDocType = $_POST["form"]["APP_DOC_TYPE"]; + $appDocComment = (isset($_POST["form"]["APP_DOC_COMMENT"]))? $_POST["form"]["APP_DOC_COMMENT"] : ""; + $actionType = $_POST["form"]["actionType"]; + + $case = new \Cases(); + $case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs"); + + //Load the fields + $arrayField = $case->loadCase($_SESSION["APPLICATION"]); + $arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], \G::getSystemConstants()); + + //Triggers + $arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $inputDocumentUid, "AFTER"); + + + //Add Input Document + if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) { + $appDocUid = $case->addInputDocument( + $inputDocumentUid, + $appDocUid, + $docVersion, + $appDocType, + $appDocComment, + $actionType, + $_SESSION["APPLICATION"], + $_SESSION["INDEX"], + $_SESSION["TASK"], + $_SESSION["USER_LOGGED"], + "xmlform", + $_FILES["form"]["name"]["APP_DOC_FILENAME"], + $_FILES["form"]["error"]["APP_DOC_FILENAME"], + $_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] + ); + } + + if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) { + //Trigger - Execute after - Start + $arrayField["APP_DATA"] = $case->executeTriggers( + $_SESSION["TASK"], + "INPUT_DOCUMENT", + $inputDocumentUid, + "AFTER", + $arrayField["APP_DATA"] + ); + //Trigger - Execute after - End + } + + //Save data + $arrayData = array(); + $arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"]; + //$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"]; + $arrayData["APP_DATA"] = $arrayField["APP_DATA"]; + $arrayData["DEL_INDEX"] = $_SESSION["INDEX"]; + $arrayData["TAS_UID"] = $_SESSION["TASK"]; + + $case->updateCase($_SESSION["APPLICATION"], $arrayData); + + } catch (\Exception $e) { + throw $e; + } + } + +} + diff --git a/workflow/engine/src/BusinessModel/Cases/OutputDocument.php b/workflow/engine/src/BusinessModel/Cases/OutputDocument.php new file mode 100644 index 000000000..4653d8d4c --- /dev/null +++ b/workflow/engine/src/BusinessModel/Cases/OutputDocument.php @@ -0,0 +1,230 @@ +loadCase( $caseUid ); + $sProcessUID = $fields['PRO_UID']; + $sTaskUID = ''; + $oCriteria = new \BusinessModel\Cases(); + $oCriteria->getAllGeneratedDocumentsCriteria( $sProcessUID, $caseUid, $sTaskUID, $userUid); + $result = array (); + global $_DBArray; + foreach ($_DBArray['outputDocuments'] as $key => $row) { + if (isset( $row['DOC_VERSION'] )) { + $docrow = array (); + $docrow['app_doc_uid'] = $row['APP_DOC_UID']; + $docrow['app_doc_filename'] = $row['DOWNLOAD_FILE']; + $docrow['doc_uid'] = $row['DOC_UID']; + $docrow['app_doc_version'] = $row['DOC_VERSION']; + $docrow['app_doc_create_date'] = $row['CREATE_DATE']; + $docrow['app_doc_create_user'] = $row['CREATED_BY']; + $docrow['app_doc_type'] = $row['TYPE']; + $docrow['app_doc_index'] = $row['APP_DOC_INDEX']; + $docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK']; + $result[] = $docrow; + } + } + return $result; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get data of Cases OutputDocument + * + * @param string $caseUid + * @param string $userUid + * @param string $outputDocumentUid + * + * return array Return an array with data of an OutputDocument + */ + public function getCasesOutputDocument($caseUid, $userUid, $outputDocumentUid) + { + try { + $sApplicationUID = $caseUid; + $sUserUID = $userUid; + \G::LoadClass('case'); + $oCase = new \Cases(); + $fields = $oCase->loadCase( $sApplicationUID ); + $sProcessUID = $fields['PRO_UID']; + $sTaskUID = ''; + $oCaseRest = new \BusinessModel\Cases(); + $oCaseRest->getAllGeneratedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); + $result = array (); + global $_DBArray; + foreach ($_DBArray['outputDocuments'] as $key => $row) { + if (isset( $row['DOC_VERSION'] )) { + $docrow = array (); + $docrow['app_doc_uid'] = $row['APP_DOC_UID']; + $docrow['app_doc_filename'] = $row['DOWNLOAD_FILE']; + $docrow['doc_uid'] = $row['DOC_UID']; + $docrow['app_doc_version'] = $row['DOC_VERSION']; + $docrow['app_doc_create_date'] = $row['CREATE_DATE']; + $docrow['app_doc_create_user'] = $row['CREATED_BY']; + $docrow['app_doc_type'] = $row['TYPE']; + $docrow['app_doc_index'] = $row['APP_DOC_INDEX']; + $docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK']; + if ($docrow['app_doc_uid'] == $outputDocumentUid) { + $result = $docrow; + } + } + } + return $result; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Delete OutputDocument + * + * @param string $outputDocumentUid + * + * return array Return an array with data of an OutputDocument + */ + public function removeOutputDocument($outputDocumentUid) + { + try { + $oAppDocument = \AppDocumentPeer::retrieveByPK( $outputDocumentUid, 1 ); + if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') { + throw (new \Exception('This row doesn\'t exist!')); + } + \G::LoadClass('wsBase'); + $ws = new \wsBase(); + $ws->removeDocument($outputDocumentUid); + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get data of Cases OutputDocument + * + * @param string $caseUid + * @param string $outputDocumentUid + * @param string $userUid + * + * return array Return an array with data of an OutputDocument + */ + public function addCasesOutputDocument($caseUid, $outputDocumentUid, $userUid) + { + try { + if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME'] != 0)) { + $code = $_FILES['form']['error']['APP_DOC_FILENAME']; + switch ($code) { + case UPLOAD_ERR_INI_SIZE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' ); + break; + case UPLOAD_ERR_FORM_SIZE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' ); + break; + case UPLOAD_ERR_PARTIAL: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' ); + break; + case UPLOAD_ERR_NO_FILE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' ); + break; + case UPLOAD_ERR_NO_TMP_DIR: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' ); + break; + case UPLOAD_ERR_CANT_WRITE: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' ); + break; + case UPLOAD_ERR_EXTENSION: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' ); + break; + default: + $message = \G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' ); + break; + } + \G::SendMessageText( $message, "ERROR" ); + $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] ); + \G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] ); + die(); + } + + \G::LoadClass("case"); + + //$inputDocumentUid = $_GET["UID"]; //$_POST["form"]["DOC_UID"] + $appDocUid = ''; + //$appDocUid = $_POST["form"]["APP_DOC_UID"]; + $docVersion = ''; + //$docVersion = intval($_POST["form"]["docVersion"]); + $appDocType = 'INPUT'; + //$appDocType = $_POST["form"]["APP_DOC_TYPE"]; + $appDocComment = (isset($_POST["form"]["APP_DOC_COMMENT"]))? $_POST["form"]["APP_DOC_COMMENT"] : ""; + $actionType = $_POST["form"]["actionType"]; + + $case = new \Cases(); + $case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs"); + + //Load the fields + $arrayField = $case->loadCase($_SESSION["APPLICATION"]); + $arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], \G::getSystemConstants()); + + //Triggers + $arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $outputDocumentUid, "AFTER"); + + + //Add Input Document + if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) { + $appDocUid = $case->addInputDocument( + $outputDocumentUid, + $appDocUid, + $docVersion, + $appDocType, + $appDocComment, + $actionType, + $_SESSION["APPLICATION"], + $_SESSION["INDEX"], + $_SESSION["TASK"], + $_SESSION["USER_LOGGED"], + "xmlform", + $_FILES["form"]["name"]["APP_DOC_FILENAME"], + $_FILES["form"]["error"]["APP_DOC_FILENAME"], + $_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"] + ); + } + + if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) { + //Trigger - Execute after - Start + $arrayField["APP_DATA"] = $case->executeTriggers( + $_SESSION["TASK"], + "INPUT_DOCUMENT", + $outputDocumentUid, + "AFTER", + $arrayField["APP_DATA"] + ); + //Trigger - Execute after - End + } + + //Save data + $arrayData = array(); + $arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"]; + //$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"]; + $arrayData["APP_DATA"] = $arrayField["APP_DATA"]; + $arrayData["DEL_INDEX"] = $_SESSION["INDEX"]; + $arrayData["TAS_UID"] = $_SESSION["TASK"]; + + $case->updateCase($_SESSION["APPLICATION"], $arrayData); + + } catch (\Exception $e) { + throw $e; + } + } +} diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php new file mode 100644 index 000000000..7a4fc778e --- /dev/null +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php @@ -0,0 +1,83 @@ +getUserId(); + $inputDocument = new \BusinessModel\Cases\InputDocument(); + $response = $inputDocument->getCasesInputDocuments($cas_uid, $userUid); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url GET /:cas_uid/input-document/:inp_doc_uid + * + * @param string $cas_uid {@min 32}{@max 32} + * @param string $inp_doc_uid {@min 32}{@max 32} + */ + public function doGetInputDocument($cas_uid, $inp_doc_uid) + { + try { + $userUid = $this->getUserId(); + $inputDocument = new \BusinessModel\Cases\InputDocument(); + $response = $inputDocument->getCasesInputDocument($cas_uid, $userUid, $inp_doc_uid); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url DELETE /:cas_uid/input-document/:inp_doc_uid + * + * @param string $cas_uid {@min 32}{@max 32} + * @param string $inp_doc_uid {@min 32}{@max 32} + */ + public function doDeleteInputDocument($cas_uid, $inp_doc_uid) + { + try { + $inputDocument = new \BusinessModel\Cases\InputDocument(); + $inputDocument->removeInputDocument($inp_doc_uid); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + /** + * @url POST /:cas_uid/input-document + * + * @param string $cas_uid {@min 32}{@max 32} + * @param string $inp_doc_uid {@min 32}{@max 32} + */ + public function doPostInputDocument($cas_uid, $inp_doc_uid) + { + try { + $userUid = $this->getUserId(); + $inputDocument = new \BusinessModel\Cases\InputDocument(); + $response = $inputDocument->addCasesInputDocument($cas_uid, $inp_doc_uid, $userUid); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } +} + + diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php new file mode 100644 index 000000000..1b42e53e8 --- /dev/null +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php @@ -0,0 +1,81 @@ +getUserId(); + $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $response = $outputDocument->getCasesOutputDocuments($cas_uid, $userUid); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url GET /:cas_uid/output-document/:out_doc_uid + * + * @param string $cas_uid {@min 32}{@max 32} + * @param string $out_doc_uid {@min 32}{@max 32} + */ + public function doGetOutputDocument($cas_uid, $out_doc_uid) + { + try { + $userUid = $this->getUserId(); + $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $response = $outputDocument->getCasesOutputDocument($cas_uid, $userUid, $out_doc_uid); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url DELETE /:cas_uid/output-document/:out_doc_uid + * + * @param string $cas_uid {@min 32}{@max 32} + * @param string $out_doc_uid {@min 32}{@max 32} + */ + public function doDeleteOutputDocument($cas_uid, $out_doc_uid) + { + try { + $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $outputDocument->removeOutputDocument($out_doc_uid); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + /** + * @url POST /:cas_uid/output-document + * + * @param string $cas_uid {@min 32}{@max 32} + * @param string $out_doc_uid {@min 32}{@max 32} + */ + public function doPostOutputDocument($cas_uid, $out_doc_uid) + { + try { + $userUid = $this->getUserId(); + $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $response = $outputDocument->addCasesOutputDocument($cas_uid, $out_doc_uid, $userUid); + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } +} \ No newline at end of file From 10f7d790bdc1c9424b1b20341da4188d0c47ea77 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Tue, 25 Mar 2014 09:23:04 -0400 Subject: [PATCH 16/17] Fix for uninitialized object, using StdClass. --- workflow/engine/methods/cases/debug_vars.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workflow/engine/methods/cases/debug_vars.php b/workflow/engine/methods/cases/debug_vars.php index 3c16d14f7..44a1d0d2e 100755 --- a/workflow/engine/methods/cases/debug_vars.php +++ b/workflow/engine/methods/cases/debug_vars.php @@ -15,6 +15,7 @@ switch ($request) { $aVars = array_merge( $aFields['APP_DATA'], $aVars ); $field = $aVars[$fieldname]; + $response = new StdClass(); $response->headers = Array (); $response->columns = Array (); $response->rows = Array (); @@ -81,6 +82,7 @@ switch ($request) { $aVars = G::getSystemConstants(); } ksort( $aVars ); + $return_object = new StdClass(); $return_object->totalCount = 1; foreach ($aVars as $i => $var) { if (is_array( $var ) || is_object( $var )) { From b6aed1a10bde9c742f189e7b4070860ada2f7191 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Tue, 25 Mar 2014 09:28:42 -0400 Subject: [PATCH 17/17] Little fix, for invalidad data type in preg_match --- workflow/engine/src/ProcessMaker/Exporter/Exporter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/Exporter/Exporter.php b/workflow/engine/src/ProcessMaker/Exporter/Exporter.php index 0713e33b3..1232c3165 100644 --- a/workflow/engine/src/ProcessMaker/Exporter/Exporter.php +++ b/workflow/engine/src/ProcessMaker/Exporter/Exporter.php @@ -87,6 +87,10 @@ abstract class Exporter $oProcess = new \Processes(); $workflowData = (array) $oProcess->getWorkflowData($this->prjUid); + + $workflowData["process"]['PRO_DYNAFORMS'] = empty($workflowData["process"]['PRO_DYNAFORMS']) + ? "" : serialize($workflowData["process"]['PRO_DYNAFORMS']); + $workflowData["process"] = array($workflowData["process"]); $workflowData["processCategory"] = empty($workflowData["processCategory"]) ? array() : $workflowData["processCategory"];