diff --git a/features/backend/application_cases/case_actions/basic_sequence_cases_actions.feature b/features/backend/application_cases/case_actions/basic_sequence_cases_actions.feature index c9a5f36b2..a93042222 100644 --- a/features/backend/application_cases/case_actions/basic_sequence_cases_actions.feature +++ b/features/backend/application_cases/case_actions/basic_sequence_cases_actions.feature @@ -1,33 +1,68 @@ @ProcessMakerMichelangelo @RestAPI -Feature: Cases Actions - the features in this script are (getCaseInfo, taskCase, newCase, newCaseImpersonate, reassignCase and routeCase) +Feature: Cases Actions - the features in this script are (getCaseInfo, taskCase, newCase, newCaseImpersonate, reassignCase, routeCase, cancelCase, pauseCase, unpauseCase, executeTrigger, DELETE Case) Requirements: - a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point" + a workspace with 57 cases distributed in the processes "Derivation rules - evaluation", "Derivation rules - Parallel", "Derivation rules - parallel evaluation", "Derivation rules - selection", "Derivation rules - sequential" Background: Given that I have a valid access_token -Scenario: Returns information about a given case of the list Inbox - Given I request "cases/48177942153275bfa28bd04070312685" +#Listado de casos +Scenario: Returns a list of the cases for the logged in user (Inbox) + Given I request "cases" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the "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" - + And the response has 14 records -Scenario: Returns the current task for a given case of the list Inbox - Given I request "cases/48177942153275bfa28bd04070312685/current-task" + +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 15 records + + +Scenario: Returns a list of the cases for the logged in user (Participated) + Given I request "cases/participated" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 30 records + + +Scenario: Returns a list of the cases for the logged in user (Unassigned) + Given I request "cases/unassigned" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 12 records + + +Scenario: Returns a list of the cases for the logged in user (Paused) + Given I request "cases/paused" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 12 records + + +Scenario: Returns information about a given case of the list Inbox of process "Derivation rules - Parallel" + Given I request "cases/220090038533b0c40688174019225585" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And the "app_uid" property equals "220090038533b0c40688174019225585" + And the "app_number" property equals 137 + And the "app_name" property equals "#137" + And the "app_status" property equals "TO_DO" + + +Scenario: Returns the current task for a given case of the list Inbox, case 167 of process "derivation rules - sequencial" + Given I request "cases/356811158533b13641ef789000630231/current-task" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" And the "tas_uid" property equals "73641967750ec281cf015d9009265327" And the "tas_title" property equals "Cyclical" And the "del_index" property equals "2" @@ -37,8 +72,8 @@ Scenario Outline: Create a new case in workspace with process "Derivation rules Given POST this data: """ { - "pro_uid": "99209594750ec27ea338927000421575", - "tas_uid": "68707275350ec281ada1c95068712556", + "pro_uid": "", + "tas_uid": "", "variables": [{"name": "admin", "lastname":"admin"}] } """ @@ -51,8 +86,9 @@ Scenario Outline: Create a new case in workspace with process "Derivation rules And store "caseNumber" in session array as variable "caseNumber_" Examples: - | case_number | - | 1 | + | Description | case_number | pro_uid | tas_uid | + | Create case 16 in draft | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | + | Create case 17 in draft | 2 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | Scenario Outline: Create a new case Impersonate in workspace with process "Derivation rules - sequential" @@ -60,7 +96,7 @@ Scenario Outline: Create a new case Impersonate in workspace with process "Deriv """ { "pro_uid": "99209594750ec27ea338927000421575", - "usr_uid": "24166330352d56730cdd525035621101", + "usr_uid": "", "tas_uid": "68707275350ec281ada1c95068712556", "variables": [{"name": "pruebaQA", "amount":"10400"}] } @@ -74,8 +110,9 @@ Scenario Outline: Create a new case Impersonate in workspace with process "Deriv And store "caseNumber" in session array as variable "caseNumber_" Examples: - | case_number | - | 1 | + | Description | case_number | usr_uid | + | Create new case 18 with user chris | 3 | 24166330352d56730cdd525035621101 | + | Create new case 18 with user adam | 4 | 44811996752d567110634a1013636964 | Scenario: Returns a list of the cases for the logged in user (Draft) @@ -83,36 +120,204 @@ Scenario: Returns a list of the cases for the logged in user (Draft) Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 2 records + And the response has 18 records -Scenario: Reassigns a case to a different user +Scenario Outline: Reassigns a case to a different user, from user "administrator" to user "aaron" Given PUT this data: """ { - "usr_uid_source": "62625000752d5672d6661e6072881167", - "usr_uid_target": "24166330352d56730cdd525035621101", + "usr_uid_source": "00000000000000000000000000000001", + "usr_uid_target": "51049032352d56710347233042615067", } """ - And that I want to update a resource with the key "case_number" stored in session array - And I request "case/{uid}/reassign-case" + And I request "case//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" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + Examples: + + | test_description | case_number | + | Reassig case 1, created in this script | 1 | -Scenario: Autoderivate a case to the next task in the process +Scenario: Route a case to the next task in the process Given PUT this data: """ { - "case_uid": "78ef3ca7905019270643749052af5bd7", + "case_uid": "", "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" + And I request "cases//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 + And the type is "object" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + + Examples: + + | test_description | case_number | + | Derivate case 2 to inbox of Administrator, created in this script | 2 | + + + +Scenario: Cancel a case + Given PUT this data: + """ + { + + } + """ + And I request "cases//cancel" + 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" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + + Examples: + + | test_description | case_number | + | Cancel case 3, created in this script | 3 | + + +Scenario: Pause a case + Given PUT this data: + """ + { + "unpaused_date": "2016-12-12" + } + """ + And I request "cases//pause" + 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" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + + Examples: + + | test_description | case_number | + | Pause case 4, created in this script | 4 | + + +Scenario: Unpause a case + Given PUT this data: + """ + { + + } + """ + And I request "cases//unpause" + 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" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + + Examples: + + | test_description | case_number | + | Unpause case 4, created in this script | 4 | + + +Scenario: Executes a ProcessMaker trigger for a case + Given PUT this data: + """ + { + + } + """ + And I request "cases//execute-trigger/{tri_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" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + + Examples: + + | test_description | case_number | + | | | + + +Scenario: Delete a case + Given PUT this data: + """ + { + + } + """ + And I request "cases/" + 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" + And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_" + And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_" + + + Examples: + + | test_description | case_number | + | Delete a case 1, created in this script | 1 | + | Delete a case 2, created in this script | 2 | + | Delete a case 3, created in this script | 3 | + | Delete a case 4, created in this script | 4 | + + +#Listado de casos +Scenario: Returns a list of the cases for the logged in user (Inbox) + Given I request "cases" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 14 records + + +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 15 records + + +Scenario: Returns a list of the cases for the logged in user (Participated) + Given I request "cases/participated" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 30 records + + +Scenario: Returns a list of the cases for the logged in user (Unassigned) + Given I request "cases/unassigned" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 12 records + + +Scenario: Returns a list of the cases for the logged in user (Paused) + Given I request "cases/paused" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 12 records \ No newline at end of file diff --git a/features/backend/application_cases/case_actions/main_tests_cases_actions.feature b/features/backend/application_cases/case_actions/main_tests_cases_actions.feature index 089cb3643..cac5b2773 100644 --- a/features/backend/application_cases/case_actions/main_tests_cases_actions.feature +++ b/features/backend/application_cases/case_actions/main_tests_cases_actions.feature @@ -6,6 +6,48 @@ Requirements: Background: Given that I have a valid access_token + +#Listado de casos +Scenario: Returns a list of the cases for the logged in user (Inbox) + Given I request "cases" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 14 records + + +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 15 records + + +Scenario: Returns a list of the cases for the logged in user (Participated) + Given I request "cases/participated" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 30 records + + +Scenario: Returns a list of the cases for the logged in user (Unassigned) + Given I request "cases/unassigned" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 12 records + + +Scenario: Returns a list of the cases for the logged in user (Paused) + Given I request "cases/paused" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 12 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 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 f11edc16e..4bc362d16 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 @@ -59,21 +59,21 @@ Scenario: Returns a list of the cases for the logged in user (Advanced-Search) -#Scenarios para filtros y paginacion de las listas +#Scenarios para filtros y paginacion en listas Scenario Outline: Get paging of list inbox - Given I request "cases/paged?Start=&limit=" + 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 "array" - And the response has records in property "data" + And the response has records Examples: | test_description | start | limit | records | http_code | - | lowercase in Start | a | 1 | 1 | 200 | - | uppercase in Start | A | 1 | 1 | 200 | + | lowercase in start | a | 1 | 1 | 200 | + | uppercase in start | A | 1 | 1 | 200 | | lowercase in Limit | 1 | a | 14 | 200 | | uppercase in Limit | 1 | A | 14 | 200 | | limit=3 | 1 | 3 | 3 | 200 | @@ -104,7 +104,7 @@ Scenario Outline: Get order type of Descending and Acending And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -119,7 +119,7 @@ Scenario Outline: Get order type of Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -134,7 +134,7 @@ Scenario Outline: Get order type of Process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -149,7 +149,7 @@ Scenario Outline: Get order type of Search of number the process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -167,18 +167,18 @@ Scenario: Returns a list of the cases for the logged in user (Draft) Scenario Outline: Get paging of list Draft - Given I request "cases/draft/paged?Start=&limit=" + 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 "array" - And the response has records in property "data" + And the response has records Examples: | test_description | start | limit | records | http_code | - | lowercase in Start | a | 1 | 1 | 200 | - | uppercase in Start | A | 1 | 1 | 200 | + | lowercase in start | a | 1 | 1 | 200 | + | uppercase in start | A | 1 | 1 | 200 | | lowercase in Limit | 1 | a | 15 | 200 | | uppercase in Limit | 1 | A | 15 | 200 | | limit=3 | 1 | 3 | 3 | 200 | @@ -209,7 +209,7 @@ Scenario Outline: Get order type of Descending and Ascending And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -225,7 +225,7 @@ Scenario Outline: Get order type of Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -240,7 +240,7 @@ Scenario Outline: Get order type of Process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -255,7 +255,7 @@ Scenario Outline: Get order type of Search of the process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -272,18 +272,18 @@ Scenario: Returns a list of the cases for the logged in user (Participated) And the response has 30 records Scenario Outline: Get paging of list Participated - Given I request "cases/participated/paged?Start=&limit=" + 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 "array" - And the response has records in property "data" + And the response has records Examples: | test_description | start | limit | records | http_code | - | lowercase in Start | a | 1 | 1 | 200 | - | uppercase in Start | A | 1 | 1 | 200 | + | lowercase in start | a | 1 | 1 | 200 | + | uppercase in start | A | 1 | 1 | 200 | | lowercase in Limit | 1 | a | 30 | 200 | | uppercase in Limit | 1 | A | 30 | 200 | | limit=3 | 1 | 3 | 3 | 200 | @@ -314,7 +314,7 @@ Scenario Outline: Get order type of Descending an Descending And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -330,7 +330,7 @@ Scenario Outline: Get order type of Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -345,7 +345,7 @@ Scenario Outline: Get order type of Process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -361,7 +361,7 @@ Scenario Outline: Get order type of Search And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -379,18 +379,18 @@ Scenario: Returns a list of the cases for the logged in user (Unassigned) Scenario Outline: Get paging of list Unassigned - Given I request "cases/Unassigned/paged?Start=&limit=" + 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 "array" - And the response has records in property "data" + And the response has records Examples: | test_description | start | limit | records | http_code | - | lowercase in Start | a | 1 | 1 | 200 | - | uppercase in Start | A | 1 | 1 | 200 | + | lowercase in start | a | 1 | 1 | 200 | + | uppercase in start | A | 1 | 1 | 200 | | lowercase in Limit | 1 | a | 12 | 200 | | uppercase in Limit | 1 | A | 12 | 200 | | limit=3 | 1 | 3 | 3 | 200 | @@ -421,7 +421,7 @@ Scenario Outline: Get order type of Descending and Acending And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -436,7 +436,7 @@ Scenario Outline: Get order type of Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -451,7 +451,7 @@ Scenario Outline: Get order type of Process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -466,7 +466,7 @@ Scenario Outline: Get order type of Search And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -485,18 +485,18 @@ Scenario: Returns a list of the cases for the logged in user (Paused) Scenario Outline: Get paging of list Paused - Given I request "cases/paused/paged?Start=&limit=" + 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 "array" - And the response has records in property "data" + And the response has records Examples: | test_description | start | limit | records | http_code | - | lowercase in Start | a | 1 | 1 | 200 | - | uppercase in Start | A | 1 | 1 | 200 | + | lowercase in start | a | 1 | 1 | 200 | + | uppercase in start | A | 1 | 1 | 200 | | lowercase in Limit | 1 | a | 12 | 200 | | uppercase in Limit | 1 | A | 12 | 200 | | limit=3 | 1 | 3 | 3 | 200 | @@ -527,7 +527,7 @@ Scenario Outline: Get order type of Descending and Acending And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -542,7 +542,7 @@ Scenario Outline: Get order type of Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -557,7 +557,7 @@ Scenario Outline: Get order type of Process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -572,7 +572,7 @@ Scenario Outline: Get order type of Search And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -590,18 +590,18 @@ Scenario: Returns a list of the cases for the logged in user (Advanced Search) Scenario Outline: Get paging of list Advanced Search - Given I request "cases/advanced-search/paged?Start=&limit=" + 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 "array" - And the response has records in property "data" + And the response has records Examples: | test_description | start | limit | records | http_code | - | lowercase in Start | a | 1 | 1 | 200 | - | uppercase in Start | A | 1 | 1 | 200 | + | lowercase in start | a | 1 | 1 | 200 | + | uppercase in start | A | 1 | 1 | 200 | | lowercase in Limit | 1 | a | 30 | 200 | | uppercase in Limit | 1 | A | 30 | 200 | | limit=3 | 1 | 3 | 3 | 200 | @@ -632,7 +632,7 @@ Scenario Outline: Get order type of Descending and Acending And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -647,7 +647,7 @@ Scenario Outline: Get order type of Process Category And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -663,7 +663,7 @@ Scenario Outline: Get order type of Process And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -679,7 +679,7 @@ Scenario Outline: Get order type of Search And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -694,7 +694,7 @@ Scenario Outline: Get order for Status And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -711,7 +711,7 @@ Scenario Outline: Get order for User And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: @@ -728,7 +728,7 @@ Scenario Outline: Get order for date And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has records in property "data" + And the response has records Examples: 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 bb386ba8f..99a86a625 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 @@ -9,38 +9,38 @@ Scenario: Returns a list of the cases for the logged in user (Inbox) Given I request "cases" Then the response status code should be 400 And the response has 4 records - And the response status message should have the following text "" + And the response status message should have the following text "Records" Scenario: Returns a list of the cases for the logged in user (Draft) Given I request "cases/draft" Then the response status code should be 400 And the response has 4 records - And the response status message should have the following text "" + And the response status message should have the following text "Records" Scenario: Returns a list of the cases for the logged in user (Participated) Given I request "cases/participated" Then the response status code should be 400 And the response has 4 records - And the response status message should have the following text "" + And the response status message should have the following text "Records" Scenario: Returns a list of the cases for the logged in user (Unassigned) Given I request "cases/unassigned" Then the response status code should be 400 And the response has 4 records - And the response status message should have the following text "" + And the response status message should have the following text "Records" Scenario: Returns a list of the cases for the logged in user (Paused) Given I request "cases/paused" Then the response status code should be 400 And the response has 4 records - And the response status message should have the following text "" + And the response status message should have the following text "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 400 And the response has 4 records - And the response status message should have the following text "" \ No newline at end of file + And the response status message should have the following text "Records" \ No newline at end of file diff --git a/workflow/engine/src/Extension/Restler/UploadFormat.php b/framework/src/Maveriks/Extension/Restler/UploadFormat.php similarity index 100% rename from workflow/engine/src/Extension/Restler/UploadFormat.php rename to framework/src/Maveriks/Extension/Restler/UploadFormat.php diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 5add6bd21..8d645659f 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -2,11 +2,14 @@ namespace Maveriks; use Maveriks\Util; +use ProcessMaker\Services; class WebApplication { protected $rootDir = ""; protected $workflowDir = ""; + protected $workspaceDir = ""; + protected $workspaceCacheDir = ""; protected $requestUri = ""; protected $responseMultipart = array(); @@ -79,12 +82,12 @@ class WebApplication $this->loadEnvironment($request["workspace"]); Util\Logger::log("API::Dispatching ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]); - if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtoupper($_SERVER["HTTP_X_REQUESTED_WITH"]) == 'MULTYPART') { + if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtoupper($_SERVER["HTTP_X_REQUESTED_WITH"]) == 'MULTIPART') { $this->multipart($request["uri"], $request["version"]); } else { $this->dispatchApiRequest($request["uri"], $request["version"]); } - Util\Logger::log("API::End Dispatching ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]); + Util\Logger::log("API::End Dispatch"); break; } } @@ -141,29 +144,43 @@ class WebApplication */ header('Access-Control-Allow-Origin: *'); + require_once $this->rootDir . "framework/src/Maveriks/Extension/Restler/UploadFormat.php"; + // $servicesDir contains directory where Services Classes are allocated - $servicesDir = $this->workflowDir . 'engine' . DS . 'src' . DS . 'Services' . DS; + $servicesDir = $this->workflowDir . 'engine' . DS . 'src' . DS . 'ProcessMaker' . DS . 'Services' . DS; // $apiDir - contains directory to scan classes and add them to Restler $apiDir = $servicesDir . 'Api' . DS; // $apiIniFile - contains file name of api ini configuration $apiIniFile = $servicesDir . DS . 'api.ini'; // $authenticationClass - contains the class name that validate the authentication for Restler - $authenticationClass = 'Services\\Api\\OAuth2\\Server'; + $authenticationClass = 'ProcessMaker\\Services\\OAuth2\\Server'; // $pmOauthClientId - contains PM Local OAuth Id (Web Designer) $pmOauthClientId = 'x-pm-local-client'; /* * Load Api ini file for Rest Service */ - $apiIniConf = array(); + $config = array(); + if (file_exists($apiIniFile)) { - $apiIniConf = Util\Common::parseIniFile($apiIniFile); + $cachedConfig = $this->workspaceCacheDir . "api-config.php"; + + // verify if config cache file exists, is array and the last modification date is the same when cache was created. + if (! file_exists($cachedConfig) || ! is_array($config = include($cachedConfig)) || $config["_chk"] != filemtime($apiIniFile)) { + $config = Util\Common::parseIniFile($apiIniFile); + $config["_chk"] = filemtime($apiIniFile); + if (! is_dir(dirname($cachedConfig))) { + Util\Common::mk_dir(dirname($cachedConfig)); + } + file_put_contents($cachedConfig, "workflowDir . "engine/src/Extension/Restler/UploadFormat.php"; - //require_once PATH_CORE - - //$rest->setSupportedFormats('JsonFormat', 'XmlFormat', 'UploadFormat'); - //$rest->setOverridingFormats('UploadFormat', 'JsonFormat', 'XmlFormat', 'HtmlFormat'); $rest->setOverridingFormats('JsonFormat', 'UploadFormat'); - // Override $_SERVER['REQUEST_URI'] to Restler handles the current url correctly - $isPluginRequest = strpos($uri, '/plugin-') !== false ? true : false; if ($isPluginRequest) { @@ -204,6 +214,7 @@ class WebApplication $uri = str_replace('/plugin-'.$pluginName, '', $uri); } + // Override $_SERVER['REQUEST_URI'] to Restler handles the modified url $_SERVER['REQUEST_URI'] = $uri; if (! $isPluginRequest) { // if it is not a request for a plugin endpoint @@ -212,19 +223,18 @@ class WebApplication foreach ($classesList as $classFile) { if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') { - $namespace = '\\Services\\' . str_replace( - DIRECTORY_SEPARATOR, - '\\', - str_replace('.php', '', str_replace($servicesDir, '', $classFile)) - ); - //var_dump($namespace); + $namespace = '\\ProcessMaker\\Services\\' . str_replace( + DIRECTORY_SEPARATOR, + '\\', + str_replace('.php', '', str_replace($servicesDir, '', $classFile)) + ); $rest->addAPIClass($namespace); } } // adding aliases for Restler - if (array_key_exists('alias', $apiIniConf)) { - foreach ($apiIniConf['alias'] as $alias => $aliasData) { + if (array_key_exists('alias', $config)) { + foreach ($config['alias'] as $alias => $aliasData) { if (is_array($aliasData)) { foreach ($aliasData as $label => $namespace) { $namespace = '\\' . ltrim($namespace, '\\'); @@ -379,7 +389,10 @@ class WebApplication require_once (PATH_DB . SYS_SYS . "/db.php"); // defining constant for workspace shared directory - define("PATH_WORKSPACE", PATH_DB . SYS_SYS . PATH_SEP); + $this->workspaceDir = PATH_DB . SYS_SYS . PATH_SEP; + $this->workspaceCacheDir = PATH_DB . SYS_SYS . PATH_SEP . "cache" . PATH_SEP; + + define("PATH_WORKSPACE", $this->workspaceDir); // including workspace shared classes -> particularlly for pmTables set_include_path(get_include_path() . PATH_SEPARATOR . PATH_WORKSPACE); diff --git a/workflow/engine/controllers/designer.php b/workflow/engine/controllers/designer.php index af0a5750c..0bdff090c 100644 --- a/workflow/engine/controllers/designer.php +++ b/workflow/engine/controllers/designer.php @@ -78,16 +78,16 @@ class Designer extends Controller protected function getClientCredentials() { - $oauthQuery = new Services\Api\OAuth2\PmPdo($this->getDsn()); + $oauthQuery = new ProcessMaker\Services\OAuth2\PmPdo($this->getDsn()); return $oauthQuery->getClientDetails($this->clientId); } protected function getAuthorizationCode($client) { - \Services\Api\OAuth2\Server::setDatabaseSource($this->getDsn()); - \Services\Api\OAuth2\Server::setPmClientId($client['CLIENT_ID']); + \ProcessMaker\Services\OAuth2\Server::setDatabaseSource($this->getDsn()); + \ProcessMaker\Services\OAuth2\Server::setPmClientId($client['CLIENT_ID']); - $oauthServer = new \Services\Api\OAuth2\Server(); + $oauthServer = new \ProcessMaker\Services\OAuth2\Server(); $userId = $_SESSION['USER_LOGGED']; $authorize = true; $_GET = array_merge($_GET, array( diff --git a/workflow/engine/src/BusinessModel/Calendar.php b/workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php similarity index 78% rename from workflow/engine/src/BusinessModel/Calendar.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php index 8dd46ee1b..54886cb52 100644 --- a/workflow/engine/src/BusinessModel/Calendar.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php @@ -1,5 +1,5 @@ throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); $this->throwExceptionIfExistsName($arrayData["CAL_NAME"], $this->arrayFieldNameForException["calendarName"]); - if (!(count($arrayData["CAL_WORK_DAYS"]) >= 3)) { + if (isset($arrayData["CAL_WORK_DAYS"]) && count($arrayData["CAL_WORK_DAYS"]) < 3) { throw (new \Exception(\G::LoadTranslation("ID_MOST_AT_LEAST_3_DAY"))); } @@ -294,6 +294,10 @@ class Calendar if (isset($arrayData["CAL_WORK_HOUR"])) { foreach ($arrayData["CAL_WORK_HOUR"] as $value) { + if ($value["DAY"] != "ALL" && !in_array($value["DAY"], $arrayData["CAL_WORK_DAYS"])) { + throw (new \Exception(str_replace(array("{0}", "{1}"), array($this->arrayWorkHourFieldNameForException["day"], $this->arrayFieldNameForException["calendarWorkDays"]), "Value specified for \"{0}\" does not exists in \"{1}\""))); + } + $arrayCalendarWorkHour[] = array( "CALENDAR_BUSINESS_DAY" => $this->workDaysReplaceData($value["DAY"]), "CALENDAR_BUSINESS_START" => $value["HOUR_START"], @@ -346,6 +350,136 @@ class Calendar } } + /** + * Update Calendar + * + * @param string $calendarUid Unique id of Calendar + * @param array $arrayData Data + * + * return array Return data of the Calendar updated + */ + public function update($calendarUid, $arrayData) + { + try { + $arrayData = \G::array_change_key_case2($arrayData, CASE_UPPER); + + //Verify data + $process = new \ProcessMaker\BusinessModel\Process(); + + $this->throwExceptionIfNotExistsCalendar($calendarUid, $this->arrayFieldNameForException["calendarUid"]); + + $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); + + if (isset($arrayData["CAL_NAME"])) { + $this->throwExceptionIfExistsName($arrayData["CAL_NAME"], $this->arrayFieldNameForException["calendarName"], $calendarUid); + } + + if (isset($arrayData["CAL_WORK_DAYS"]) && count($arrayData["CAL_WORK_DAYS"]) < 3) { + throw (new \Exception(\G::LoadTranslation("ID_MOST_AT_LEAST_3_DAY"))); + } + + if (isset($arrayData["CAL_WORK_HOUR"])) { + foreach ($arrayData["CAL_WORK_HOUR"] as $value) { + $process->throwExceptionIfDataNotMetFieldDefinition($value, $this->arrayWorkHourFieldDefinition, $this->arrayWorkHourFieldNameForException, true); + } + } + + if (isset($arrayData["CAL_HOLIDAY"])) { + foreach ($arrayData["CAL_HOLIDAY"] as $value) { + $process->throwExceptionIfDataNotMetFieldDefinition($value, $this->arrayHolidayFieldDefinition, $this->arrayHolidayFieldNameForException, true); + } + } + + //Set variables + $arrayCalendarData = \G::array_change_key_case2($this->getCalendar($calendarUid), CASE_UPPER); + + $calendarWorkDays = (isset($arrayData["CAL_WORK_DAYS"]))? $arrayData["CAL_WORK_DAYS"] : $arrayCalendarData["CAL_WORK_DAYS"]; + + $arrayCalendarWorkHour = array(); + $arrayAux = (isset($arrayData["CAL_WORK_HOUR"]))? $arrayData["CAL_WORK_HOUR"] : $arrayCalendarData["CAL_WORK_HOUR"]; + + foreach ($arrayAux as $value) { + if (isset($arrayData["CAL_WORK_HOUR"]) && $value["DAY"] != "ALL" && !in_array($value["DAY"], $calendarWorkDays)) { + throw (new \Exception(str_replace(array("{0}", "{1}"), array($this->arrayWorkHourFieldNameForException["day"], $this->arrayFieldNameForException["calendarWorkDays"]), "Value specified for \"{0}\" does not exists in \"{1}\""))); + } + + $arrayCalendarWorkHour[] = array( + "CALENDAR_BUSINESS_DAY" => $this->workDaysReplaceData($value["DAY"]), + "CALENDAR_BUSINESS_START" => $value["HOUR_START"], + "CALENDAR_BUSINESS_END" => $value["HOUR_END"] + ); + } + + $arrayCalendarHoliday = array(); + $arrayAux = (isset($arrayData["CAL_HOLIDAY"]))? $arrayData["CAL_HOLIDAY"] : $arrayCalendarData["CAL_HOLIDAY"]; + + foreach ($arrayAux as $value) { + $arrayCalendarHoliday[] = array( + "CALENDAR_HOLIDAY_NAME" => $value["NAME"], + "CALENDAR_HOLIDAY_START" => $value["DATE_START"], + "CALENDAR_HOLIDAY_END" => $value["DATE_END"] + ); + } + + $arrayDataAux = array(); + $arrayDataAux["CALENDAR_UID"] = $calendarUid; + $arrayDataAux["CALENDAR_NAME"] = (isset($arrayData["CAL_NAME"]))? $arrayData["CAL_NAME"] : $arrayCalendarData["CAL_NAME"]; + $arrayDataAux["CALENDAR_DESCRIPTION"] = (isset($arrayData["CAL_DESCRIPTION"]))? $arrayData["CAL_DESCRIPTION"] : $arrayCalendarData["CAL_DESCRIPTION"]; + $arrayDataAux["CALENDAR_WORK_DAYS"] = explode("|", $this->workDaysReplaceData(implode("|", $calendarWorkDays))); + $arrayDataAux["CALENDAR_STATUS"] = (isset($arrayData["CAL_STATUS"]))? $arrayData["CAL_STATUS"] : $arrayCalendarData["CAL_STATUS"]; + + $arrayDataAux["BUSINESS_DAY"] = $arrayCalendarWorkHour; + $arrayDataAux["HOLIDAY"] = $arrayCalendarHoliday; + + //Update + $calendarDefinition = new \CalendarDefinition(); + + $calendarDefinition->saveCalendarInfo($arrayDataAux); + + //Return + if (!$this->formatFieldNameInUppercase) { + $arrayData = \G::array_change_key_case2($arrayData, CASE_LOWER); + } + + return $arrayData; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Delete Calendar + * + * @param string $calendarUid Unique id of Calendar + * + * return void + */ + public function delete($calendarUid) + { + try { + //Verify data + $calendarDefinition = new \CalendarDefinition(); + + $this->throwExceptionIfNotExistsCalendar($calendarUid, $this->arrayFieldNameForException["calendarUid"]); + + $arrayAux = $calendarDefinition->getAllCounterByCalendar("USER"); + $nU = (isset($arrayAux[$calendarUid]))? $arrayAux[$calendarUid] : 0; + $arrayAux = $calendarDefinition->getAllCounterByCalendar("TASK"); + $nT = (isset($arrayAux[$calendarUid]))? $arrayAux[$calendarUid] : 0; + $arrayAux = $calendarDefinition->getAllCounterByCalendar("PROCESS"); + $nP = (isset($arrayAux[$calendarUid]))? $arrayAux[$calendarUid] : 0; + + if ($nU + $nT + $nP > 0) { + throw (new \Exception(\G::LoadTranslation("ID_MSG_CANNOT_DELETE_CALENDAR"))); + } + + //Delete + $calendarDefinition->deleteCalendar($calendarUid); + } catch (\Exception $e) { + throw $e; + } + } + /** * Get criteria for Calendar * @@ -442,7 +576,7 @@ class Calendar $arrayCalendar = array(); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException); diff --git a/workflow/engine/src/BusinessModel/CaseScheduler.php b/workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php similarity index 99% rename from workflow/engine/src/BusinessModel/CaseScheduler.php rename to workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php index 35e44225b..8c0abd98f 100644 --- a/workflow/engine/src/BusinessModel/CaseScheduler.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php @@ -1,5 +1,5 @@ existsObjectUid($arrayData["CTO_TYPE_OBJ"], $arrayData["CTO_UID_OBJ"]); @@ -156,7 +156,7 @@ class CaseTrackerObject } if (isset($arrayData["CTO_TYPE_OBJ"]) && isset($arrayData["CTO_UID_OBJ"])) { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $msg = $step->existsObjectUid($arrayData["CTO_TYPE_OBJ"], $arrayData["CTO_UID_OBJ"]); diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php similarity index 99% rename from workflow/engine/src/BusinessModel/Cases.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 170cfdb26..ca3efc8fd 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1,5 +1,5 @@ getConfiguration('ENVIRONMENT_SETTINGS', ''); diff --git a/workflow/engine/src/BusinessModel/Cases/InputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php similarity index 98% rename from workflow/engine/src/BusinessModel/Cases/InputDocument.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php index 3678b2846..a4eb416e2 100644 --- a/workflow/engine/src/BusinessModel/Cases/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php @@ -1,5 +1,5 @@ loadCase( $sApplicationUID ); $sProcessUID = $fields['PRO_UID']; $sTaskUID = ''; - $oCaseRest = new \BusinessModel\Cases(); + $oCaseRest = new \ProcessMaker\BusinessModel\Cases(); $oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID); $result = array (); global $_DBArray; @@ -65,7 +65,7 @@ class InputDocument $fields = $oCase->loadCase( $sApplicationUID ); $sProcessUID = $fields['PRO_UID']; $sTaskUID = ''; - $oCaseRest = new \BusinessModel\Cases(); + $oCaseRest = new \ProcessMaker\BusinessModel\Cases(); $oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); $result = array (); global $_DBArray; diff --git a/workflow/engine/src/BusinessModel/Cases/OutputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/OutputDocument.php similarity index 98% rename from workflow/engine/src/BusinessModel/Cases/OutputDocument.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Cases/OutputDocument.php index 0e3d578c6..c47497f25 100644 --- a/workflow/engine/src/BusinessModel/Cases/OutputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/OutputDocument.php @@ -1,5 +1,5 @@ loadCase( $applicationUid ); $sProcessUID = $fields['PRO_UID']; $sTaskUID = ''; - $oCriteria = new \BusinessModel\Cases(); + $oCriteria = new \ProcessMaker\BusinessModel\Cases(); $oCriteria->getAllGeneratedDocumentsCriteria( $sProcessUID, $applicationUid, $sTaskUID, $userUid); $result = array (); global $_DBArray; @@ -63,7 +63,7 @@ class OutputDocument $fields = $oCase->loadCase( $sApplicationUID ); $sProcessUID = $fields['PRO_UID']; $sTaskUID = ''; - $oCaseRest = new \BusinessModel\Cases(); + $oCaseRest = new \ProcessMaker\BusinessModel\Cases(); $oCaseRest->getAllGeneratedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID ); $result = array (); global $_DBArray; @@ -498,11 +498,11 @@ class OutputDocument ); } $g_media->set_security($GLOBALS['g_config']['pdfSecurity']); - require_once (HTML2PS_DIR . 'pdf.fpdf.encryption.php'); + require_once(HTML2PS_DIR . 'pdf.fpdf.encryption.php'); } $pipeline = new \Pipeline(); if (extension_loaded('curl')) { - require_once (HTML2PS_DIR . 'fetcher.url.curl.class.php'); + require_once(HTML2PS_DIR . 'fetcher.url.curl.class.php'); $pipeline->fetchers = array(new \FetcherURLCurl()); if (isset($proxy)) { if ($proxy != '') { @@ -510,7 +510,7 @@ class OutputDocument } } } else { - require_once (HTML2PS_DIR . 'fetcher.url.class.php'); + require_once(HTML2PS_DIR . 'fetcher.url.class.php'); $pipeline->fetchers[] = new \FetcherURL(); } $pipeline->data_filters[] = new \DataFilterDoctype(); diff --git a/workflow/engine/src/BusinessModel/DataBaseConnection.php b/workflow/engine/src/ProcessMaker/BusinessModel/DataBaseConnection.php similarity index 99% rename from workflow/engine/src/BusinessModel/DataBaseConnection.php rename to workflow/engine/src/ProcessMaker/BusinessModel/DataBaseConnection.php index 60d885fbb..c1765a4bf 100644 --- a/workflow/engine/src/BusinessModel/DataBaseConnection.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/DataBaseConnection.php @@ -1,5 +1,5 @@ throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); @@ -412,7 +412,7 @@ class DynaForm $processUid = $arrayDynaFormData["PRO_UID"]; //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); @@ -505,7 +505,7 @@ class DynaForm unset($arrayData["PMTABLE"]); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); @@ -708,7 +708,7 @@ class DynaForm unset($arrayData["COPY_IMPORT"]); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); diff --git a/workflow/engine/src/BusinessModel/Event.php b/workflow/engine/src/ProcessMaker/BusinessModel/Event.php similarity index 99% rename from workflow/engine/src/BusinessModel/Event.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Event.php index 75b02237a..6b3e6baaf 100644 --- a/workflow/engine/src/BusinessModel/Event.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Event.php @@ -1,5 +1,5 @@ diff --git a/workflow/engine/src/BusinessModel/FilesManager.php b/workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php similarity index 99% rename from workflow/engine/src/BusinessModel/FilesManager.php rename to workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php index dcc719f6a..fc7205805 100644 --- a/workflow/engine/src/BusinessModel/FilesManager.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php @@ -1,5 +1,5 @@ throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); @@ -227,7 +227,7 @@ class Group $arrayData = array_change_key_case($arrayData, CASE_UPPER); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); @@ -459,7 +459,7 @@ class Group $arrayGroup = array(); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException); @@ -671,7 +671,7 @@ class Group $arrayUser = array(); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); diff --git a/workflow/engine/src/BusinessModel/Group/User.php b/workflow/engine/src/ProcessMaker/BusinessModel/Group/User.php similarity index 95% rename from workflow/engine/src/BusinessModel/Group/User.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Group/User.php index d7f779f5e..d2de2b6aa 100644 --- a/workflow/engine/src/BusinessModel/Group/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Group/User.php @@ -1,5 +1,5 @@ throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); @@ -185,8 +185,8 @@ class User { try { //Verify data - $process = new \BusinessModel\Process(); - $group = new \BusinessModel\Group(); + $process = new \ProcessMaker\BusinessModel\Process(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]); diff --git a/workflow/engine/src/BusinessModel/InputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php similarity index 99% rename from workflow/engine/src/BusinessModel/InputDocument.php rename to workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php index 22a37d89b..1660fa273 100644 --- a/workflow/engine/src/BusinessModel/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php @@ -1,5 +1,5 @@ throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); @@ -278,7 +278,7 @@ class InputDocument $processUid = $arrayInputDocumentData["PRO_UID"]; //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); diff --git a/workflow/engine/src/BusinessModel/OutputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/OutputDocument.php similarity index 98% rename from workflow/engine/src/BusinessModel/OutputDocument.php rename to workflow/engine/src/ProcessMaker/BusinessModel/OutputDocument.php index a97cb6a2e..b1e66c469 100644 --- a/workflow/engine/src/BusinessModel/OutputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/OutputDocument.php @@ -1,5 +1,5 @@ load( $sOutputDocumentUID ); diff --git a/workflow/engine/src/BusinessModel/Process.php b/workflow/engine/src/ProcessMaker/BusinessModel/Process.php similarity index 98% rename from workflow/engine/src/BusinessModel/Process.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Process.php index 16621b58b..ab22db6da 100644 --- a/workflow/engine/src/BusinessModel/Process.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Process.php @@ -1,5 +1,5 @@ throwExceptionIfNotExistsCalendar($arrayData["PRO_CALENDAR"], $this->arrayFieldNameForException["processCalendar"]); } @@ -530,7 +530,7 @@ class Process } if (isset($arrayData["PRO_SUMMARY_DYNAFORM"]) && $arrayData["PRO_SUMMARY_DYNAFORM"] . "" != "") { - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["PRO_SUMMARY_DYNAFORM"], $processUid, $this->arrayFieldNameForException["processSummaryDynaform"]); } @@ -539,7 +539,7 @@ class Process $this->throwExceptionIfNotExistsRoutingScreenTemplate($processUid, $arrayData["PRO_DERIVATION_SCREEN_TPL"], $this->arrayFieldNameForException["processDerivationScreenTpl"]); } - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); if (isset($arrayData["PRO_TRI_DELETED"]) && $arrayData["PRO_TRI_DELETED"] . "" != "") { $trigger->throwExceptionIfNotExistsTrigger($arrayData["PRO_TRI_DELETED"], $processUid, $this->arrayFieldNameForException["processTriDeleted"]); @@ -826,7 +826,7 @@ class Process $arrayDefineProcessData["process"]["tasks"][$index]["TAS_UID_OLD"] = $uidAux; //Update task properties - $task2 = new \BusinessModel\Task(); + $task2 = new \ProcessMaker\BusinessModel\Task(); $arrayResult = $task2->updateProperties($taskUid, $processUid, $arrayData); @@ -842,7 +842,7 @@ class Process $result = $task->update($arrayData); //Update task properties - $task2 = new \BusinessModel\Task(); + $task2 = new \ProcessMaker\BusinessModel\Task(); $arrayResult = $task2->updateProperties($arrayData["TAS_UID"], $processUid, $arrayData); break; @@ -1390,7 +1390,7 @@ class Process $this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); //Get data - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $dynaForm->setArrayFieldNameForException($this->arrayFieldNameForException); @@ -1431,7 +1431,7 @@ class Process $this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); //Get data - $inputDocument = new \BusinessModel\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\InputDocument(); $inputDocument->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $inputDocument->setArrayFieldNameForException($this->arrayFieldNameForException); @@ -1470,7 +1470,7 @@ class Process //Verify data //Get data - $webEntry = new \BusinessModel\WebEntry(); + $webEntry = new \ProcessMaker\BusinessModel\WebEntry(); $webEntry->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $webEntry->setArrayFieldNameForException($this->arrayFieldNameForException); @@ -1575,7 +1575,7 @@ class Process break; case "GRIDVARS": //Verify data - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->throwExceptionIfNotExistsDynaForm($gridUid, $processUid, $this->arrayFieldNameForException["gridUid"]); $dynaForm->throwExceptionIfNotIsGridDynaForm($gridUid, $this->arrayFieldNameForException["gridUid"]); @@ -1622,7 +1622,7 @@ class Process //Get data \G::LoadClass("triggerLibrary"); - $triggerWizard = new \BusinessModel\TriggerWizard(); + $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard(); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); diff --git a/workflow/engine/src/BusinessModel/ProcessCategory.php b/workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php similarity index 58% rename from workflow/engine/src/BusinessModel/ProcessCategory.php rename to workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php index b1009203d..0225abc19 100644 --- a/workflow/engine/src/BusinessModel/ProcessCategory.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php @@ -1,5 +1,5 @@ addSelectColumn(\ProcessCategoryPeer::CATEGORY_UID); $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_PARENT); $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_NAME); @@ -146,7 +145,7 @@ class ProcessCategory $arrayProcessCategory = array(); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException); @@ -232,5 +231,172 @@ class ProcessCategory throw $e; } } -} + /** + * Get a Process Category + * + * @param string $cat_uid Category Id + * + * return array Return an object with the Process Category + */ + public function getCategory($cat_uid) + { + try { + $oProcessCategory = ''; + $process = new \Process(); + $oTotalProcessesByCategory = $process->getAllProcessesByCategory(); + $criteria = $this->getAProcessCategoryCriteria($cat_uid); + $criteriaCount = clone $criteria; + $criteriaCount->clearSelectColumns(); + $criteriaCount->addSelectColumn("COUNT(" . \ProcessCategoryPeer::CATEGORY_UID . ") AS NUM_REC"); + $rsCriteriaCount = \ProcessCategoryPeer::doSelectRS($criteriaCount); + $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + $rsCriteriaCount->next(); + $rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria); + $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + while ($rsCriteria->next()) { + $row = $rsCriteria->getRow(); + $row["CATEGORY_TOTAL_PROCESSES"] = (isset($oTotalProcessesByCategory[$row["CATEGORY_UID"]]))? $oTotalProcessesByCategory[$row["CATEGORY_UID"]] : 0; + $oProcessCategory = $this->getProcessCategoryDataFromRecord($row); + } + //Return + if ($oProcessCategory != '') { + return $oProcessCategory; + } else { + throw (new \Exception( 'The Category with cat_uid: '.$cat_uid.' doesn\'t exist!')); + } + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Post Process Category + * + * @param string $cat_name Name of Category + * + * return array + */ + public function addCategory($cat_name) + { + try { + require_once 'classes/model/ProcessCategory.php'; + $catName = trim( $cat_name ); + if ($this->existsName( $cat_name )) { + throw (new \Exception( 'cat_name. Duplicate Process Category name')); + } + $catUid = \G::GenerateUniqueID(); + $pcat = new \ProcessCategory(); + $pcat->setNew( true ); + $pcat->setCategoryUid( $catUid ); + $pcat->setCategoryName( $catName ); + $pcat->save(); + $oProcessCategory = array_change_key_case($this->getCategory( $catUid ), CASE_LOWER); + //Return + return $oProcessCategory; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Put Process Category + * + * @param string $cat_uid Category id + * @param string $cat_name Category Name + * + * return array + */ + public function updateCategory($cat_uid, $cat_name) + { + try { + require_once 'classes/model/ProcessCategory.php'; + $catUID = $cat_uid; + $catName = trim( $cat_name ); + if ($this->existsName( $cat_name )) { + throw (new \Exception( 'cat_name. Duplicate Process Category name')); + } + $pcat = new \ProcessCategory(); + $pcat->setNew( false ); + $pcat->setCategoryUid( $catUID ); + $pcat->setCategoryName( $catName ); + $pcat->save(); + $oProcessCategory = array_change_key_case($this->getCategory( $cat_uid ), CASE_LOWER); + //Return + return $oProcessCategory; + + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Delete Process Category + * + * @param string $cat_uid Category id + * + * return array + */ + public function deleteCategory($cat_uid) + { + try { + require_once 'classes/model/ProcessCategory.php'; + $criteria = $this->getAProcessCategoryCriteria($cat_uid); + $rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria); + $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + $rsCriteria->next(); + $row = $rsCriteria->getRow(); + if ($row) { + $cat = new \ProcessCategory(); + $cat->setCategoryUid( $cat_uid ); + $cat->delete(); + } else { + throw (new \Exception( 'The Category with cat_uid: '.$cat_uid.' doesn\'t exist!')); + } + + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get criteria for Process Category + * + * return object + */ + public function getAProcessCategoryCriteria($cat_uid) + { + try { + $criteria = new \Criteria("workflow"); + $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_UID); + $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_PARENT); + $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_NAME); + $criteria->addSelectColumn(\ProcessCategoryPeer::CATEGORY_ICON); + $criteria->add(\ProcessCategoryPeer::CATEGORY_UID, $cat_uid); + return $criteria; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Checks if the name exists + * + * @param string $name Name + * + * return bool Return true if the name exists, false otherwise + */ + public function existsName($name) + { + try { + $criteria = new \Criteria("workflow"); + $criteria->add(\ProcessCategoryPeer::CATEGORY_NAME, $name, \Criteria::EQUAL); + $rsCriteria = \ProcessCategoryPeer::doSelectRS($criteria); + $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + $rsCriteria->next(); + return $rsCriteria->getRow(); + } catch (\Exception $e) { + throw $e; + } + } +} diff --git a/workflow/engine/src/BusinessModel/ProcessPermissions.php b/workflow/engine/src/ProcessMaker/BusinessModel/ProcessPermissions.php similarity index 99% rename from workflow/engine/src/BusinessModel/ProcessPermissions.php rename to workflow/engine/src/ProcessMaker/BusinessModel/ProcessPermissions.php index 585a2f264..bc42f9b1b 100644 --- a/workflow/engine/src/BusinessModel/ProcessPermissions.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/ProcessPermissions.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $step->setArrayParamException($this->arrayParamException); @@ -650,7 +650,7 @@ class Step } //Get data - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $flagStepAssignTask = 0; @@ -765,8 +765,8 @@ class Step } //Get data - $bmTrigger = new \BusinessModel\Trigger(); - $bmStepTrigger = new \BusinessModel\Step\Trigger(); + $bmTrigger = new \ProcessMaker\BusinessModel\Trigger(); + $bmStepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $stepTrigger = new \StepTrigger(); diff --git a/workflow/engine/src/BusinessModel/Step/Trigger.php b/workflow/engine/src/ProcessMaker/BusinessModel/Step/Trigger.php similarity index 98% rename from workflow/engine/src/BusinessModel/Step/Trigger.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Step/Trigger.php index efdc11b15..f66a0c17f 100644 --- a/workflow/engine/src/BusinessModel/Step/Trigger.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Step/Trigger.php @@ -1,7 +1,7 @@ getTriggerCriteria(); @@ -373,7 +373,7 @@ class Trigger * @return void */ public function moveStepTriggers($tasUid, $stepUid, $triUid, $type, $newPos) { - $stepTrigger = new \BusinessModel\Step(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step(); $tempStep = $stepUid; $typeCompare = $type; if ($tempStep == '-1' || $tempStep == '-2') { diff --git a/workflow/engine/src/BusinessModel/Subprocess.php b/workflow/engine/src/ProcessMaker/BusinessModel/Subprocess.php similarity index 99% rename from workflow/engine/src/BusinessModel/Subprocess.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Subprocess.php index f2f327c4a..46c40c785 100644 --- a/workflow/engine/src/BusinessModel/Subprocess.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Subprocess.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $step->setArrayParamException($this->arrayParamException); diff --git a/workflow/engine/src/BusinessModel/Trigger.php b/workflow/engine/src/ProcessMaker/BusinessModel/Trigger.php similarity index 99% rename from workflow/engine/src/BusinessModel/Trigger.php rename to workflow/engine/src/ProcessMaker/BusinessModel/Trigger.php index 5ae6bcdac..8b1fc7870 100644 --- a/workflow/engine/src/BusinessModel/Trigger.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Trigger.php @@ -1,5 +1,5 @@ throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $libraryFieldNameForException, $methodFieldNameForException); - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $trigger->throwExceptionIfNotExistsTrigger($triggerUid, "", $triggerUidFieldNameForException); @@ -303,7 +303,7 @@ class TriggerWizard array("paramDefinition" => $arrayMethodOutputParam, "paramData" => (isset($arrayParamData["output"]))? $arrayParamData["output"] : array()) ); - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); foreach ($arrayVerify as $key1 => $value1) { if (count($value1["paramDefinition"]) > 0) { @@ -491,7 +491,7 @@ class TriggerWizard //Verify data $this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $this->arrayFieldNameForException["libraryName"], $this->arrayFieldNameForException["methodName"]); - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $trigger->throwExceptionIfNotExistsTrigger($triggerUid, "", $this->arrayFieldNameForException["triggerUid"]); @@ -671,8 +671,8 @@ class TriggerWizard $arrayData = array_change_key_case($arrayData, CASE_UPPER); //Verify data - $process = new \BusinessModel\Process(); - $trigger = new \BusinessModel\Trigger(); + $process = new \ProcessMaker\BusinessModel\Process(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $this->throwExceptionIfNotExistsMethodInLibrary($libraryName, $methodName, $this->arrayFieldNameForException["libraryName"], $this->arrayFieldNameForException["methodName"]); @@ -745,8 +745,8 @@ class TriggerWizard $processUid = $arrayTriggerData["PRO_UID"]; //Verify data - $process = new \BusinessModel\Process(); - $trigger = new \BusinessModel\Trigger(); + $process = new \ProcessMaker\BusinessModel\Process(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false); diff --git a/workflow/engine/src/BusinessModel/User.php b/workflow/engine/src/ProcessMaker/BusinessModel/User.php similarity index 99% rename from workflow/engine/src/BusinessModel/User.php rename to workflow/engine/src/ProcessMaker/BusinessModel/User.php index baf8282b3..95fd73aa1 100644 --- a/workflow/engine/src/BusinessModel/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/User.php @@ -1,5 +1,5 @@ throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); @@ -158,7 +158,7 @@ class WebEntry } if ($dynaFormUid != "") { - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->throwExceptionIfNotExistsDynaForm($dynaFormUid, $processUid, $this->arrayFieldNameForException["dynaFormUid"]); } @@ -170,7 +170,7 @@ class WebEntry $task = new \Task(); $dynaForm = new \Dynaform(); - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $arrayDirFile = scandir($webEntryPath); //Ascending Order @@ -277,13 +277,13 @@ class WebEntry $arrayData = array_change_key_case($arrayData, CASE_UPPER); //Verify data - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); - $projectUser = new \BusinessModel\ProjectUser(); + $projectUser = new \ProcessMaker\BusinessModel\ProjectUser(); if ($arrayData["METHOD"] == "WS") { $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayUserFieldDefinition, $this->arrayFieldNameForException, true); @@ -297,7 +297,7 @@ class WebEntry $process->throwExceptionIfNotExistsTask($processUid, $arrayData["TAS_UID"], $this->arrayFieldNameForException["taskUid"]); - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["DYN_UID"], $processUid, $this->arrayFieldNameForException["dynaFormUid"]); @@ -327,7 +327,7 @@ class WebEntry $arrayDynaFormData = $dynaForm->Load($arrayData["DYN_UID"]); - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); if (!$step->existsRecord($arrayData["TAS_UID"], "DYNAFORM", $arrayData["DYN_UID"])) { throw (new \Exception(str_replace(array("{0}", "{1}"), array($arrayDynaFormData["DYN_TITLE"], $arrayTaskData["TAS_TITLE"]), "The DynaForm \"{0}\" isn't assigned to the task \"{1}\""))); diff --git a/workflow/engine/src/ProcessMaker/Services/Api.php b/workflow/engine/src/ProcessMaker/Services/Api.php index 0bca4307f..bcaf29d00 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api.php +++ b/workflow/engine/src/ProcessMaker/Services/Api.php @@ -39,7 +39,7 @@ abstract class Api public function getUserId() { - return \Services\Api\OAuth2\Server::getUserId(); + return \ProcessMaker\Services\OAuth2\Server::getUserId(); } } diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Calendar.php b/workflow/engine/src/ProcessMaker/Services/Api/Calendar.php similarity index 56% rename from workflow/engine/src/Services/Api/ProcessMaker/Calendar.php rename to workflow/engine/src/ProcessMaker/Services/Api/Calendar.php index 612b52aae..1f3ce9850 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Calendar.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Calendar.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $response = $calendar->getCalendars(array("filter" => $filter), null, null, $start, $limit); @@ -38,7 +38,7 @@ class Calendar extends Api public function doGet($cal_uid) { try { - $calendar = new \BusinessModel\Calendar(); + $calendar = new \ProcessMaker\BusinessModel\Calendar(); $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $response = $calendar->getCalendar($cal_uid); @@ -59,7 +59,7 @@ class Calendar extends Api public function doPost($request_data) { try { - $calendar = new \BusinessModel\Calendar(); + $calendar = new \ProcessMaker\BusinessModel\Calendar(); $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $arrayData = $calendar->create($request_data); @@ -71,5 +71,40 @@ class Calendar extends Api throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } } + + /** + * @url PUT /:cal_uid + * + * @param string $cal_uid {@min 32}{@max 32} + * @param array $request_data + */ + public function doPut($cal_uid, $request_data) + { + try { + $calendar = new \ProcessMaker\BusinessModel\Calendar(); + $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); + + $arrayData = $calendar->update($cal_uid, $request_data); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url DELETE /:cal_uid + * + * @param string $cal_uid {@min 32}{@max 32} + */ + public function doDelete($cal_uid) + { + try { + $calendar = new \ProcessMaker\BusinessModel\Calendar(); + $calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); + + $calendar->delete($cal_uid); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } } diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php similarity index 93% rename from workflow/engine/src/Services/Api/ProcessMaker/Cases.php rename to workflow/engine/src/ProcessMaker/Services/Api/Cases.php index d97610d01..ceb98c003 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -1,5 +1,5 @@ getList($dataList); return $response; } catch (\Exception $e) { @@ -81,7 +81,7 @@ class Cases extends Api */ public function doGetCasesListToDoPaged( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -101,7 +101,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -128,7 +128,7 @@ class Cases extends Api */ public function doGetCasesListDraft( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -148,7 +148,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -175,7 +175,7 @@ class Cases extends Api */ public function doGetCasesListDraftPaged( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -195,7 +195,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -222,7 +222,7 @@ class Cases extends Api */ public function doGetCasesListParticipated( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -242,7 +242,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -269,7 +269,7 @@ class Cases extends Api */ public function doGetCasesListParticipatedPaged( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -289,7 +289,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -316,7 +316,7 @@ class Cases extends Api */ public function doGetCasesListUnassigned( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -336,7 +336,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -363,7 +363,7 @@ class Cases extends Api */ public function doGetCasesListUnassignedPaged( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -383,7 +383,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -410,7 +410,7 @@ class Cases extends Api */ public function doGetCasesListPaused( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -430,7 +430,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -457,7 +457,7 @@ class Cases extends Api */ public function doGetCasesListPausedPaged( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -477,7 +477,7 @@ class Cases extends Api $dataList['category'] = $cat_uid; $dataList['process'] = $pro_uid; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -508,7 +508,7 @@ class Cases extends Api */ public function doGetCasesListAdvancedSearch( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -536,7 +536,7 @@ class Cases extends Api $dataList['dateFrom'] = $date_from; $dataList['dateTo'] = $date_to; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -567,7 +567,7 @@ class Cases extends Api */ public function doGetCasesListAdvancedSearchPaged( $start = 0, - $limit = 'config', + $limit = 0, $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -595,7 +595,7 @@ class Cases extends Api $dataList['dateFrom'] = $date_from; $dataList['dateTo'] = $date_to; $dataList['search'] = $search; - $oCases = new \BusinessModel\Cases(); + $oCases = new \ProcessMaker\BusinessModel\Cases(); $response = $oCases->getList($dataList); return $response; } catch (\Exception $e) { @@ -612,7 +612,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $oData = $cases->getCaseInfo($app_uid, $userUid); return $oData; } catch (\Exception $e) { @@ -629,7 +629,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $oData = $cases->getTaskCase($app_uid, $userUid); return $oData; } catch (\Exception $e) { @@ -649,7 +649,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $oData = $cases->addCase($pro_uid, $tas_uid, $userUid, $variables); return $oData; } catch (\Exception $e) { @@ -669,7 +669,7 @@ class Cases extends Api public function doPostCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables=null) { try { - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $oData = $cases->addCaseImpersonate($pro_uid, $usr_uid, $tas_uid, $variables); return $oData; } catch (\Exception $e) { @@ -689,7 +689,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->updateReassignCase($app_uid, $userUid, $del_index, $usr_uid_source, $usr_uid_target); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -706,7 +706,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->updateRouteCase($app_uid, $userUid, $del_index); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -727,7 +727,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->putCancelCase($cas_uid, $userUid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -749,7 +749,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); if ($unpaused_date == null) { $cases->putPauseCase($cas_uid, $userUid); } else { @@ -774,7 +774,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->putUnpauseCase($cas_uid, $userUid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -796,7 +796,7 @@ class Cases extends Api { try { $userUid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->putExecuteTriggerCase($cas_uid, $tri_uid, $userUid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -816,7 +816,7 @@ class Cases extends Api public function doDeleteCase($cas_uid) { try { - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->deleteCase($cas_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -836,7 +836,7 @@ class Cases extends Api public function doGetCaseVariables($app_uid) { try { - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $response = $cases->getCaseVariables($app_uid); return $response; } catch (\Exception $e) { @@ -858,7 +858,7 @@ class Cases extends Api public function doPutCaseVariables($app_uid, $request_data) { try { - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $cases->setCaseVariables($app_uid, $request_data); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -908,7 +908,7 @@ class Cases extends Api $dataList['search'] = $search; $usr_uid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList); return $response; } catch (\Exception $e) { @@ -957,7 +957,7 @@ class Cases extends Api $dataList['search'] = $search; $usr_uid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList); return $response; } catch (\Exception $e) { @@ -981,7 +981,7 @@ class Cases extends Api { try { $usr_uid = $this->getUserId(); - $cases = new \BusinessModel\Cases(); + $cases = new \ProcessMaker\BusinessModel\Cases(); $send_mail = ($send_mail == 0) ? false : true; $cases->saveCaseNote($app_uid, $usr_uid, $note_content, $send_mail); } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases/InputDocument.php similarity index 86% rename from workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php rename to workflow/engine/src/ProcessMaker/Services/Api/Cases/InputDocument.php index 69e413233..642cf5a4d 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases/InputDocument.php @@ -1,5 +1,5 @@ getUserId(); - $inputDocument = new \BusinessModel\Cases\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); $response = $inputDocument->getCasesInputDocuments($app_uid, $userUid); return $response; } catch (\Exception $e) { @@ -38,7 +38,7 @@ class InputDocument extends Api { try { $userUid = $this->getUserId(); - $inputDocument = new \BusinessModel\Cases\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); $response = $inputDocument->getCasesInputDocument($app_uid, $userUid, $inp_doc_uid); return $response; } catch (\Exception $e) { @@ -55,7 +55,7 @@ class InputDocument extends Api public function doDeleteInputDocument($app_uid, $inp_doc_uid) { try { - $inputDocument = new \BusinessModel\Cases\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); $inputDocument->removeInputDocument($inp_doc_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -73,7 +73,7 @@ class InputDocument extends Api { try { $userUid = $this->getUserId(); - $inputDocument = new \BusinessModel\Cases\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); $response = $inputDocument->addCasesInputDocument($app_uid, $tas_uid, $app_doc_comment, $inp_doc_uid, $userUid); return $response; } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases/OutputDocument.php similarity index 85% rename from workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php rename to workflow/engine/src/ProcessMaker/Services/Api/Cases/OutputDocument.php index 009891848..20d2d4fb3 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases/OutputDocument.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases/OutputDocument.php @@ -1,5 +1,5 @@ getUserId(); - $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument(); $response = $outputDocument->getCasesOutputDocuments($app_uid, $userUid); return $response; } catch (\Exception $e) { @@ -38,7 +38,7 @@ class OutputDocument extends Api { try { $userUid = $this->getUserId(); - $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument(); $response = $outputDocument->getCasesOutputDocument($app_uid, $userUid, $app_doc_uid); return $response; } catch (\Exception $e) { @@ -55,7 +55,7 @@ class OutputDocument extends Api public function doDeleteOutputDocument($app_uid, $app_doc_uid) { try { - $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument(); $outputDocument->removeOutputDocument($app_doc_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -71,7 +71,7 @@ class OutputDocument extends Api { try { $userUid = $this->getUserId(); - $outputDocument = new \BusinessModel\Cases\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument(); $response = $outputDocument->addCasesOutputDocument($app_uid, $out_doc_uid, $userUid); return $response; } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Department.php b/workflow/engine/src/ProcessMaker/Services/Api/Department.php similarity index 88% rename from workflow/engine/src/Services/Api/ProcessMaker/Department.php rename to workflow/engine/src/ProcessMaker/Services/Api/Department.php index 7f97e6b51..87a2df7c0 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Department.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Department.php @@ -1,5 +1,5 @@ getDepartments(); return $response; } catch (\Exception $e) { @@ -49,7 +49,7 @@ class Department extends Api public function doGetDepartment($dep_uid) { try { - $oDepartment = new \BusinessModel\Department(); + $oDepartment = new \ProcessMaker\BusinessModel\Department(); $response = $oDepartment->getDepartment($dep_uid); return $response; } catch (\Exception $e) { @@ -73,7 +73,7 @@ class Department extends Api public function doPost($request_data, $dep_title) { try { - $oDepartment = new \BusinessModel\Department(); + $oDepartment = new \ProcessMaker\BusinessModel\Department(); $response = $oDepartment->saveDepartment($request_data); return $response; } catch (\Exception $e) { @@ -98,7 +98,7 @@ class Department extends Api { try { $request_data['dep_uid'] = $dep_uid; - $oDepartment = new \BusinessModel\Department(); + $oDepartment = new \ProcessMaker\BusinessModel\Department(); $response = $oDepartment->saveDepartment($request_data, false); return $response; } catch (\Exception $e) { @@ -120,7 +120,7 @@ class Department extends Api public function doDelete($dep_uid) { try { - $oDepartment = new \BusinessModel\Department(); + $oDepartment = new \ProcessMaker\BusinessModel\Department(); $oDepartment->deleteDepartment($dep_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Group.php b/workflow/engine/src/ProcessMaker/Services/Api/Group.php similarity index 88% rename from workflow/engine/src/Services/Api/ProcessMaker/Group.php rename to workflow/engine/src/ProcessMaker/Services/Api/Group.php index 2856daf5b..5d370e16c 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Group.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Group.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $response = $group->getGroups(array("filter" => $filter), null, null, $start, $limit); @@ -36,7 +36,7 @@ class Group extends Api public function doGet($grp_uid) { try { - $group = new \BusinessModel\Group(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->setFormatFieldNameInUppercase(false); $response = $group->getGroup($grp_uid); @@ -57,7 +57,7 @@ class Group extends Api public function doPost($request_data) { try { - $group = new \BusinessModel\Group(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->setFormatFieldNameInUppercase(false); $arrayData = $group->create($request_data); @@ -79,7 +79,7 @@ class Group extends Api public function doPut($grp_uid, $request_data) { try { - $group = new \BusinessModel\Group(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->setFormatFieldNameInUppercase(false); $arrayData = $group->update($grp_uid, $request_data); @@ -96,7 +96,7 @@ class Group extends Api public function doDelete($grp_uid) { try { - $group = new \BusinessModel\Group(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->setFormatFieldNameInUppercase(false); $group->delete($grp_uid); @@ -113,7 +113,7 @@ class Group extends Api public function doGetUsers($grp_uid, $filter = null, $start = null, $limit = null) { try { - $group = new \BusinessModel\Group(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->setFormatFieldNameInUppercase(false); $response = $group->getUsers("USERS", $grp_uid, array("filter" => $filter), null, null, $start, $limit); @@ -132,7 +132,7 @@ class Group extends Api public function doGetAvailableUsers($grp_uid, $filter = null, $start = null, $limit = null) { try { - $group = new \BusinessModel\Group(); + $group = new \ProcessMaker\BusinessModel\Group(); $group->setFormatFieldNameInUppercase(false); $response = $group->getUsers("AVAILABLE-USERS", $grp_uid, array("filter" => $filter), null, null, $start, $limit); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Group/User.php b/workflow/engine/src/ProcessMaker/Services/Api/Group/User.php similarity index 86% rename from workflow/engine/src/Services/Api/ProcessMaker/Group/User.php rename to workflow/engine/src/ProcessMaker/Services/Api/Group/User.php index 77c8132c3..a55ff2075 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Group/User.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Group/User.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $arrayData = $groupUser->create($grp_uid, $request_data); @@ -40,7 +40,7 @@ class User extends Api public function doDeleteUser($grp_uid, $usr_uid) { try { - $groupUser = new \BusinessModel\Group\User(); + $groupUser = new \ProcessMaker\BusinessModel\Group\User(); $groupUser->setFormatFieldNameInUppercase(false); $groupUser->delete($grp_uid, $usr_uid); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Pmtable.php b/workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php similarity index 90% rename from workflow/engine/src/Services/Api/ProcessMaker/Pmtable.php rename to workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php index 0f618c033..4bcdac5c2 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Pmtable.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Pmtable.php @@ -1,5 +1,5 @@ getTables(); return $response; } catch (\Exception $e) { @@ -42,7 +42,7 @@ class Pmtable extends Api public function doGetPmTable($pmt_uid) { try { - $oPmTable = new \BusinessModel\Table(); + $oPmTable = new \ProcessMaker\BusinessModel\Table(); $response = $oPmTable->getTable($pmt_uid); return $response; } catch (\Exception $e) { @@ -62,7 +62,7 @@ class Pmtable extends Api public function doGetPmTableData($pmt_uid) { try { - $oPmTable = new \BusinessModel\Table(); + $oPmTable = new \ProcessMaker\BusinessModel\Table(); $response = $oPmTable->getTableData($pmt_uid); return $response; } catch (\Exception $e) { @@ -88,7 +88,7 @@ class Pmtable extends Api $pmt_tab_dsc = '' ) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->saveTable($request_data); if (isset($response['pro_uid'])) { unset($response['pro_uid']); @@ -118,7 +118,7 @@ class Pmtable extends Api $pmt_rows = '' ) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->saveTableData($pmt_uid, $request_data); return $response; } catch (\Exception $e) { @@ -145,7 +145,7 @@ class Pmtable extends Api ) { try { $request_data['pmt_uid'] = $pmt_uid; - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->updateTable($request_data); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -170,7 +170,7 @@ class Pmtable extends Api $pmt_rows = '' ) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->updateTableData($pmt_uid, $request_data); return $response; } catch (\Exception $e) { @@ -191,7 +191,7 @@ class Pmtable extends Api public function doDeletePmTable($pmt_uid) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->deleteTable($pmt_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -226,7 +226,7 @@ class Pmtable extends Api if ($key3 != '') { $rows[$key3] = $value3; } - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->deleteTableData($pmt_uid, $rows); return $response; } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Process.php b/workflow/engine/src/ProcessMaker/Services/Api/Process.php similarity index 93% rename from workflow/engine/src/Services/Api/ProcessMaker/Process.php rename to workflow/engine/src/ProcessMaker/Services/Api/Process.php index 5e1500344..d8070507d 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Process.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Process.php @@ -1,5 +1,5 @@ loadAllProcess($arrayFilterData, $start, $limit); // Composing Response @@ -48,7 +48,7 @@ class Process extends Api $response = array(); try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $data = $process->loadProcess($processUid); @@ -68,7 +68,7 @@ class Process extends Api defined('SYS_LANG') || define("SYS_LANG", $request_data["lang"]); try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $userUid = $this->getUserId(); return $process->createProcess($userUid, $request_data); @@ -83,7 +83,7 @@ class Process extends Api $response = array(); try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $userUid = $this->getUserId(); $data = $process->updateProcess($processUid, $userUid, $request_data); @@ -104,7 +104,7 @@ class Process extends Api $response = array(); try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $result = $process->deleteProcess($processUid, (($checkCases && $checkCases == 1)? true : false)); @@ -128,7 +128,7 @@ class Process extends Api try { $task1 = new \Task(); - $task2 = new \BusinessModel\Task(); + $task2 = new \ProcessMaker\BusinessModel\Task(); $arrayData = $task1->load($activityUid); @@ -206,7 +206,7 @@ class Process extends Api $response = array(); try { - $task2 = new \BusinessModel\Task(); + $task2 = new \ProcessMaker\BusinessModel\Task(); $arrayData = array( "_extended" => array( @@ -242,7 +242,7 @@ class Process extends Api $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $data = $task->getStepsList($activityUid, $processUid, false, $start, $limit); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/ProcessCategory.php b/workflow/engine/src/ProcessMaker/Services/Api/ProcessCategory.php new file mode 100644 index 000000000..fe4116731 --- /dev/null +++ b/workflow/engine/src/ProcessMaker/Services/Api/ProcessCategory.php @@ -0,0 +1,105 @@ +setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); + + $response = $processCategory->getCategories(array("filter" => $filter), null, null, $start, $limit); + + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url GET /:cat_uid + * + * @param string $cat_uid {@min 32}{@max 32} + */ + public function doGetCategory($cat_uid) + { + try { + $processCategory = new \ProcessMaker\BusinessModel\ProcessCategory(); + $processCategory->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); + + $response = $processCategory->getCategory($cat_uid); + + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url POST + * + * @param string $cat_name + * + */ + public function doPostCategory($cat_name) + { + try { + $processCategory = new \ProcessMaker\BusinessModel\ProcessCategory(); + $response = $processCategory->addCategory($cat_name); + + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url PUT /:cat_uid + * + * @param string $cat_uid {@min 32}{@max 32} + * @param string $cat_name + * + */ + public function doPutCategory($cat_uid, $cat_name) + { + try { + $processCategory = new \ProcessMaker\BusinessModel\ProcessCategory(); + $response = $processCategory->updateCategory($cat_uid, $cat_name); + + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * @url DELETE /:cat_uid + * + * @param string $cat_uid {@min 32}{@max 32} + * + */ + public function doDeleteCategory($cat_uid) + { + try { + $processCategory = new \ProcessMaker\BusinessModel\ProcessCategory(); + $processCategory->deleteCategory($cat_uid); + + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } +} \ No newline at end of file diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project.php b/workflow/engine/src/ProcessMaker/Services/Api/Project.php similarity index 92% rename from workflow/engine/src/Services/Api/ProcessMaker/Project.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project.php index aa6733106..a97d0b25a 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -125,7 +125,7 @@ class Project extends Api public function doPutProcess($prj_uid, $request_data) { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -143,7 +143,7 @@ class Project extends Api public function doGetDynaForms($prj_uid) { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -163,7 +163,7 @@ class Project extends Api public function doGetInputDocuments($prj_uid) { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -183,7 +183,7 @@ class Project extends Api public function doGetWebEntries($prj_uid) { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -203,7 +203,7 @@ class Project extends Api public function doGetVariables($prj_uid) { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -225,7 +225,7 @@ class Project extends Api public function doGetGridVariables($prj_uid, $grid_uid = "") { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -245,7 +245,7 @@ class Project extends Api public function doGetTriggerWizards($prj_uid) { try { - $process = new \BusinessModel\Process(); + $process = new \ProcessMaker\BusinessModel\Process(); $process->setFormatFieldNameInUppercase(false); $process->setArrayFieldNameForException(array("processUid" => "prj_uid", "libraryName" => "lib_name", "methodName" => "fn_name")); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php similarity index 95% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/Activity.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php index 7a1dc208a..e65d2e8b5 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity.php @@ -1,5 +1,5 @@ getProperties($prj_uid, $act_uid, true, false); foreach ($properties as $key => $value) { if (in_array($key, $hiddenFields)) { @@ -77,7 +77,7 @@ class Activity extends Api if (isset($request_data['properties']['tas_start'])) { unset($request_data['properties']['tas_start']); } - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $properties = $task->updateProperties($prj_uid, $act_uid, $request_data); } catch (\Exception $e) { throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); @@ -99,7 +99,7 @@ class Activity extends Api public function doDeleteProjectActivity($prj_uid, $act_uid) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->deleteTask($prj_uid, $act_uid); } catch (\Exception $e) { throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); @@ -115,7 +115,7 @@ class Activity extends Api public function doGetActivitySteps($act_uid, $prj_uid) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->setFormatFieldNameInUppercase(false); $task->setArrayParamException(array("taskUid" => "act_uid", "stepUid" => "step_uid")); @@ -135,7 +135,7 @@ class Activity extends Api public function doGetActivityAvailableSteps($act_uid, $prj_uid) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->setFormatFieldNameInUppercase(false); $task->setArrayParamException(array("taskUid" => "act_uid")); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Assignee.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Assignee.php similarity index 91% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Assignee.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Assignee.php index 4ea804e05..dbcb53a84 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Assignee.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Assignee.php @@ -1,5 +1,5 @@ getTaskAssignees($prjUid, $actUid, $filter, $start, $limit, $type); //Response $response = $arrayData; @@ -52,7 +52,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $arrayData = $task->getTaskAvailableAssignee($prjUid, $actUid, $filter, $start, $limit, $type); //Response $response = $arrayData; @@ -75,7 +75,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $objectData = $task->getTaskAssignee($prjUid, $actUid, $aasUid); //Response $response = $objectData; @@ -99,7 +99,7 @@ class Assignee extends Api public function doPostActivityAssignee($prjUid, $actUid, $aas_uid, $aas_type) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->addTaskAssignee($prjUid, $actUid, $aas_uid, $aas_type); } catch (\Exception $e) { //Response @@ -118,7 +118,7 @@ class Assignee extends Api public function doDeleteActivityAssignee($prjUid, $actUid, $aasUid) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->removeTaskAssignee($prjUid, $actUid, $aasUid); } catch (\Exception $e) { //Response @@ -141,7 +141,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $arrayData = $task->getTaskAdhocAssignees($prjUid, $actUid, $filter, $start, $limit, $type); //Response $response = $arrayData; @@ -167,7 +167,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $arrayData = $task->getTaskAvailableAdhocAssignee($prjUid, $actUid, $filter, $start, $limit, $type); //Response $response = $arrayData; @@ -190,7 +190,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $objectData = $task->getTaskAdhocAssignee($prjUid, $actUid, $aasUid); //Response $response = $objectData; @@ -214,7 +214,7 @@ class Assignee extends Api public function doPostActivityAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type); } catch (\Exception $e) { //Response @@ -233,7 +233,7 @@ class Assignee extends Api public function doDeleteActivityAdhocAssignee($prjUid, $actUid, $adaUid) { try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid); } catch (\Exception $e) { //Response @@ -256,7 +256,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $arrayData = $task->getTaskAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type); //Response $response = $arrayData; @@ -282,7 +282,7 @@ class Assignee extends Api { $response = array(); try { - $task = new \BusinessModel\Task(); + $task = new \ProcessMaker\BusinessModel\Task(); $arrayData = $task->getTaskAdhocAssigneesAll($prjUid, $actUid, $filter, $start, $limit, $type); //Response $response = $arrayData; diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Step.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Step.php similarity index 93% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Step.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Step.php index 0cba109aa..285fd4930 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Step.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Step.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -58,7 +58,7 @@ class Step extends Api $step_mode = "EDIT" ) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -97,7 +97,7 @@ class Step extends Api $step_mode = "EDIT" ) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -117,7 +117,7 @@ class Step extends Api public function doDeleteActivityStep($step_uid, $act_uid, $prj_uid) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -137,7 +137,7 @@ class Step extends Api public function doGetActivityStepTriggers($step_uid, $act_uid, $prj_uid) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -160,7 +160,7 @@ class Step extends Api public function doGetActivityStepAvailableTriggers($step_uid, $act_uid, $prj_uid, $type) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -183,7 +183,7 @@ class Step extends Api public function doGetActivityStepAssignTaskTriggers($act_uid, $prj_uid) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); @@ -205,7 +205,7 @@ class Step extends Api public function doGetActivityStepAssignTaskAvailableTriggers($act_uid, $prj_uid, $type) { try { - $step = new \BusinessModel\Step(); + $step = new \ProcessMaker\BusinessModel\Step(); $step->setFormatFieldNameInUppercase(false); $step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid")); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Step/Trigger.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Step/Trigger.php similarity index 91% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Step/Trigger.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Step/Trigger.php index 5a9a063bf..8f602248a 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Activity/Step/Trigger.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Activity/Step/Trigger.php @@ -1,5 +1,5 @@ getTrigger($stepUid, strtoupper($type), $activityUid, $triggerUid); @@ -48,7 +48,7 @@ class Trigger extends Api try { $request_data = (array)($request_data); - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $arrayData = $stepTrigger->create($stepUid, $request_data["st_type"], $activityUid, $request_data["tri_uid"], $request_data); } catch (\Exception $e) { @@ -70,7 +70,7 @@ class Trigger extends Api try { $request_data = (array)($request_data); - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $arrayData = $stepTrigger->update($stepUid, $request_data["st_type"], $activityUid, $triggerUid, $request_data); } catch (\Exception $e) { @@ -90,7 +90,7 @@ class Trigger extends Api public function doDeleteActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type) { try { - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $stepTrigger->delete($stepUid, strtoupper($type), $activityUid, $triggerUid); } catch (\Exception $e) { @@ -111,7 +111,7 @@ class Trigger extends Api public function doGetActivityStepAssignTaskTrigger($triggerUid, $activityUid, $projectUid, $type) { try { - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $response = $stepTrigger->getTrigger("", strtoupper(str_replace("-", "_", $type)), $activityUid, $triggerUid); @@ -135,7 +135,7 @@ class Trigger extends Api try { $request_data = (array)($request_data); - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $arrayData = $stepTrigger->create("", $request_data["st_type"], $activityUid, $request_data["tri_uid"], $request_data); } catch (\Exception $e) { @@ -156,7 +156,7 @@ class Trigger extends Api try { $request_data = (array)($request_data); - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $arrayData = $stepTrigger->update("", $request_data["st_type"], $activityUid, $triggerUid, $request_data); } catch (\Exception $e) { @@ -175,7 +175,7 @@ class Trigger extends Api public function doDeleteActivityStepAssignTaskTrigger($triggerUid, $activityUid, $projectUid, $type) { try { - $stepTrigger = new \BusinessModel\Step\Trigger(); + $stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger(); $stepTrigger->delete("", strtoupper(str_replace("-", "_", $type)), $activityUid, $triggerUid); } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/CaseScheduler.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/CaseScheduler.php similarity index 92% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/CaseScheduler.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/CaseScheduler.php index f5f7c51a8..fb766c4a5 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/CaseScheduler.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/CaseScheduler.php @@ -1,5 +1,5 @@ getCaseSchedulers($prjUid); //Response $response = $arrayData; @@ -39,7 +39,7 @@ class CaseScheduler extends Api public function doGetProjectCaseScheduler($prjUid, $caseSchedulerUid) { try { - $caseScheduler = new \BusinessModel\CaseScheduler(); + $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler(); $objectData = $caseScheduler->getCaseScheduler($prjUid, $caseSchedulerUid); //Response $response = $objectData; @@ -63,7 +63,7 @@ class CaseScheduler extends Api try { $userUid = $this->getUserId(); $request_data = (array)($request_data); - $caseScheduler = new \BusinessModel\CaseScheduler(); + $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler(); $objectData = $caseScheduler->addCaseScheduler($prjUid, $request_data, $userUid); //Response $response = $objectData; @@ -87,7 +87,7 @@ class CaseScheduler extends Api try { $userUid = $this->getUserId(); $request_data = (array)($request_data); - $caseScheduler = new \BusinessModel\CaseScheduler(); + $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler(); $objectData = $caseScheduler->updateCaseScheduler($prjUid, $request_data, $userUid, $schUid); //Response $response = $objectData; @@ -107,7 +107,7 @@ class CaseScheduler extends Api public function doDeleteProjectCaseScheduler($prjUid, $schUid) { try { - $caseScheduler = new \BusinessModel\CaseScheduler(); + $caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler(); $caseScheduler->deleteCaseScheduler($schUid); } catch (\Exception $e) { //response diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/CaseTracker.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/CaseTracker.php similarity index 86% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/CaseTracker.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/CaseTracker.php index bf9ad2b7b..31fc0d7d6 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/CaseTracker.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/CaseTracker.php @@ -1,5 +1,5 @@ getCaseTracker($prj_uid); @@ -46,7 +46,7 @@ class CaseTracker extends Api $message_history = 0 ) { try { - $caseTracker = new \BusinessModel\CaseTracker(); + $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker(); $arrayData = $caseTracker->update($prj_uid, $request_data); } catch (\Exception $e) { @@ -62,7 +62,7 @@ class CaseTracker extends Api public function doGetCaseTrackerObjects($prj_uid) { try { - $caseTracker = new \BusinessModel\CaseTracker(); + $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker(); $response = $caseTracker->getCaseTrackerObjects($prj_uid); @@ -80,7 +80,7 @@ class CaseTracker extends Api public function doGetCaseTrackerAvailableObjects($prj_uid) { try { - $caseTracker = new \BusinessModel\CaseTracker(); + $caseTracker = new \ProcessMaker\BusinessModel\CaseTracker(); $response = $caseTracker->getAvailableCaseTrackerObjects($prj_uid); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/CaseTrackerObject.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/CaseTrackerObject.php similarity index 88% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/CaseTrackerObject.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/CaseTrackerObject.php index f3268ec0f..434bd6e3e 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/CaseTrackerObject.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/CaseTrackerObject.php @@ -1,5 +1,5 @@ getCaseTrackerObject($cto_uid); @@ -51,7 +51,7 @@ class CaseTrackerObject extends Api $cto_position = 1 ) { try { - $caseTrackerObject = new \BusinessModel\CaseTrackerObject(); + $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject(); $arrayData = $caseTrackerObject->create($prj_uid, $request_data); @@ -84,7 +84,7 @@ class CaseTrackerObject extends Api $cto_position = 1 ) { try { - $caseTrackerObject = new \BusinessModel\CaseTrackerObject(); + $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject(); $arrayData = $caseTrackerObject->update($cto_uid, $request_data); } catch (\Exception $e) { @@ -101,7 +101,7 @@ class CaseTrackerObject extends Api public function doDeleteCaseTrackerObject($cto_uid, $prj_uid) { try { - $caseTrackerObject = new \BusinessModel\CaseTrackerObject(); + $caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject(); $caseTrackerObject->delete($cto_uid); } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/DataBaseConnection.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/DataBaseConnection.php similarity index 91% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/DataBaseConnection.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/DataBaseConnection.php index 7f898eb0c..8db262c42 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/DataBaseConnection.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/DataBaseConnection.php @@ -1,5 +1,5 @@ getDataBaseConnections($prj_uid); return $response; } catch (\Exception $e) { @@ -46,7 +46,7 @@ class DataBaseConnection extends Api public function doGetDataBaseConnection($prj_uid, $dbs_uid) { try { - $oDBConnection = new \BusinessModel\DataBaseConnection(); + $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection(); $response = $oDBConnection->getDataBaseConnection($prj_uid, $dbs_uid); return $response; } catch (\Exception $e) { @@ -86,7 +86,7 @@ class DataBaseConnection extends Api $dbs_description = '' ) { try { - $oDBConnection = new \BusinessModel\DataBaseConnection(); + $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection(); $request_data['pro_uid'] = $prj_uid; $response = $oDBConnection->testConnection($request_data, true); return $response; @@ -128,7 +128,7 @@ class DataBaseConnection extends Api $dbs_description = '' ) { try { - $oDBConnection = new \BusinessModel\DataBaseConnection(); + $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection(); $response = $oDBConnection->saveDataBaseConnection($prj_uid, $request_data, true); return $response; } catch (\Exception $e) { @@ -171,7 +171,7 @@ class DataBaseConnection extends Api ) { try { $request_data['dbs_uid'] = $dbs_uid; - $oDBConnection = new \BusinessModel\DataBaseConnection(); + $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection(); $response = $oDBConnection->saveDataBaseConnection($prj_uid, $request_data); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -191,7 +191,7 @@ class DataBaseConnection extends Api public function doDeleteDataBaseConnection($prj_uid, $dbs_uid) { try { - $oDBConnection = new \BusinessModel\DataBaseConnection(); + $oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection(); $response = $oDBConnection->deleteDataBaseConnection($prj_uid, $dbs_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/DynaForm.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/DynaForm.php similarity index 88% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/DynaForm.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/DynaForm.php index aceb1c613..a8c78edd2 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/DynaForm.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/DynaForm.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $response = $dynaForm->getDynaForm($dyn_uid); @@ -42,7 +42,7 @@ class DynaForm extends Api public function doPostDynaForm($prj_uid, $request_data) { try { - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->setFormatFieldNameInUppercase(false); $dynaForm->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -66,7 +66,7 @@ class DynaForm extends Api public function doPutDynaForm($dyn_uid, $prj_uid, $request_data) { try { - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->setFormatFieldNameInUppercase(false); $arrayData = $dynaForm->update($dyn_uid, $request_data); @@ -84,7 +84,7 @@ class DynaForm extends Api public function doDeleteDynaForm($dyn_uid, $prj_uid) { try { - $dynaForm = new \BusinessModel\DynaForm(); + $dynaForm = new \ProcessMaker\BusinessModel\DynaForm(); $dynaForm->setFormatFieldNameInUppercase(false); $dynaForm->delete($dyn_uid); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Event.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Event.php similarity index 95% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/Event.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/Event.php index 73a1fae80..d1e5efbfe 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Event.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Event.php @@ -1,5 +1,5 @@ getEvents($prj_uid, $filter); foreach ($response as &$eventData) { foreach ($eventData as $key => $value) { @@ -65,7 +65,7 @@ class Event extends Api $hiddenFields = array('pro_uid', 'evn_action_parameters', 'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts' ); - $event = new \BusinessModel\Event(); + $event = new \ProcessMaker\BusinessModel\Event(); $response = $event->getEvents($prj_uid, '', $evn_uid); foreach ($response as $key => $eventData) { if (in_array($key, $hiddenFields)) { @@ -125,7 +125,7 @@ class Event extends Api $hiddenFields = array('pro_uid', 'evn_action_parameters', 'evn_posx', 'evn_posy', 'evn_type', 'tas_evn_uid', 'evn_max_attempts' ); - $event = new \BusinessModel\Event(); + $event = new \ProcessMaker\BusinessModel\Event(); $response = $event->saveEvents($prj_uid, $request_data, true); foreach ($response as $key => $eventData) { if (in_array($key, $hiddenFields)) { @@ -193,7 +193,7 @@ class Event extends Api 'evn_max_attempts' ); $request_data['evn_uid'] = $evn_uid; - $event = new \BusinessModel\Event(); + $event = new \ProcessMaker\BusinessModel\Event(); $event->saveEvents($prj_uid, $request_data); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -216,7 +216,7 @@ class Event extends Api public function doDeleteEvent($prj_uid, $evn_uid) { try { - $event = new \BusinessModel\Event(); + $event = new \ProcessMaker\BusinessModel\Event(); $response = $event->deleteEvent($prj_uid, $evn_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/FilesManager.php similarity index 89% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/FilesManager.php index bb36189d5..2f744e76e 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/FilesManager.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/FilesManager.php @@ -1,5 +1,5 @@ getProcessFilesManagerPath($prj_uid, $path); } else { @@ -48,7 +48,7 @@ class FilesManager extends Api $userUid = $this->getUserId(); $request_data = (array)($request_data); $request_data = array_merge(array('prf_content' => $prf_content ), $request_data); - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $arrayData = $filesManager->addProcessFilesManager($prj_uid, $userUid, $request_data); //Response $response = $arrayData; @@ -68,7 +68,7 @@ class FilesManager extends Api public function doPostProcessFilesManagerUpload($prj_uid, $prf_uid) { try { - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $sData = $filesManager->uploadProcessFilesManager($prj_uid, $prf_uid); //Response $response = $sData; @@ -90,7 +90,7 @@ class FilesManager extends Api try { $userUid = $this->getUserId(); $request_data = (array)($request_data); - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $arrayData = $filesManager->updateProcessFilesManager($prj_uid, $userUid, $request_data, $prf_uid); //Response $response = $arrayData; @@ -110,7 +110,7 @@ class FilesManager extends Api public function doDeleteProcessFilesManager($prj_uid, $prf_uid) { try { - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $filesManager->deleteProcessFilesManager($prj_uid, $prf_uid); } catch (\Exception $e) { //response @@ -127,7 +127,7 @@ class FilesManager extends Api public function doGetProcessFilesManagerDownload($prj_uid, $prf_uid) { try { - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $filesManager->downloadProcessFilesManager($prj_uid, $prf_uid); } catch (\Exception $e) { //response @@ -144,7 +144,7 @@ class FilesManager extends Api public function doDeleteFolderProcessFilesManager($prj_uid, $path) { try { - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $filesManager->deleteFolderProcessFilesManager($prj_uid, $path); } catch (\Exception $e) { //response @@ -162,7 +162,7 @@ class FilesManager extends Api public function doGetProcessFileManager($prj_uid, $prf_uid) { try { - $filesManager = new \BusinessModel\FilesManager(); + $filesManager = new \ProcessMaker\BusinessModel\FilesManager(); $response = $filesManager->getProcessFileManager($prj_uid, $prf_uid); //response return $response; diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/InputDocument.php similarity index 88% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/InputDocument.php index a74275552..1ed147b51 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/InputDocument.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -43,7 +43,7 @@ class InputDocument extends Api public function doPostInputDocument($prj_uid, $request_data) { try { - $inputDocument = new \BusinessModel\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\InputDocument(); $inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -67,7 +67,7 @@ class InputDocument extends Api public function doPutInputDocument($inp_doc_uid, $prj_uid, $request_data) { try { - $inputDocument = new \BusinessModel\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\InputDocument(); $inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -86,7 +86,7 @@ class InputDocument extends Api public function doDeleteInputDocument($inp_doc_uid, $prj_uid) { try { - $inputDocument = new \BusinessModel\InputDocument(); + $inputDocument = new \ProcessMaker\BusinessModel\InputDocument(); $inputDocument->setFormatFieldNameInUppercase(false); $inputDocument->setArrayFieldNameForException(array("processUid" => "prj_uid")); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php similarity index 92% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php index 9732cb87b..524130d9a 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php @@ -1,5 +1,5 @@ getOutputDocuments($prjUid); //Response $response = $arrayData; @@ -39,7 +39,7 @@ class OutputDocuments extends Api public function doGetProjectOutputDocument($prjUid, $outputDocumentUid) { try { - $outputDocument = new \BusinessModel\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument(); $objectData = $outputDocument->getOutputDocument($prjUid, $outputDocumentUid); //Response $response = $objectData; @@ -62,7 +62,7 @@ class OutputDocuments extends Api { try { $request_data = (array)($request_data); - $outputDocument = new \BusinessModel\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument(); $arrayData = $outputDocument->addOutputDocument($prjUid, $request_data); //Response $response = $arrayData; @@ -85,7 +85,7 @@ class OutputDocuments extends Api { try { $request_data = (array)($request_data); - $outputDocument = new \BusinessModel\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument(); $arrayData = $outputDocument->updateOutputDocument($prjUid, $request_data, $outputDocumentUid, 0); } catch (\Exception $e) { //Response @@ -102,7 +102,7 @@ class OutputDocuments extends Api public function doDeleteProjectOutputDocument($prjUid, $outputDocumentUid) { try { - $outputDocument = new \BusinessModel\OutputDocument(); + $outputDocument = new \ProcessMaker\BusinessModel\OutputDocument(); $outputDocument->deleteOutputDocument($prjUid, $outputDocumentUid); } catch (\Exception $e) { //Response diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/ProcessPermissions.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/ProcessPermissions.php similarity index 92% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/ProcessPermissions.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/ProcessPermissions.php index 731ef01bd..081036292 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/ProcessPermissions.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/ProcessPermissions.php @@ -1,5 +1,5 @@ getProcessPermissions($prj_uid); return $response; } catch (\Exception $e) { @@ -51,7 +51,7 @@ class ProcessPermissions extends Api public function doGetProcessPermission($prj_uid, $ob_uid) { try { - $processPermissions = new \BusinessModel\ProcessPermissions(); + $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions(); $response = $processPermissions->getProcessPermissions($prj_uid, $ob_uid); return $response; } catch (\Exception $e) { @@ -104,7 +104,7 @@ class ProcessPermissions extends Api 'object_type', 'object', 'participated', 'action' ); $request_data['pro_uid'] = $prj_uid; - $processPermissions = new \BusinessModel\ProcessPermissions(); + $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions(); $response = $processPermissions->saveProcessPermission($request_data); foreach ($response as $key => $eventData) { if (in_array($key, $hiddenFields)) { @@ -160,7 +160,7 @@ class ProcessPermissions extends Api ) { try { $request_data['pro_uid'] = $prj_uid; - $processPermissions = new \BusinessModel\ProcessPermissions(); + $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions(); $response = $processPermissions->saveProcessPermission($request_data, $ob_uid); return $response; } catch (\Exception $e) { @@ -183,7 +183,7 @@ class ProcessPermissions extends Api public function doDeleteProcessPermission($prj_uid, $ob_uid) { try { - $processPermissions = new \BusinessModel\ProcessPermissions(); + $processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions(); $response = $processPermissions->deleteProcessPermission($ob_uid, $prj_uid); return $response; } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/ProcessSupervisors.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/ProcessSupervisors.php similarity index 88% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/ProcessSupervisors.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/ProcessSupervisors.php index d6bddfaec..03909dbb9 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/ProcessSupervisors.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/ProcessSupervisors.php @@ -1,5 +1,5 @@ getProcessSupervisors($prjUid); //Response $response = $arrayData; @@ -39,7 +39,7 @@ class ProcessSupervisors extends Api public function doGetProcessSupervisor($prjUid, $puUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->getProcessSupervisor($prjUid, $puUid); //Response $response = $objectData; @@ -59,7 +59,7 @@ class ProcessSupervisors extends Api public function doGetAvailableSupervisors($prjUid, $obj_type = '') { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $arrayData = $supervisor->getAvailableProcessSupervisors($obj_type, $prjUid); //Response $response = $arrayData; @@ -79,7 +79,7 @@ class ProcessSupervisors extends Api public function doGetProcessSupervisorDynaforms($prjUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $arrayData = $supervisor->getProcessSupervisorDynaforms($prjUid); //Response $response = $arrayData; @@ -99,7 +99,7 @@ class ProcessSupervisors extends Api public function doGetProcessSupervisorDynaform($prjUid, $pudUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->getProcessSupervisorDynaform($prjUid, $pudUid); //Response $response = $objectData; @@ -118,7 +118,7 @@ class ProcessSupervisors extends Api public function doGetAvailableProcessSupervisorDynaform($prjUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $arrayData = $supervisor->getAvailableProcessSupervisorDynaform($prjUid); //Response $response = $arrayData; @@ -137,7 +137,7 @@ class ProcessSupervisors extends Api public function doGetProcessSupervisorInputDocuments($prjUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $arrayData = $supervisor->getProcessSupervisorInputDocuments($prjUid); //Response $response = $arrayData; @@ -157,7 +157,7 @@ class ProcessSupervisors extends Api public function doGetProcessSupervisorInputDocument($prjUid, $puiUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->getProcessSupervisorInputDocument($prjUid, $puiUid); //Response $response = $objectData; @@ -176,7 +176,7 @@ class ProcessSupervisors extends Api public function doGetAvailableProcessSupervisorInputDocument($prjUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $arrayData = $supervisor->getAvailableProcessSupervisorInputDocument($prjUid); //Response $response = $arrayData; @@ -199,7 +199,7 @@ class ProcessSupervisors extends Api public function doPostProcessSupervisor($prjUid, $usr_uid, $pu_type) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->addProcessSupervisor($prjUid, $usr_uid, $pu_type); //Response $response = $objectData; @@ -222,7 +222,7 @@ class ProcessSupervisors extends Api public function doPostProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position=null) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->addProcessSupervisorDynaform($prjUid, $dyn_uid, $pud_position); //Response $response = $objectData; @@ -245,7 +245,7 @@ class ProcessSupervisors extends Api public function doPostProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position=null) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->addProcessSupervisorInputDocument($prjUid, $inp_doc_uid, $pui_position); //Response $response = $objectData; @@ -266,7 +266,7 @@ class ProcessSupervisors extends Api public function doDeleteSupervisor($prjUid, $puUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $supervisor->removeProcessSupervisor($prjUid, $puUid); } catch (\Exception $e) { //response @@ -284,7 +284,7 @@ class ProcessSupervisors extends Api public function doDeleteDynaformSupervisor($prjUid, $pudUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $supervisor->removeDynaformSupervisor($prjUid, $pudUid); ob_end_clean(); } catch (\Exception $e) { @@ -303,7 +303,7 @@ class ProcessSupervisors extends Api public function doDeleteInputDocumentSupervisor($prjUid, $puiUid) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $supervisor->removeInputDocumentSupervisor($prjUid, $puiUid); ob_end_clean(); } catch (\Exception $e) { @@ -324,7 +324,7 @@ class ProcessSupervisors extends Api public function doPutProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position = null) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->updateProcessSupervisorDynaform($prjUid, $pud_uid, $pud_position); //Response $response = $objectData; @@ -347,7 +347,7 @@ class ProcessSupervisors extends Api public function doPutProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position = null) { try { - $supervisor = new \BusinessModel\ProcessSupervisor(); + $supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor(); $objectData = $supervisor->updateProcessSupervisorInputDocument($prjUid, $pui_uid, $pui_position); //Response $response = $objectData; diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/ProjectUsers.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/ProjectUsers.php similarity index 89% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/ProjectUsers.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/ProjectUsers.php index f16c86ac2..8cbccf45c 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/ProjectUsers.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/ProjectUsers.php @@ -1,5 +1,5 @@ getProjectUsers($prj_uid); //Response $response = $arrayData; @@ -38,7 +38,7 @@ class ProjectUsers extends Api public function doGetProjectStartingTasks($prj_uid) { try { - $startingTasks = new \BusinessModel\ProjectUser(); + $startingTasks = new \ProcessMaker\BusinessModel\ProjectUser(); $arrayData = $startingTasks->getProjectStartingTasks($prj_uid); //Response $response = $arrayData; @@ -58,7 +58,7 @@ class ProjectUsers extends Api public function doGetProjectStartingTaskUsers($prj_uid, $usr_uid) { try { - $startingTasks = new \BusinessModel\ProjectUser(); + $startingTasks = new \ProcessMaker\BusinessModel\ProjectUser(); $arrayData = $startingTasks->getProjectStartingTaskUsers($prj_uid, $usr_uid); //Response $response = $arrayData; @@ -80,7 +80,7 @@ class ProjectUsers extends Api { try { $request_data = (array)($request_data); - $user = new \BusinessModel\ProjectUser(); + $user = new \ProcessMaker\BusinessModel\ProjectUser(); $objectData = $user->postProjectWsUserCanStartTask($prj_uid, $act_uid, $request_data); //Response $response = $objectData; diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/ReportTable.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php similarity index 90% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/ReportTable.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php index 97b9a3c8b..4b1a20fad 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/ReportTable.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/ReportTable.php @@ -1,5 +1,5 @@ getTables($prj_uid, true); return $response; } catch (\Exception $e) { @@ -46,7 +46,7 @@ class ReportTable extends Api public function doGetReportTable($prj_uid, $rep_uid) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->getTable($rep_uid, $prj_uid, true); return $response; } catch (\Exception $e) { @@ -66,7 +66,7 @@ class ReportTable extends Api public function doGetPopulateReportTable($prj_uid, $rep_uid) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->generateDataReport($prj_uid, $rep_uid); return $response; } catch (\Exception $e) { @@ -86,7 +86,7 @@ class ReportTable extends Api public function doGetReportTableData($prj_uid, $rep_uid) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->getTableData($rep_uid, $prj_uid, true); return $response; } catch (\Exception $e) { @@ -121,7 +121,7 @@ class ReportTable extends Api $rep_tab_grid = '' ) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->saveTable($request_data, $prj_uid, true); if (isset($response['pro_uid'])) { unset($response['pro_uid']); @@ -153,7 +153,7 @@ class ReportTable extends Api ) { try { $request_data['rep_uid'] = $rep_uid; - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->updateTable($request_data, $prj_uid, true); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -173,7 +173,7 @@ class ReportTable extends Api public function doDeleteReportTable($prj_uid, $rep_uid) { try { - $oReportTable = new \BusinessModel\Table(); + $oReportTable = new \ProcessMaker\BusinessModel\Table(); $response = $oReportTable->deleteTable($rep_uid, $prj_uid, true); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/SubProcess.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/SubProcess.php similarity index 90% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/SubProcess.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/SubProcess.php index 0132aaf06..5953173e9 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/SubProcess.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/SubProcess.php @@ -1,5 +1,5 @@ getSubprocesss($prj_uid, $tas_uid); foreach ($response as $key => $value) { if (in_array($key, $hiddenFields)) { @@ -57,7 +57,7 @@ class Subprocess extends Api public function doPutSubprocess($prj_uid, $tas_uid, $request_data) { try { - $oSubProcess = new \BusinessModel\Subprocess(); + $oSubProcess = new \ProcessMaker\BusinessModel\Subprocess(); $oSubProcess->putSubprocesss($prj_uid, $tas_uid, $request_data); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/Trigger.php similarity index 91% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/Trigger.php index 322505091..14a5a2501 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/Trigger.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/Trigger.php @@ -1,5 +1,5 @@ getTriggers($projectUid); return $response; } catch (\Exception $e) { @@ -46,7 +46,7 @@ class Trigger extends Api public function doGetTrigger($projectUid, $triggerUid) { try { - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $response = $trigger->getDataTrigger($triggerUid); return $response; } catch (\Exception $e) { @@ -73,7 +73,7 @@ class Trigger extends Api public function doPostTrigger($projectUid, $request_data, $tri_title, $tri_description = '', $tri_type = 'SCRIPT', $tri_webbot = '', $tri_param = '') { try { - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $response = $trigger->saveTrigger($projectUid, $request_data, true); return $response; } catch (\Exception $e) { @@ -101,7 +101,7 @@ class Trigger extends Api { try { $request_data['tri_uid'] = $triggerUid; - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $trigger->saveTrigger($projectUid, $request_data, false, $triggerUid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -121,7 +121,7 @@ class Trigger extends Api public function doDeleteTrigger($projectUid, $triggerUid) { try { - $trigger = new \BusinessModel\Trigger(); + $trigger = new \ProcessMaker\BusinessModel\Trigger(); $response = $trigger->deleteTrigger($triggerUid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/TriggerWizard.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/TriggerWizard.php similarity index 91% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/TriggerWizard.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/TriggerWizard.php index 820a4718d..b7f4c29e2 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/TriggerWizard.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/TriggerWizard.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); @@ -53,7 +53,7 @@ class TriggerWizard extends Api public function doGetTriggerWizardTrigger($prj_uid, $lib_name, $fn_name, $tri_uid) { try { - $triggerWizard = new \BusinessModel\TriggerWizard(); + $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard(); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); @@ -78,7 +78,7 @@ class TriggerWizard extends Api public function doPostTriggerWizard($prj_uid, $lib_name, $fn_name, $request_data) { try { - $triggerWizard = new \BusinessModel\TriggerWizard(); + $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard(); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); @@ -104,7 +104,7 @@ class TriggerWizard extends Api public function doPutTriggerWizard($prj_uid, $lib_name, $fn_name, $tri_uid, $request_data) { try { - $triggerWizard = new \BusinessModel\TriggerWizard(); + $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard(); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/WebEntry.php similarity index 89% rename from workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php rename to workflow/engine/src/ProcessMaker/Services/Api/Project/WebEntry.php index fbe0c06ad..70bbac8cd 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/WebEntry.php @@ -1,5 +1,5 @@ setFormatFieldNameInUppercase(false); $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -44,7 +44,7 @@ class WebEntry extends Api public function doPostWebEntry($prj_uid, $request_data) { try { - $webEntry = new \BusinessModel\WebEntry(); + $webEntry = new \ProcessMaker\BusinessModel\WebEntry(); $webEntry->setFormatFieldNameInUppercase(false); $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); @@ -68,7 +68,7 @@ class WebEntry extends Api public function doDeleteWebEntry($dyn_uid, $tas_uid, $prj_uid) { try { - $webEntry = new \BusinessModel\WebEntry(); + $webEntry = new \ProcessMaker\BusinessModel\WebEntry(); $webEntry->setFormatFieldNameInUppercase(false); $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/System.php b/workflow/engine/src/ProcessMaker/Services/Api/System.php similarity index 83% rename from workflow/engine/src/Services/Api/ProcessMaker/System.php rename to workflow/engine/src/ProcessMaker/Services/Api/System.php index 941639b9e..aba83efad 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/System.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/System.php @@ -1,5 +1,5 @@ getDbEngines(); return $response; } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Test.php b/workflow/engine/src/ProcessMaker/Services/Api/Test.php similarity index 98% rename from workflow/engine/src/Services/Api/ProcessMaker/Test.php rename to workflow/engine/src/ProcessMaker/Services/Api/Test.php index dd9e7b086..bb6e6bfb4 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Test.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Test.php @@ -1,5 +1,5 @@ getUsers($filter, $start, $limit); return $response; } catch (\Exception $e) { @@ -36,7 +36,7 @@ class User extends Api public function doGetUser($usr_uid) { try { - $user = new \BusinessModel\User(); + $user = new \ProcessMaker\BusinessModel\User(); $response = $user->getUser($usr_uid); return $response; } catch (\Exception $e) { @@ -54,7 +54,7 @@ class User extends Api public function doPostUser($request_data) { try { - $user = new \BusinessModel\User(); + $user = new \ProcessMaker\BusinessModel\User(); $arrayData = $user->create($request_data); $response = $arrayData; return $response; @@ -73,7 +73,7 @@ class User extends Api { try { $userLoggedUid = $this->getUserId(); - $user = new \BusinessModel\User(); + $user = new \ProcessMaker\BusinessModel\User(); $arrayData = $user->update($usr_uid, $request_data, $userLoggedUid); $response = $arrayData; return $response; @@ -90,7 +90,7 @@ class User extends Api public function doDeleteUser($usr_uid) { try { - $user = new \BusinessModel\User(); + $user = new \ProcessMaker\BusinessModel\User(); $user->delete($usr_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); @@ -105,7 +105,7 @@ class User extends Api public function doPostUserImageUpload($usr_uid) { try { - $user = new \BusinessModel\User(); + $user = new \ProcessMaker\BusinessModel\User(); $user->uploadImage($usr_uid); } catch (\Exception $e) { //response diff --git a/workflow/engine/src/Services/Api/OAuth2/PmPdo.php b/workflow/engine/src/ProcessMaker/Services/OAuth2/PmPdo.php similarity index 99% rename from workflow/engine/src/Services/Api/OAuth2/PmPdo.php rename to workflow/engine/src/ProcessMaker/Services/OAuth2/PmPdo.php index 4872825a2..e1d0099de 100644 --- a/workflow/engine/src/Services/Api/OAuth2/PmPdo.php +++ b/workflow/engine/src/ProcessMaker/Services/OAuth2/PmPdo.php @@ -1,6 +1,6 @@ setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); - - $response = $processCategory->getCategories(array("filter" => $filter), null, null, $start, $limit); - - return $response; - } catch (\Exception $e) { - throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); - } - } -} - diff --git a/workflow/engine/src/Services/api.ini b/workflow/engine/src/Services/api.ini deleted file mode 100644 index 1d9365fd5..000000000 --- a/workflow/engine/src/Services/api.ini +++ /dev/null @@ -1,68 +0,0 @@ -; -; API Rest Configuration File -; - -debug = 1 - -[api] - version = 1.0 - vendor = "ProcessMaker - Michelangelo (Enterprise)" - -[alias: test] - test2 = "Services\Api\ProcessMaker\Test2" - test3 = "Services\Api\ProcessMaker\Test3" - -[alias: project] - activity = "Services\Api\ProcessMaker\Project\Activity" - step = "Services\Api\ProcessMaker\Project\Activity\Step" - assignee = "Services\Api\ProcessMaker\Project\Activity\Assignee" - trigger = "Services\Api\ProcessMaker\Project\Activity\Step\Trigger" - project = "Services\Api\ProcessMaker\Project" - trigger2 = "Services\Api\ProcessMaker\Project\Trigger" - event = "Services\Api\ProcessMaker\Project\Event" - dynaform = "Services\Api\ProcessMaker\Project\DynaForm" - input-document = "Services\Api\ProcessMaker\Project\InputDocument" - output-documents = "Services\Api\ProcessMaker\Project\OutputDocuments" - supervisors = "Services\Api\ProcessMaker\Project\ProcessSupervisors" - process-permissions = "Services\Api\ProcessMaker\Project\ProcessPermissions" - case-scheduler = "Services\Api\ProcessMaker\Project\CaseScheduler" - case-tracker = "Services\Api\ProcessMaker\Project\CaseTracker" - case-tracker-object = "Services\Api\ProcessMaker\Project\CaseTrackerObject" - project-users = "Services\Api\ProcessMaker\Project\ProjectUsers" - web-entry = "Services\Api\ProcessMaker\Project\WebEntry" - data-base-connections = "Services\Api\ProcessMaker\Project\DataBaseConnection" - files-manager = "Services\Api\ProcessMaker\Project\FilesManager" - report-Table = "Services\Api\ProcessMaker\Project\ReportTable" - sub-process= "Services\Api\ProcessMaker\Project\SubProcess" - trigger-wizard = "Services\Api\ProcessMaker\Project\TriggerWizard" - category = "Services\Api\ProcessMaker\ProcessCategory" - -[alias: projects] - project = "Services\Api\ProcessMaker\Project" - -[alias: group] - group = "Services\Api\ProcessMaker\Group" - user = "Services\Api\ProcessMaker\Group\User" - -[alias: groups] - group = "Services\Api\ProcessMaker\Group" - -[alias: user] - user = "Services\Api\ProcessMaker\User" - -[alias: users] - user = "Services\Api\ProcessMaker\User" - -[alias: calendar] - calendar = "Services\Api\ProcessMaker\Calendar" - -[alias: calendars] - calendar = "Services\Api\ProcessMaker\Calendar" - -[alias: case] - case = "Services\Api\ProcessMaker\Case" - -[alias: cases] - case = "Services\Api\ProcessMaker\Case" - input-document = "Services\Api\ProcessMaker\Cases\InputDocument" - output-document = "Services\Api\ProcessMaker\Cases\OutputDocument" \ No newline at end of file diff --git a/workflow/engine/src/Tests/BusinessModel/CalendarTest.php b/workflow/engine/src/Tests/BusinessModel/CalendarTest.php index 1b50d56fc..7614b2c97 100644 --- a/workflow/engine/src/Tests/BusinessModel/CalendarTest.php +++ b/workflow/engine/src/Tests/BusinessModel/CalendarTest.php @@ -14,7 +14,7 @@ class CalendarTest extends \PHPUnit_Framework_TestCase { public function testGetCalendars() { - $calendar = new \BusinessModel\Calendar(); + $calendar = new \ProcessMaker\BusinessModel\Calendar(); $arrayCalendar = $calendar->getCalendars(); diff --git a/workflow/engine/src/Tests/BusinessModel/CasesActionTest13_17.php b/workflow/engine/src/Tests/BusinessModel/CasesActionTest13_17.php index 861b7a7d3..aab2a9d87 100644 --- a/workflow/engine/src/Tests/BusinessModel/CasesActionTest13_17.php +++ b/workflow/engine/src/Tests/BusinessModel/CasesActionTest13_17.php @@ -45,7 +45,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase $idCaseDraft = PMFNewCase($proUid, $usrUid, $tasUid, array()); $this->idCaseDraft = $idCaseDraft; - $this->oCases = new \BusinessModel\Cases(); + $this->oCases = new \ProcessMaker\BusinessModel\Cases(); $listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001')); $this->nowCountTodo = $listToDo['total']; @@ -59,7 +59,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::putCancelCase + * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @@ -74,7 +74,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::putCancelCase + * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase * @expectedException Exception * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @@ -89,7 +89,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Cases::putCancelCase + * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string. * @@ -104,7 +104,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Cases::putCancelCase + * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase * @expectedException Exception * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @@ -119,7 +119,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in third field the function * - * @covers \BusinessModel\Cases::putCancelCase + * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$del_index' it must be a integer. * @@ -134,7 +134,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test for cancel case * - * @covers \BusinessModel\Cases::putCancelCase + * @covers \ProcessMaker\BusinessModel\Cases::putCancelCase * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -142,7 +142,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase public function testPutCancelCase() { $this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001'); - $this->oCases = new \BusinessModel\Cases(); + $this->oCases = new \ProcessMaker\BusinessModel\Cases(); $listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft')); $this->assertNotEquals($this->nowCountDraft, $listDraft['total']); } @@ -150,7 +150,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @@ -165,7 +165,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * @expectedException Exception * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @@ -180,7 +180,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string. * @@ -195,7 +195,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * @expectedException Exception * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @@ -210,7 +210,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in third field the function * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$del_index' it must be a integer. * @@ -225,7 +225,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in fourth field the function * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * @expectedException Exception * @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'. * @@ -240,7 +240,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test for cancel case * - * @covers \BusinessModel\Cases::putPauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putPauseCase * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -248,7 +248,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase public function testPutPauseCase() { $this->oCases->putPauseCase($this->idCaseToDo, '00000000000000000000000000000001'); - $this->oCases = new \BusinessModel\Cases(); + $this->oCases = new \ProcessMaker\BusinessModel\Cases(); $listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused')); $this->assertNotEquals($this->nowCountPaused, $listPaused['total']); } @@ -256,7 +256,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::putUnpauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @@ -271,7 +271,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::putUnpauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase * @expectedException Exception * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @@ -286,7 +286,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Cases::putUnpauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string. * @@ -301,7 +301,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Cases::putUnpauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase * @expectedException Exception * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @@ -316,7 +316,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in third field the function * - * @covers \BusinessModel\Cases::putUnpauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$del_index' it must be a integer. * @@ -331,7 +331,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test for cancel case * - * @covers \BusinessModel\Cases::putUnpauseCase + * @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -339,7 +339,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase public function testPutUnpauseCase() { $this->oCases->putUnpauseCase($this->idCaseToDo, '00000000000000000000000000000001'); - $this->oCases = new \BusinessModel\Cases(); + $this->oCases = new \ProcessMaker\BusinessModel\Cases(); $listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused')); $this->assertEquals($this->nowCountPaused, $listPaused['total']); } @@ -347,7 +347,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::deleteCase + * @covers \ProcessMaker\BusinessModel\Cases::deleteCase * @expectedException Exception * @expectedExceptionMessage Invalid value for '$app_uid' it must be a string. * @@ -362,7 +362,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::deleteCase + * @covers \ProcessMaker\BusinessModel\Cases::deleteCase * @expectedException Exception * @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist. * @@ -377,7 +377,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase /** * Test for cancel case * - * @covers \BusinessModel\Cases::deleteCase + * @covers \ProcessMaker\BusinessModel\Cases::deleteCase * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -385,7 +385,7 @@ class CasesAction13_17Test extends \PHPUnit_Framework_TestCase public function testDeleteCase() { $this->oCases->deleteCase($this->idCaseToDo); - $this->oCases = new \BusinessModel\Cases(); + $this->oCases = new \ProcessMaker\BusinessModel\Cases(); $listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001')); $this->assertNotEquals($this->nowCountTodo, $listToDo['total']); } diff --git a/workflow/engine/src/Tests/BusinessModel/CasesTest.php b/workflow/engine/src/Tests/BusinessModel/CasesTest.php index bcaccb004..227d77c22 100644 --- a/workflow/engine/src/Tests/BusinessModel/CasesTest.php +++ b/workflow/engine/src/Tests/BusinessModel/CasesTest.php @@ -28,14 +28,14 @@ class CasesTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->oCases = new \BusinessModel\Cases(); + $this->oCases = new \ProcessMaker\BusinessModel\Cases(); return true; } /** * Test error for type in first field the function * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage Invalid value for '$dataList' it must be an array. * @@ -50,7 +50,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for empty userId in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The user with userId: '' does not exist. * @@ -65,7 +65,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for not exists userId in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The user with userId: 'IdDoesNotExists' does not exist. * @@ -80,7 +80,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for incorrect value $action in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The value for $action is incorrect. * @@ -95,7 +95,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for incorrect value $process in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The process with $pro_uid: 'IdDoesNotExists' does not exist. * @@ -113,7 +113,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for incorrect value $process in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The category with $cat_uid: 'IdDoesNotExists' does not exist. * @@ -131,7 +131,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for incorrect value $process in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist. * @@ -149,7 +149,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for incorrect value $process in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'. * @@ -167,7 +167,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test error for incorrect value $process in array * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * @expectedException Exception * @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'. * @@ -185,7 +185,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list to do not paged * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -208,7 +208,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list to do * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -231,7 +231,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list draft not paged * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -254,7 +254,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list draft * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -277,7 +277,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list participated not paged * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -300,7 +300,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list participated * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -323,7 +323,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list unassigned not paged * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -346,7 +346,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list unassigned * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -369,7 +369,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list search not paged * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -396,7 +396,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get list search * - * @covers \BusinessModel\Cases::getList + * @covers \ProcessMaker\BusinessModel\Cases::getList * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -423,7 +423,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test add Case * - * @covers \BusinessModel\Cases::addCase + * @covers \ProcessMaker\BusinessModel\Cases::addCase * * @copyright Colosa - Bolivia */ @@ -438,7 +438,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get Task Case * - * @covers \BusinessModel\Cases::getTaskCase + * @covers \ProcessMaker\BusinessModel\Cases::getTaskCase * @depends testAddCase * @param array $aResponse * @@ -453,7 +453,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test get Case Info * - * @covers \BusinessModel\Cases::getCaseInfo + * @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo * @depends testAddCase * @param array $aResponse * @@ -468,7 +468,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test put reassign case * - * @covers \BusinessModel\Cases::getCaseInfo + * @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo * @depends testAddCase * @param array $aResponse * @@ -483,7 +483,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test add Case to test route case * - * @covers \BusinessModel\Cases::addCase + * @covers \ProcessMaker\BusinessModel\Cases::addCase * * @copyright Colosa - Bolivia */ @@ -498,7 +498,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test put route case * - * @covers \BusinessModel\Cases::updateRouteCase + * @covers \ProcessMaker\BusinessModel\Cases::updateRouteCase * @depends testAddCaseRouteCase * @param array $aResponseRouteCase * @@ -513,7 +513,7 @@ class CasesTest extends \PHPUnit_Framework_TestCase /** * Test add Case impersonate * - * @covers \BusinessModel\Cases::addCaseImpersonate + * @covers \ProcessMaker\BusinessModel\Cases::addCaseImpersonate * * @copyright Colosa - Bolivia */ diff --git a/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php b/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php index d926483d2..a3b63a7ba 100644 --- a/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php +++ b/workflow/engine/src/Tests/BusinessModel/DepartmentTest.php @@ -28,14 +28,14 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->oDepartment = new \BusinessModel\Department(); + $this->oDepartment = new \ProcessMaker\BusinessModel\Department(); return true; } /** * Test error for type in first field the function * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage Invalid value for '$dep_data' it must be an array. * @@ -50,7 +50,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for type in second field the function * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage Invalid value for '$create' it must be a boolean. * @@ -65,7 +65,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for empty array in first field the function * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The field '$dep_data' is empty. * @@ -80,7 +80,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for create department with nonexistent dep_parent * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The departament with dep_parent: 'testUidDepartment' does not exist. * @@ -96,7 +96,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for create department with nonexistent dep_manager * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The user with dep_manager: 'testUidUser' does not exist. * @@ -112,7 +112,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for create department with incorrect dep_status * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The departament with dep_status: 'SUPER ACTIVO' is incorrect. * @@ -128,7 +128,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for create department untitled * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The field dep_title is required. * @@ -144,7 +144,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Save department parent * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @return array * * @author Brayan Pereyra (Cochalo) @@ -169,7 +169,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * * @depends testCreateDepartmentParent * @param array $dep_data, Data for parent department - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists. * @@ -185,7 +185,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase /** * Test error for create department untitled * - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The departament with dep_uid: 'testUidDepartment' does not exist. * @@ -203,7 +203,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * * @depends testCreateDepartmentParent * @param array $dep_data, Data for parent department - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @return array * * @author Brayan Pereyra (Cochalo) @@ -235,7 +235,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @depends testCreateDepartmentChild * @param array $dep_data, Data for parent department * @param array $child_data, Data for child department - * @covers \BusinessModel\Department::saveDepartment + * @covers \ProcessMaker\BusinessModel\Department::saveDepartment * @expectedException Exception * @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists. * @return array @@ -259,7 +259,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @depends testCreateDepartmentChild * @param array $dep_data, Data for parent department * @param array $child_data, Data for child department - * @covers \BusinessModel\Department::getDepartments + * @covers \ProcessMaker\BusinessModel\Department::getDepartments * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -290,7 +290,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * * @depends testCreateDepartmentParent * @param array $dep_data, Data for parent department - * @covers \BusinessModel\Department::getDepartment + * @covers \ProcessMaker\BusinessModel\Department::getDepartment * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia @@ -319,7 +319,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @depends testCreateDepartmentChild * @param array $dep_data, Data for parent department * @param array $child_data, Data for child department - * @covers \BusinessModel\Department::deleteDepartment + * @covers \ProcessMaker\BusinessModel\Department::deleteDepartment * @expectedException Exception * @expectedExceptionMessage Can not delete the department, it has a children department. * @@ -338,7 +338,7 @@ class DepartmentTest extends \PHPUnit_Framework_TestCase * @depends testCreateDepartmentChild * @param array $dep_data, Data for parent department * @param array $child_data, Data for child department - * @covers \BusinessModel\Department::deleteDepartment + * @covers \ProcessMaker\BusinessModel\Department::deleteDepartment * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia diff --git a/workflow/engine/src/Tests/BusinessModel/InputDocumentsCasesTest.php b/workflow/engine/src/Tests/BusinessModel/InputDocumentsCasesTest.php index 33787addd..f06d8ee5d 100644 --- a/workflow/engine/src/Tests/BusinessModel/InputDocumentsCasesTest.php +++ b/workflow/engine/src/Tests/BusinessModel/InputDocumentsCasesTest.php @@ -27,7 +27,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->oInputDocument = new \BusinessModel\Cases\InputDocument(); + $this->oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument(); } /** @@ -57,7 +57,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase /** * Test get InputDocuments * - * @covers \BusinessModel\Cases\InputDocument::getCasesInputDocuments + * @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments * @depends testAddInputDocument * @param array $aResponse * @@ -72,7 +72,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase /** * Test get InputDocument * - * @covers \BusinessModel\Cases\InputDocument::getCasesInputDocument + * @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument * @depends testAddInputDocument * @param array $aResponse * @@ -87,7 +87,7 @@ class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase /** * Test remove InputDocument * - * @covers \BusinessModel\Cases\InputDocument::removeInputDocument + * @covers \ProcessMaker\BusinessModel\Cases\InputDocument::removeInputDocument * @depends testAddInputDocument * @param array $aResponse * diff --git a/workflow/engine/src/Tests/BusinessModel/OutputDocumentsCasesTest.php b/workflow/engine/src/Tests/BusinessModel/OutputDocumentsCasesTest.php index 5d578b4dc..c48fa1512 100644 --- a/workflow/engine/src/Tests/BusinessModel/OutputDocumentsCasesTest.php +++ b/workflow/engine/src/Tests/BusinessModel/OutputDocumentsCasesTest.php @@ -27,13 +27,13 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->oOutputDocument = new \BusinessModel\Cases\OutputDocument(); + $this->oOutputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument(); } /** * Test add OutputDocument * - * @covers \BusinessModel\Cases\OutputDocument::addCasesOutputDocument + * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::addCasesOutputDocument * * @copyright Colosa - Bolivia */ @@ -56,7 +56,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase /** * Test get OutputDocuments * - * @covers \BusinessModel\Cases\OutputDocument::getCasesOutputDocuments + * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocuments * @depends testAddCasesOutputDocument * @param array $aResponse * @@ -71,7 +71,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase /** * Test get OutputDocument * - * @covers \BusinessModel\Cases\OutputDocument::getCasesOutputDocument + * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument * @depends testAddCasesOutputDocument * @param array $aResponse * @@ -86,7 +86,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase /** * Test remove OutputDocument * - * @covers \BusinessModel\Cases\OutputDocument::removeOutputDocument + * @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::removeOutputDocument * @depends testAddCasesOutputDocument * @param array $aResponse * diff --git a/workflow/engine/src/Tests/BusinessModel/ProcessCategoryTest.php b/workflow/engine/src/Tests/BusinessModel/ProcessCategoryTest.php index 1d36f6b2c..312bdf343 100644 --- a/workflow/engine/src/Tests/BusinessModel/ProcessCategoryTest.php +++ b/workflow/engine/src/Tests/BusinessModel/ProcessCategoryTest.php @@ -48,7 +48,7 @@ class ProcessCategoryTest extends \PHPUnit_Framework_TestCase public function testGetCategories() { - $processCategory = new \BusinessModel\ProcessCategory(); + $processCategory = new \ProcessMaker\BusinessModel\ProcessCategory(); $arrayProcessCategory = $processCategory->getCategories(); diff --git a/workflow/public_html/testInput.php b/workflow/public_html/testInput.php deleted file mode 100644 index ff2a28d51..000000000 --- a/workflow/public_html/testInput.php +++ /dev/null @@ -1,23 +0,0 @@ -'@'.$file, 'inp_doc_uid'=>$inp_doc_uid, 'tas_uid' =>$tas_uid, 'app_doc_comment' =>$app_doc_comment); -curl_setopt($ch, CURLOPT_URL,$url); -curl_setopt($ch, CURLOPT_HTTPHEADER,$headr); -curl_setopt($ch, CURLOPT_POSTFIELDS, $a); -print "

post

"; -print_r($a); -curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); -$postResult = curl_exec($ch); -curl_close($ch); -print "

response var_dump

"; -var_dump($postResult); -print ""; \ No newline at end of file