Merge remote branch 'upstream/master'

This commit is contained in:
Marco Antonio Nina
2014-04-03 08:47:31 -04:00
90 changed files with 1341 additions and 691 deletions

View File

@@ -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": "<pro_uid>",
"tas_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_<case_number>"
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": "<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_<case_number>"
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/<case_number>/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_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
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": "<case_number>",
"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/<case_number>/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"
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_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
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/<app_uid>/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_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
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/<app_uid>/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_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
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/<app_uid>/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_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
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/<app_uid>/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_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
Examples:
| test_description | case_number |
| | |
Scenario: Delete a case
Given PUT this data:
"""
{
}
"""
And I request "cases/<app_uid>"
Then the response status code should be 200
And the content type is "application/json"
And the response charset is "UTF-8"
And the type is "object"
And that I want to update a resource with the key "case_number" stored in session array as variable "caseNumber_<case_number>"
And that I want to update a resource with the key "caseId" stored in session array as variable "caseId_<case_number>"
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

View File

@@ -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

View File

@@ -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=<start>&limit=<limit>"
Given I request "cases/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has <records> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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=<start>&limit=<limit>"
Given I request "cases/draft/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has <records> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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=<start>&limit=<limit>"
Given I request "cases/participated/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has <records> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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=<start>&limit=<limit>"
Given I request "cases/Unassigned/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has <records> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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=<start>&limit=<limit>"
Given I request "cases/paused/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has <records> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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=<start>&limit=<limit>"
Given I request "cases/advanced-search/paged?start=<start>&limit=<limit>"
Then the response status code should be <http_code>
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has <records> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> 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> records in property "data"
And the response has <records> records
Examples:

View File

@@ -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 "<records>"
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 "<records>"
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 "<records>"
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 "<records>"
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 "<records>"
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 "<records>"
And the response status message should have the following text "Records"

View File

@@ -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, "<?php return " . var_export($config, true).";");
Util\Logger::log("Configuration cache was loaded and cached to: $cachedConfig");
} else {
Util\Logger::log("Loading Api Configuration from: $cachedConfig");
}
}
// Setting current workspace to Api class
\ProcessMaker\Services\Api::setWorkspace(SYS_SYS);
// TODO remove this setting on the future, it is not needed, but if it is not present is throwing a warning
//\Luracast\Restler\Format\HtmlFormat::$viewPath = $servicesDir . 'oauth2/views';
Services\Api::setWorkspace(SYS_SYS);
// create a new Restler instance
//$rest = new \Luracast\Restler\Restler();
@@ -179,20 +196,13 @@ class WebApplication
// Setting database connection source
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
$port = empty($port) ? '' : ";port=$port";
\Services\Api\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port);
Services\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port);
// Setting default OAuth Client id, for local PM Web Designer
\Services\Api\OAuth2\Server::setPmClientId($pmOauthClientId);
Services\OAuth2\Server::setPmClientId($pmOauthClientId);
require_once $this->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);

View File

@@ -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(

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class Calendar
{
@@ -267,13 +267,13 @@ class Calendar
unset($arrayData["CAL_UID"]);
//Verify data
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$process->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
@@ -245,7 +245,7 @@ class CaseScheduler
public function addCaseScheduler($sProcessUID, $aData, $userUID)
{
try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
$aData['sch_repeat_stop_if_running'] = '0';
$aData['case_sh_plugin_uid'] = null;
$aData = array_change_key_case($aData, CASE_UPPER);
@@ -530,7 +530,7 @@ class CaseScheduler
public function updateCaseScheduler($sProcessUID, $aData, $userUID, $sSchUID = '')
{
try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
$aData = array_change_key_case($aData, CASE_UPPER);
if (empty( $aData )) {
die( 'The information sended is empty!' );
@@ -827,7 +827,7 @@ class CaseScheduler
public function deleteCaseScheduler($sSchUID)
{
try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes". PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "CaseScheduler.php");
$oCaseScheduler = new \CaseScheduler();
if (!isset($sSchUID)) {
return;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class CaseTracker
{

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class CaseTrackerObject
{
@@ -81,7 +81,7 @@ class CaseTrackerObject
throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_UID_OBJ")), "The \"{0}\" attribute is not defined")));
}
$step = new \BusinessModel\Step();
$step = new \ProcessMaker\BusinessModel\Step();
$msg = $step->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"]);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \UsersPeer;
@@ -61,7 +61,7 @@ class Cases
if ($start != 0) {
$start--;
}
if ($limit == 'config' || (abs((int)$limit)) == 0) {
if ((abs((int)$limit)) == 0) {
G::LoadClass("configuration");
$conf = new \Configurations();
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel\Cases;
namespace ProcessMaker\BusinessModel\Cases;
class InputDocument
{
@@ -21,7 +21,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;
@@ -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;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel\Cases;
namespace ProcessMaker\BusinessModel\Cases;
class OutputDocument
{
@@ -19,7 +19,7 @@ class OutputDocument
$fields = $oCase->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();

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \DbSource;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \UsersPeer;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class DynaForm
{
@@ -358,7 +358,7 @@ class DynaForm
unset($arrayData["PMTABLE"]);
//Verify data
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$process->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"]);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
/**
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class Group
{
@@ -189,7 +189,7 @@ class Group
unset($arrayData["GRP_UID"]);
//Verify data
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$process->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"]);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel\Group;
namespace ProcessMaker\BusinessModel\Group;
class User
{
@@ -144,8 +144,8 @@ class User
unset($arrayData["GRP_UID"]);
//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"]);
@@ -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"]);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class InputDocument
{
@@ -209,7 +209,7 @@ class InputDocument
unset($arrayData["INP_DOC_UID"]);
//Verify data
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$process->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
@@ -239,7 +239,7 @@ class OutputDocument
}
}
try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
$aData = array_change_key_case($aData, CASE_UPPER);
$aData['PRO_UID'] = $sProcessUID;
//Verify data
@@ -350,9 +350,9 @@ class OutputDocument
public function deleteOutputDocument($sProcessUID, $sOutputDocumentUID)
{
try {
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "OutputDocument.php");
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "ObjectPermission.php");
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Step.php");
require_once(PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Step.php");
\G::LoadClass( 'processMap' );
$oOutputDocument = new \OutputDocument();
$fields = $oOutputDocument->load( $sOutputDocumentUID );

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use G;
use Criteria;
@@ -520,7 +520,7 @@ class Process
}
if (isset($arrayData["PRO_CALENDAR"]) && $arrayData["PRO_CALENDAR"] . "" != "") {
$calendar = new \BusinessModel\Calendar();
$calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class ProcessCategory
{
@@ -96,7 +96,6 @@ class ProcessCategory
{
try {
$criteria = new \Criteria("workflow");
$criteria->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;
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \Cases;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class Step
{
@@ -498,7 +498,7 @@ class Step
try {
$arrayStep = array();
$step = new \BusinessModel\Step();
$step = new \ProcessMaker\BusinessModel\Step();
$step->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();

View File

@@ -1,7 +1,7 @@
<?php
namespace BusinessModel\Step;
namespace ProcessMaker\BusinessModel\Step;
use \BusinessModel\Step;
use \ProcessMaker\BusinessModel\Step;
class Trigger
{
@@ -330,7 +330,7 @@ class Trigger
}
//Get data
$trigger = new \BusinessModel\Trigger();
$trigger = new \ProcessMaker\BusinessModel\Trigger();
$criteria = $trigger->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') {

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \SubProcessPeer;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \AdditionalTables;

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
use \ProcessMaker\Util;
@@ -636,7 +636,7 @@ class Task
try {
$arrayStep = array();
$step = new \BusinessModel\Step();
$step = new \ProcessMaker\BusinessModel\Step();
$step->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$step->setArrayParamException($this->arrayParamException);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class Trigger
{

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class TriggerWizard
{
@@ -165,7 +165,7 @@ class TriggerWizard
//Verify data
$this->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
use \G;
class User

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
/**
* Validator fields

View File

@@ -1,5 +1,5 @@
<?php
namespace BusinessModel;
namespace ProcessMaker\BusinessModel;
class WebEntry
{
@@ -149,7 +149,7 @@ class WebEntry
$arrayData = array();
//Verify data
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$process->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}\"")));

View File

@@ -39,7 +39,7 @@ abstract class Api
public function getUserId()
{
return \Services\Api\OAuth2\Server::getUserId();
return \ProcessMaker\Services\OAuth2\Server::getUserId();
}
}

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class Calendar extends Api
public function index($filter = null, $start = null, $limit = null)
{
try {
$calendar = new \BusinessModel\Calendar();
$calendar = new \ProcessMaker\BusinessModel\Calendar();
$calendar->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()));
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -34,7 +34,7 @@ class Cases extends Api
*/
public function doGetCasesListToDo(
$start = 0,
$limit = 'config',
$limit = 0,
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
$dir = 'DESC',
$cat_uid = '',
@@ -54,7 +54,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) {
@@ -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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Cases;
namespace ProcessMaker\Services\Api\Cases;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class InputDocument extends Api
{
try {
$userUid = $this->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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Cases;
namespace ProcessMaker\Services\Api\Cases;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class OutputDocument extends Api
{
try {
$userUid = $this->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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -27,7 +27,7 @@ class Department extends Api
public function doGetDepartments()
{
try {
$oDepartment = new \BusinessModel\Department();
$oDepartment = new \ProcessMaker\BusinessModel\Department();
$response = $oDepartment->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()));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -17,7 +17,7 @@ class Group extends Api
public function index($filter = null, $start = null, $limit = null)
{
try {
$group = new \BusinessModel\Group();
$group = new \ProcessMaker\BusinessModel\Group();
$group->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Group;
namespace ProcessMaker\Services\Api\Group;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -22,7 +22,7 @@ class User extends Api
public function doPostUser($grp_uid, $request_data)
{
try {
$groupUser = new \BusinessModel\Group\User();
$groupUser = new \ProcessMaker\BusinessModel\Group\User();
$groupUser->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -22,7 +22,7 @@ class Pmtable extends Api
public function doGetPmTables()
{
try {
$oPmTable = new \BusinessModel\Table();
$oPmTable = new \ProcessMaker\BusinessModel\Table();
$response = $oPmTable->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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -27,7 +27,7 @@ class Process extends Api
$arrayFilterData["category"] = $proCategory;
}
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$data = $process->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);

View File

@@ -0,0 +1,105 @@
<?php
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
* Group Api Controller
*
* @protected
*/
class ProcessCategory extends Api
{
private $formatFieldNameInUppercase = false;
/**
* @url GET
*/
public function doGetCategories($filter = null, $start = null, $limit = null)
{
try {
$processCategory = new \ProcessMaker\BusinessModel\ProcessCategory();
$processCategory->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()));
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use Luracast\Restler\RestException;
use ProcessMaker\Services\Api;
@@ -104,7 +104,7 @@ class Project extends Api
public function doGetProcess($prj_uid)
{
try {
$process = new \BusinessModel\Process();
$process = new \ProcessMaker\BusinessModel\Process();
$process->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"));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -44,7 +44,7 @@ class Activity extends Api
if ($filter == '' || $filter == 'properties') {
// PROPERTIES
$task = new \BusinessModel\Task();
$task = new \ProcessMaker\BusinessModel\Task();
$properties = $task->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"));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project\Activity;
namespace ProcessMaker\Services\Api\Project\Activity;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class Assignee extends Api
{
$response = array();
try {
$task = new \BusinessModel\Task();
$task = new \ProcessMaker\BusinessModel\Task();
$arrayData = $task->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;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project\Activity;
namespace ProcessMaker\Services\Api\Project\Activity;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -21,7 +21,7 @@ class Step extends Api
public function doGetActivityStep($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"));
@@ -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"));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project\Activity\Step;
namespace ProcessMaker\Services\Api\Project\Activity\Step;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -23,7 +23,7 @@ class Trigger extends Api
public function doGetActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type)
{
try {
$stepTrigger = new \BusinessModel\Step\Trigger();
$stepTrigger = new \ProcessMaker\BusinessModel\Step\Trigger();
$response = $stepTrigger->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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class CaseScheduler extends Api
public function doGetProjectCaseSchedulers($prjUid)
{
try {
$caseScheduler = new \BusinessModel\CaseScheduler();
$caseScheduler = new \ProcessMaker\BusinessModel\CaseScheduler();
$arrayData = $caseScheduler->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

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class CaseTracker extends Api
public function doGetCaseTrackerProperty($prj_uid)
{
try {
$caseTracker = new \BusinessModel\CaseTracker();
$caseTracker = new \ProcessMaker\BusinessModel\CaseTracker();
$response = $caseTracker->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class CaseTrackerObject extends Api
public function doGetCaseTrackerObject($cto_uid, $prj_uid)
{
try {
$caseTrackerObject = new \BusinessModel\CaseTrackerObject();
$caseTrackerObject = new \ProcessMaker\BusinessModel\CaseTrackerObject();
$response = $caseTrackerObject->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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class DataBaseConnection extends Api
public function doGetDataBaseConnections($prj_uid)
{
try {
$oDBConnection = new \BusinessModel\DataBaseConnection();
$oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->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()));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class DynaForm extends Api
public function doGetDynaForm($dyn_uid, $prj_uid)
{
try {
$dynaForm = new \BusinessModel\DynaForm();
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -32,7 +32,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, $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()));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class FilesManager extends Api
public function doGetProcessFilesManager($prj_uid, $path = '')
{
try {
$filesManager = new \BusinessModel\FilesManager();
$filesManager = new \ProcessMaker\BusinessModel\FilesManager();
if ($path != '') {
$arrayData = $filesManager->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;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class InputDocument extends Api
public function doGetInputDocument($inp_doc_uid, $prj_uid)
{
try {
$inputDocument = new \BusinessModel\InputDocument();
$inputDocument = new \ProcessMaker\BusinessModel\InputDocument();
$inputDocument->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"));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class OutputDocuments extends Api
public function doGetProjectOutputDocuments($prjUid)
{
try {
$outputDocument = new \BusinessModel\OutputDocument();
$outputDocument = new \ProcessMaker\BusinessModel\OutputDocument();
$arrayData = $outputDocument->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

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -28,7 +28,7 @@ class ProcessPermissions extends Api
public function doGetProcessPermissions($prj_uid)
{
try {
$processPermissions = new \BusinessModel\ProcessPermissions();
$processPermissions = new \ProcessMaker\BusinessModel\ProcessPermissions();
$response = $processPermissions->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) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class ProcessSupervisors extends Api
public function doGetProcessSupervisors($prjUid)
{
try {
$supervisor = new \BusinessModel\ProcessSupervisor();
$supervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$arrayData = $supervisor->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;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -19,7 +19,7 @@ class ProjectUsers extends Api
public function doGetProjectUsers($prj_uid)
{
try {
$users = new \BusinessModel\ProjectUser();
$users = new \ProcessMaker\BusinessModel\ProjectUser();
$arrayData = $users->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;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class ReportTable extends Api
public function doGetReportTables($prj_uid)
{
try {
$oReportTable = new \BusinessModel\Table();
$oReportTable = new \ProcessMaker\BusinessModel\Table();
$response = $oReportTable->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()));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -29,7 +29,7 @@ class Subprocess extends Api
{
try {
$hiddenFields = array('spr_uid', 'spr_pro_parent', 'spr_tas_parent');
$oSubProcess = new \BusinessModel\Subprocess();
$oSubProcess = new \ProcessMaker\BusinessModel\Subprocess();
$response = $oSubProcess->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()));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -26,7 +26,7 @@ class Trigger extends Api
public function doGetTriggers($projectUid)
{
try {
$trigger = new \BusinessModel\Trigger();
$trigger = new \ProcessMaker\BusinessModel\Trigger();
$response = $trigger->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()));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -30,7 +30,7 @@ class TriggerWizard extends Api
public function doGetTriggerWizard($prj_uid, $lib_name, $fn_name = "")
{
try {
$triggerWizard = new \BusinessModel\TriggerWizard();
$triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard();
$triggerWizard->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);

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker\Project;
namespace ProcessMaker\Services\Api\Project;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -21,7 +21,7 @@ class WebEntry extends Api
public function doGetWebEntry($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"));
@@ -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"));

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -22,7 +22,7 @@ class System extends Api
public function doGetDataBaseEngines()
{
try {
$oDBConnection = new \BusinessModel\DataBaseConnection();
$oDBConnection = new \ProcessMaker\BusinessModel\DataBaseConnection();
$response = $oDBConnection->getDbEngines();
return $response;
} catch (\Exception $e) {

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
class Type
{

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\ProcessMaker;
namespace ProcessMaker\Services\Api;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
@@ -20,7 +20,7 @@ class User extends Api
public function doGetUsers($filter = '', $start = null, $limit = null)
{
try {
$user = new \BusinessModel\User();
$user = new \ProcessMaker\BusinessModel\User();
$response = $user->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

View File

@@ -1,6 +1,6 @@
<?php
namespace Services\Api\OAuth2;
namespace ProcessMaker\Services\OAuth2;
/**
* Simple PmPDO storage for all storage types

View File

@@ -1,5 +1,5 @@
<?php
namespace Services\Api\OAuth2;
namespace ProcessMaker\Services\OAuth2;
use Luracast\Restler\iAuthenticate;

View File

@@ -0,0 +1,74 @@
;
; API Rest Configuration File
;
debug = 1
[api]
version = 1.0
vendor = "ProcessMaker - Michelangelo (Enterprise)"
[alias: test]
test2 = "ProcessMaker\Services\Api\Test2"
test3 = "ProcessMaker\Services\Api\Test3"
[alias: project]
activity = "ProcessMaker\Services\Api\Project\Activity"
step = "ProcessMaker\Services\Api\Project\Activity\Step"
assignee = "ProcessMaker\Services\Api\Project\Activity\Assignee"
trigger = "ProcessMaker\Services\Api\Project\Activity\Step\Trigger"
project = "ProcessMaker\Services\Api\Project"
trigger2 = "ProcessMaker\Services\Api\Project\Trigger"
event = "ProcessMaker\Services\Api\Project\Event"
dynaform = "ProcessMaker\Services\Api\Project\DynaForm"
input-document = "ProcessMaker\Services\Api\Project\InputDocument"
output-documents = "ProcessMaker\Services\Api\Project\OutputDocuments"
supervisors = "ProcessMaker\Services\Api\Project\ProcessSupervisors"
process-permissions = "ProcessMaker\Services\Api\Project\ProcessPermissions"
case-scheduler = "ProcessMaker\Services\Api\Project\CaseScheduler"
case-tracker = "ProcessMaker\Services\Api\Project\CaseTracker"
case-tracker-object = "ProcessMaker\Services\Api\Project\CaseTrackerObject"
project-users = "ProcessMaker\Services\Api\Project\ProjectUsers"
web-entry = "ProcessMaker\Services\Api\Project\WebEntry"
data-base-connections = "ProcessMaker\Services\Api\Project\DataBaseConnection"
files-manager = "ProcessMaker\Services\Api\Project\FilesManager"
report-Table = "ProcessMaker\Services\Api\Project\ReportTable"
sub-process= "ProcessMaker\Services\Api\Project\SubProcess"
trigger-wizard = "ProcessMaker\Services\Api\Project\TriggerWizard"
category = "ProcessMaker\Services\Api\ProcessCategory"
[alias: projects]
project = "ProcessMaker\Services\Api\Project"
[alias: group]
group = "ProcessMaker\Services\Api\Group"
user = "ProcessMaker\Services\Api\Group\User"
[alias: groups]
group = "ProcessMaker\Services\Api\Group"
[alias: user]
user = "ProcessMaker\Services\Api\User"
[alias: users]
user = "ProcessMaker\Services\Api\User"
[alias: calendar]
calendar = "ProcessMaker\Services\Api\Calendar"
[alias: calendars]
calendar = "ProcessMaker\Services\Api\Calendar"
[alias: case]
case = "ProcessMaker\Services\Api\Case"
[alias: cases]
case = "ProcessMaker\Services\Api\Case"
input-document = "ProcessMaker\Services\Api\Cases\InputDocument"
output-document = "ProcessMaker\Services\Api\Cases\OutputDocument"
[alias: category]
category = "ProcessMaker\Services\Api\ProcessCategory"
[alias: categories]
category = "ProcessMaker\Services\Api\ProcessCategory"

View File

@@ -1,33 +0,0 @@
<?php
namespace Services\Api\ProcessMaker;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
* Group Api Controller
*
* @protected
*/
class ProcessCategory extends Api
{
private $formatFieldNameInUppercase = false;
/**
* @url GET /categories
*/
public function doGetCategories($filter = null, $start = null, $limit = null)
{
try {
$processCategory = new \BusinessModel\ProcessCategory();
$processCategory->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()));
}
}
}

View File

@@ -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"

View File

@@ -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();

View File

@@ -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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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']);
}

View File

@@ -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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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
*/

View File

@@ -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) <brayan@colosa.com>
@@ -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) <brayan@colosa.com>
@@ -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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @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) <brayan@colosa.com>
* @copyright Colosa - Bolivia

View File

@@ -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
*

View File

@@ -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
*

View File

@@ -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();

View File

@@ -1,23 +0,0 @@
<?php
$accesstoken = "e79057f4276661bedb6154eed3834f6cbd738853";
$headr = array();
$inp_doc_uid = '68671480353319e5e1dee74089764900';
$tas_uid = '19582733053319e304cfa76025663570';
$app_doc_comment = 'desde script php';
$headr[] = 'Authorization: Bearer '.$accesstoken;
$file = "/home/wendy/uploadfiles/test1.html";
$url = "http://wendy.pmos.colosa.net/api/1.0/wendy/cases/64654381053382b8bb4c415067063003/input-document";
$ch = curl_init();
$a = array('form'=>'@'.$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 "<h3>post</h3>";
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 "<h3>response var_dump</h3>";
var_dump($postResult);
print "<textarea cols='50' rows='10'>".$postResult."</textarea>";