Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -105,7 +105,7 @@ Scenario Outline: Reassigns a case to a different user
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
|
||||
And I request "case/app_uid/reassign-case" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
And I request "cases/app_uid/reassign-case" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
@@ -116,14 +116,98 @@ Scenario Outline: Reassigns a case to a different user
|
||||
| Description | app_uid_number | usr_uid_source | usr_uid_target |
|
||||
| Reassign the user adam | 1 | 00000000000000000000000000000001 | 44811996752d567110634a1013636964 |
|
||||
| Reassign the user aaron | 2 | 00000000000000000000000000000001 | 51049032352d56710347233042615067 |
|
||||
| Reassign the user jeremiah | 3 | 00000000000000000000000000000001 | 86677227852d5671f40ba25017213081 |
|
||||
| Reassign the user chris | 4 | 00000000000000000000000000000001 | 24166330352d56730cdd525035621101 |
|
||||
| Reassign the user zachary | 5 | 00000000000000000000000000000001 | 62625000752d5672d6661e6072881167 |
|
||||
| Reassign the user admin | 6 | 24166330352d56730cdd525035621101 | 00000000000000000000000000000001 |
|
||||
| Reassign the user admin | 7 | 44811996752d567110634a1013636964 | 00000000000000000000000000000001 |
|
||||
| Reassign the user admin | 8 | 51049032352d56710347233042615067 | 00000000000000000000000000000001 |
|
||||
| Reassign the user admin | 9 | 86677227852d5671f40ba25017213081 | 00000000000000000000000000000001 |
|
||||
| Reassign the user admin | 10 | 62625000752d5672d6661e6072881167 | 00000000000000000000000000000001 |
|
||||
|
||||
|
||||
Scenario Outline: Cancel a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
|
||||
And I request "cases/app_uid/cancel" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| Description | app_uid_number |
|
||||
| Cancel of the process "Derivation rules - Parallel" | 3 |
|
||||
| Cancel of the process "Derivation rules - parallel evaluation" | 5 |
|
||||
| Cancel of the process "Derivation rules - selection" | 10 |
|
||||
|
||||
|
||||
Scenario Outline: Pause a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
|
||||
And I request "cases/app_uid/pause" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| Description | app_uid_number |
|
||||
| Pause of the process "Derivation rules - parallel evaluation" | 4 |
|
||||
| Pause of the process "Derivation rules - Parallel" | 8 |
|
||||
| Pause of the process "Derivation rules - parallel evaluation" | 9 |
|
||||
|
||||
|
||||
Scenario Outline: Unpause a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
|
||||
And I request "cases/app_uid/unpause" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| Description | app_uid_number |
|
||||
| Unpause of the process "Derivation rules - parallel evaluation" | 4 |
|
||||
| Unpause of the process "Derivation rules - Parallel" | 8 |
|
||||
| Unpause of the process "Derivation rules - parallel evaluation" | 9 |
|
||||
|
||||
|
||||
Scenario Outline: Trigger a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "app_uid_<app_uid_number>" stored in session array
|
||||
And I request "cases/app_uid/execute-trigger/{tri_uid}" with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| Description | app_uid_number |
|
||||
| | |
|
||||
| | |
|
||||
| | |
|
||||
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Route a case to the next task in the process
|
||||
@@ -153,3 +237,28 @@ Scenario Outline: Route a case to the next task in the process
|
||||
| Route next activity "Derivation rules - Parallel" | 8 |
|
||||
| Route next activity "Derivation rules - parallel evaluation" | 9 |
|
||||
| Route next activity "Derivation rules - selection" | 10 |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Delete of the cases created in this script.
|
||||
Given that I want to delete a resource with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
And I request "cases/551390121533343ee886813057396196/output-document"
|
||||
And the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
|
||||
| app_doc_uid_number |
|
||||
| 1 |
|
||||
| 2 |
|
||||
| 3 |
|
||||
| 4 |
|
||||
| 5 |
|
||||
| 6 |
|
||||
| 7 |
|
||||
| 8 |
|
||||
| 9 |
|
||||
| 10 |
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Cases Actions - the features in this script are (cancelCase, pauseCase, unpaseCase, executeCase, executeCase, executeTrigger and Delete Case)
|
||||
Requirements:
|
||||
a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point"
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: Cancel Case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/cancel-case"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Pause Case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/pause-case"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Unpause Case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/unpause-case"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
|
||||
Scenario: Executes a ProcessMaker trigger for a case
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
And I request "case{uid}/execute-trigger"
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And store "" in session array
|
||||
|
||||
|
||||
Scenario: Delete case of workspace
|
||||
Given that I want to delete a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/unpause-case"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
@@ -1,68 +1,38 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Cases Notes
|
||||
Requirements:
|
||||
a workspace with three cases of the process "Test Users-Step-Properties End Point"
|
||||
a workspace with one case of the process "Test Case Note"
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: List of case notes for this case
|
||||
Given I request "case/{uid}/notes"
|
||||
Given I request "cases/1185553665335d2e209f723099733152/notes"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
Scenario: Get a List of cases notes of a case with paged
|
||||
Given I request "cases/1185553665335d2e209f723099733152/notes/paged"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
|
||||
Scenario: create a new case note for specified case
|
||||
Scenario: Create a new case note for specified case
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
"note_content": "tercer case note creado desde script",
|
||||
"send_email": 1
|
||||
}
|
||||
"""
|
||||
And I request "case/{uid}/case"
|
||||
And I request "cases/1185553665335d2e209f723099733152/note"
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And store "" in session array
|
||||
|
||||
|
||||
Scenario: Get a specified case note for this case
|
||||
Given that I want to get a resource with the key "" stored in session array
|
||||
Given I request "case/{uid}/note/{uid}"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the " property equals ""
|
||||
And the "" property equals ""
|
||||
|
||||
|
||||
|
||||
Scenario: Modify a case note for specified case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/case/{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"
|
||||
|
||||
|
||||
Scenario: Delete a case note for specified case
|
||||
Given that I want to delete a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/case/{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"
|
||||
#case 125
|
||||
@@ -0,0 +1,30 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Cases Notes
|
||||
Requirements:
|
||||
a workspace with one case of the process "Test Case Note"
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: List of case notes for this case
|
||||
Given I request "cases/{uid}/notes"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
Scenario Outline: Create a new case note for specified case
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"note_content": "tercer case note creado desde script",
|
||||
"send_email": 1
|
||||
}
|
||||
"""
|
||||
And I request "case/{uid}/case"
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Case Note Negative Tests
|
||||
Requirements:
|
||||
a workspace with three cases of the process "Test Users-Step-Properties End Point"
|
||||
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: create a new case note for specified case (Negative Tests)
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"note_content": "prueba de creacion de un case note, sn permisos para poder enviar",
|
||||
"send_email": 1
|
||||
}
|
||||
"""
|
||||
And I request "cases/6441974235335ced24785c4035070430/note"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "You do not have permission to cases notes"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#case 124
|
||||
@@ -1,31 +1,88 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Cases Variables
|
||||
Requirements:
|
||||
a workspace with five cases of the process "Test micheangelo" and "Test Users-Step-Properties End Point"
|
||||
a workspace with five cases of the process "Test Case Variables" and with one case in workspace
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: Returns the variables can be system variables and/or case variables.
|
||||
Given I request "case/{uid}/get-variables"
|
||||
Given I request "cases/95124734553388becc0e332080057699/variables"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Sends variables to a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
|
||||
|
||||
"nameany": "sample-put",
|
||||
"namealphabetic": "juanput",
|
||||
"namealphanumeric": "sample123put",
|
||||
"nameinteger": "1313200000",
|
||||
"namerealnumber": "4324325000put",
|
||||
"nameemail": "qa@colosaput.com",
|
||||
"namelogin": "sampleput",
|
||||
"valorreal": "32,142,424.00",
|
||||
"valorinteger": "4,242,424",
|
||||
"porcentagereal": "424.00 %",
|
||||
"porcentageinteger": "424 %",
|
||||
"observaciones": "ningunaput",
|
||||
"grid": {
|
||||
"1": {
|
||||
"sample": "unoput",
|
||||
"currency1": "133,000.00",
|
||||
"percentage1": "424.00 %"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "" stored in session array
|
||||
And I request "case/{uid}/send-variables"
|
||||
And I request "cases/95124734553388becc0e332080057699/variable"
|
||||
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"
|
||||
|
||||
|
||||
Scenario: Return variables to a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"nameany": "sample",
|
||||
"namealphabetic": "juan",
|
||||
"namealphanumeric": "sample123",
|
||||
"nameinteger": "12345",
|
||||
"namerealnumber": "12344.56",
|
||||
"nameemail": "qa@colosa.com",
|
||||
"namelogin": "sample",
|
||||
"valorreal": "12,344,556,778.00",
|
||||
"valorinteger": "1,223,445",
|
||||
"porcentagereal": "122.44 %",
|
||||
"porcentageinteger": "123 %",
|
||||
"observaciones": "Observaciones",
|
||||
"grid": {
|
||||
"1": {
|
||||
"sample": "jose",
|
||||
"currency1": "12,334,444.00",
|
||||
"percentage1": "333.00 %"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And I request "cases/95124734553388becc0e332080057699/variable"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Returns the variables can be system variables and/or case variables.
|
||||
Given I request "cases/95124734553388becc0e332080057699/variables"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
#guardar el caso 128-->volver a ejecutar otro caso
|
||||
@@ -0,0 +1,274 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Cases Variables
|
||||
Requirements:
|
||||
a workspace with five cases of the process "Test Case Variables" and with one case in workspace
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
#case 128
|
||||
Scenario: Returns the variables can be system variables and/or case variables.
|
||||
Given I request "cases/95124734553388becc0e332080057699/variables"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And the "nameany" property equals "sample"
|
||||
And the "namealphabetic" property equals "juan"
|
||||
And the "namealphanumeric" property equals "sample123"
|
||||
And the "nameinteger" property equals "12345"
|
||||
And the "namerealnumber" property equals "12344.56"
|
||||
And the "nameemail" property equals "qa@colosa.com"
|
||||
And the "namelogin" property equals "sample"
|
||||
And the "valorreal" property equals "12,344,556,778.00"
|
||||
And the "valorinteger" property equals "1,223,445"
|
||||
And the "porcentagereal" property equals "122.44 %"
|
||||
And the "porcentageinteger" property equals "123 %"
|
||||
And the "observaciones" property equals "Observaciones"
|
||||
And the "areascolosa" property equals "desarrollo"
|
||||
And the "areascolosa_label" property equals "Desarrollo"
|
||||
And the "COUNTRY" property equals "BO"
|
||||
And the "COUNTRY_label" property equals "Bolivia"
|
||||
And the "STATE" property equals "H"
|
||||
And the "STATE_label" property equals "Chuquisaca"
|
||||
And the "LOCATION" property equals "SRE"
|
||||
And the "LOCATION_label" property equals "Sucre"
|
||||
And the "aprobado" property equals "1"
|
||||
And the "aprobadohint" property equals "0"
|
||||
And the "checkbox1" property equals "On"
|
||||
And the "checkbox2" property equals "Off"
|
||||
And the "checkbox3" property equals "Off"
|
||||
And the "radiogroup1" property equals "primero"
|
||||
And the "radiogroup1_label" property equals "Primero"
|
||||
And the "radiogroup2" property equals "quinto"
|
||||
And the "radiogroup2_label" property equals "Quinto"
|
||||
And the "date1" property equals "2013-11-07"
|
||||
And the "date2" property equals "2013-11-08"
|
||||
And the "date3" property equals "2014-03-03"
|
||||
And the "date4" property equals "2014-03-01"
|
||||
And the "suggest2" property equals "51049032352d56710347233042615067"
|
||||
And the "suggest2_label" property equals "aaron"
|
||||
|
||||
|
||||
|
||||
And the "sample" property in row 1 of property "grid" equals "jose"
|
||||
And the "currency1" property equals "12,334,444.00"
|
||||
And the "percentage1" property equals "333.00 %"
|
||||
And the "suggest1_label" property equals "gavin"
|
||||
And the "suggest1" property equals "33140476452d5671b0abda5073786635"
|
||||
And the "textarea1" property equals "ninguno"
|
||||
And the "dropdown1" property equals "dos"
|
||||
And the "dropdown1_label" property equals "dos"
|
||||
And the "yesno1" property equals "1"
|
||||
And the "checkbox1" property equals "On"
|
||||
And the "date1" property equals "2014-03-13"
|
||||
And the "link1" property equals "http://www.google.com/"
|
||||
And the "link1_label" property equals "link1"
|
||||
And the "sample" property equals "maria"
|
||||
And the "currency1" property equals "132,424.00"
|
||||
And the "percentage1" property equals "344.00 %"
|
||||
And the "suggest1_label" property equals "emily"
|
||||
And the "suggest1" property equals "34289569752d5673d310e82094574281"
|
||||
And the "textarea1" property equals "sample"
|
||||
And the "dropdown1" property equals "uno"
|
||||
And the "dropdown1_label" property equals "uno"
|
||||
And the "yesno1" property equals "0"
|
||||
And the "checkbox1" property equals "Off"
|
||||
And the "date1" property equals "2014-03-29"
|
||||
And the "link1" property equals "http://www.google.com/"
|
||||
And the "link1_label" property equals "link1"
|
||||
|
||||
|
||||
Scenario: Sends variables to a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"nameany": "sample-put",
|
||||
"namealphabetic": "juanput",
|
||||
"namealphanumeric": "sample123567",
|
||||
"nameinteger": "1313200000",
|
||||
"namerealnumber": "4324325000567.12",
|
||||
"nameemail": "qa@colosaput.com",
|
||||
"namelogin": "sampleput",
|
||||
"valorreal": "32,142,424.00",
|
||||
"porcentagereal": "424.00 %",
|
||||
"observaciones": "ningunaput",
|
||||
"grid": {
|
||||
"1": {
|
||||
"sample": "unoput",
|
||||
"currency1": "133,000.00",
|
||||
"percentage1": "424.00 %"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And I request "cases/95124734553388becc0e332080057699/variable"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Returns the variables can be system variables and/or case variables.
|
||||
Given I request "cases/95124734553388becc0e332080057699/variables"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And the "nameany" property equals "sample-put"
|
||||
And the "namealphabetic" property equals "juan-put"
|
||||
And the "namealphanumeric" property equals "sample123567"
|
||||
And the "nameinteger" property equals "1313200000"
|
||||
And the "namerealnumber" property equals "4324325000567.12"
|
||||
And the "nameemail" property equals "qa@colosaput.com"
|
||||
And the "namelogin" property equals "sampleput"
|
||||
And the "valorreal" property equals "32,142,424.00"
|
||||
And the "valorinteger" property equals "1,223,445"
|
||||
And the "porcentagereal" property equals "424.00 %"
|
||||
And the "porcentageinteger" property equals "123 %"
|
||||
And the "observaciones" property equals "ningunaput"
|
||||
And the "areascolosa" property equals "desarrollo"
|
||||
And the "areascolosa_label" property equals "Desarrollo"
|
||||
And the "COUNTRY" property equals "BO"
|
||||
And the "COUNTRY_label" property equals "Bolivia"
|
||||
And the "STATE" property equals "H"
|
||||
And the "STATE_label" property equals "Chuquisaca"
|
||||
And the "LOCATION" property equals "SRE"
|
||||
And the "LOCATION_label" property equals "Sucre"
|
||||
And the "aprobado" property equals "1"
|
||||
And the "aprobadohint" property equals "0"
|
||||
And the "checkbox1" property equals "On"
|
||||
And the "checkbox2" property equals "Off"
|
||||
And the "checkbox3" property equals "Off"
|
||||
And the "radiogroup1" property equals "primero"
|
||||
And the "radiogroup1_label" property equals "Primero"
|
||||
And the "radiogroup2" property equals "quinto"
|
||||
And the "radiogroup2_label" property equals "Quinto"
|
||||
And the "date1" property equals "2013-11-07"
|
||||
And the "date2" property equals "2013-11-08"
|
||||
And the "date3" property equals "2014-03-03"
|
||||
And the "date4" property equals "2014-03-01"
|
||||
And the "suggest2" property equals "51049032352d56710347233042615067"
|
||||
And the "suggest2_label" property equals "aaron"
|
||||
And the "sample" property equals "unoput"
|
||||
And the "currency1" property equals "133,000.00"
|
||||
And the "percentage1" property equals "424.00 %"
|
||||
And the "suggest1_label" property equals "gavin"
|
||||
And the "suggest1" property equals "33140476452d5671b0abda5073786635"
|
||||
And the "textarea1" property equals "ninguno"
|
||||
And the "dropdown1" property equals "dos"
|
||||
And the "dropdown1_label" property equals "dos"
|
||||
And the "yesno1" property equals "1"
|
||||
And the "checkbox1" property equals "On"
|
||||
And the "date1" property equals "2014-03-13"
|
||||
And the "link1" property equals "http://www.google.com/"
|
||||
And the "link1_label" property equals "link1"
|
||||
And the "sample" property equals "maria"
|
||||
And the "currency1" property equals "132,424.00"
|
||||
And the "percentage1" property equals "344.00 %"
|
||||
And the "suggest1_label" property equals "emily"
|
||||
And the "suggest1" property equals "34289569752d5673d310e82094574281"
|
||||
And the "textarea1" property equals "sample"
|
||||
And the "dropdown1" property equals "uno"
|
||||
And the "dropdown1_label" property equals "uno"
|
||||
And the "yesno1" property equals "0"
|
||||
And the "checkbox1" property equals "Off"
|
||||
And the "date1" property equals "2014-03-29"
|
||||
And the "link1" property equals "http://www.google.com/"
|
||||
And the "link1_label" property equals "link1"
|
||||
|
||||
|
||||
Scenario: Return variables to a case
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"nameany": "sample",
|
||||
"namealphabetic": "juan",
|
||||
"namealphanumeric": "sample123",
|
||||
"nameinteger": "12345",
|
||||
"namerealnumber": "12344.56",
|
||||
"nameemail": "qa@colosa.com",
|
||||
"namelogin": "sample",
|
||||
"valorreal": "12,344,556,778.00",
|
||||
"porcentagereal": "122.44 %",
|
||||
"observaciones": "Observaciones",
|
||||
"grid": {
|
||||
"1": {
|
||||
"sample": "jose",
|
||||
"currency1": "12,334,444.00",
|
||||
"percentage1": "333.00 %"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And I request "cases/95124734553388becc0e332080057699/variable"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Returns the variables can be system variables and/or case variables.
|
||||
Given I request "cases/95124734553388becc0e332080057699/variables"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And the "nameany" property equals "sample"
|
||||
And the "namealphabetic" property equals "juan"
|
||||
And the "namealphanumeric" property equals "sample123"
|
||||
And the "nameinteger" property equals "12345"
|
||||
And the "namerealnumber" property equals "12344.56"
|
||||
And the "nameemail" property equals "qa@colosa.com"
|
||||
And the "namelogin" property equals "sample"
|
||||
And the "valorreal" property equals "12,344,556,778.00"
|
||||
And the "valorinteger" property equals "1,223,445"
|
||||
And the "porcentagereal" property equals "122.44 %"
|
||||
And the "porcentageinteger" property equals "123 %"
|
||||
And the "observaciones" property equals "Observaciones"
|
||||
And the "areascolosa" property equals "desarrollo"
|
||||
And the "areascolosa_label" property equals "Desarrollo"
|
||||
And the "COUNTRY" property equals "BO"
|
||||
And the "COUNTRY_label" property equals "Bolivia"
|
||||
And the "STATE" property equals "H"
|
||||
And the "STATE_label" property equals "Chuquisaca"
|
||||
And the "LOCATION" property equals "SRE"
|
||||
And the "LOCATION_label" property equals "Sucre"
|
||||
And the "aprobado" property equals "1"
|
||||
And the "aprobadohint" property equals "0"
|
||||
And the "checkbox1" property equals "On"
|
||||
And the "checkbox2" property equals "Off"
|
||||
And the "checkbox3" property equals "Off"
|
||||
And the "radiogroup1" property equals "primero"
|
||||
And the "radiogroup1_label" property equals "Primero"
|
||||
And the "radiogroup2" property equals "quinto"
|
||||
And the "radiogroup2_label" property equals "Quinto"
|
||||
And the "date1" property equals "2013-11-07"
|
||||
And the "date2" property equals "2013-11-08"
|
||||
And the "date3" property equals "2014-03-03"
|
||||
And the "date4" property equals "2014-03-01"
|
||||
And the "suggest2" property equals "51049032352d56710347233042615067"
|
||||
And the "suggest2_label" property equals "aaron"
|
||||
And the "sample" property equals "jose"
|
||||
And the "currency1" property equals "12,334,444.00"
|
||||
And the "percentage1" property equals "333.00 %"
|
||||
And the "suggest1_label" property equals "gavin"
|
||||
And the "suggest1" property equals "33140476452d5671b0abda5073786635"
|
||||
And the "textarea1" property equals "ninguno"
|
||||
And the "dropdown1" property equals "dos"
|
||||
And the "dropdown1_label" property equals "dos"
|
||||
And the "yesno1" property equals "1"
|
||||
And the "checkbox1" property equals "On"
|
||||
And the "date1" property equals "2014-03-13"
|
||||
And the "link1" property equals "http://www.google.com/"
|
||||
And the "link1_label" property equals "link1"
|
||||
And the "sample" property equals "maria"
|
||||
And the "currency1" property equals "132,424.00"
|
||||
And the "percentage1" property equals "344.00 %"
|
||||
And the "suggest1_label" property equals "emily"
|
||||
And the "suggest1" property equals "34289569752d5673d310e82094574281"
|
||||
And the "textarea1" property equals "sample"
|
||||
And the "dropdown1" property equals "uno"
|
||||
And the "dropdown1_label" property equals "uno"
|
||||
And the "yesno1" property equals "0"
|
||||
And the "checkbox1" property equals "Off"
|
||||
And the "date1" property equals "2014-03-29"
|
||||
And the "link1" property equals "http://www.google.com/"
|
||||
And the "link1_label" property equals "link1"
|
||||
@@ -0,0 +1,95 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Cases Variables Negative Tests
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: Returns the variables can be system variables and/or case variables (negative tests).
|
||||
Given I request "cases/95124734553388becc0e332080057699/variable"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "Not Found"
|
||||
|
||||
|
||||
Scenario: Sends variables to a case (negative tests)
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"nameany": "sample-put",
|
||||
"namealphabetic": "juanput",
|
||||
"namealphanumeric": "sample123put",
|
||||
"nameinteger": "1313200000",
|
||||
"namerealnumber": "4324325000put",
|
||||
"nameemail": "qa@colosaput.com",
|
||||
"namelogin": "sampleput",
|
||||
"valorreal": "32,142,424.00",
|
||||
"valorinteger": "4,242,424",
|
||||
"porcentagereal": "424.00 %",
|
||||
"porcentageinteger": "424 %",
|
||||
"observaciones": "ningunaput",
|
||||
"grid": {
|
||||
"1": {
|
||||
"sample": "unoput",
|
||||
"currency1": "133,000.00",
|
||||
"percentage1": "424.00 %",
|
||||
}
|
||||
"""
|
||||
And I request "cases/95124734553388becc0e332080057699/variable"
|
||||
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"
|
||||
|
||||
|
||||
|
||||
18130826553359171798e40060879912
|
||||
|
||||
"nameany": "wendy344%",
|
||||
"namealphabetic": "nestor123",
|
||||
"namealphanumeric": "rad1233$%",
|
||||
"nameinteger": "342432,7",
|
||||
"namerealnumber": "35353",
|
||||
"nameemail": "wendycolosacom",
|
||||
"namelogin": "sample",
|
||||
"valorreal": "242343253,253.00",
|
||||
"valorinteger": "346436363",
|
||||
"porcentagereal": "64600",
|
||||
"porcentageinteger": "464",
|
||||
"observaciones": "ninguna",
|
||||
"areascolosa": "sample",
|
||||
"areascolosa_label": "sample",
|
||||
"COUNTRY": "BOA",
|
||||
"COUNTRY_label": "Bolivia",
|
||||
"STATE": "aH",
|
||||
"STATE_label": "Chuquisaca",
|
||||
"LOCATION": "SRE",
|
||||
"LOCATION_label": "Sucre",
|
||||
"aprobado": "20",
|
||||
"aprobadohint": "0",
|
||||
"checkbox1": "sample",
|
||||
"checkbox2": "oki",
|
||||
"checkbox3": "Off",
|
||||
"radiogroup1": "hola",
|
||||
"radiogroup1_label": "Primero",
|
||||
"date1": "hola",
|
||||
"date2": "2013-11-08",
|
||||
"date3": "2014-03-09",
|
||||
"date4": "2014-03-02",
|
||||
"suggest2": "51049032352d56710347233042615067",
|
||||
"suggest2_label": "sample",
|
||||
"grid": {
|
||||
"1": {
|
||||
"sample": "hugo",
|
||||
"currency1": "2,424,234.00",
|
||||
"percentage1": "354.00 %",
|
||||
"suggest1_label": "dorothy",
|
||||
"suggest1": "81205219852d56719a97fc3086456770",
|
||||
"textarea1": "ninguno",
|
||||
"dropdown1": "uno",
|
||||
"yesno1": "0",
|
||||
"checkbox1": "On",
|
||||
"date1": "2014-03-20",
|
||||
"link1": "http://www.google.com/",
|
||||
"link1_label": "link1",
|
||||
"file1": "Tuesday.docx",
|
||||
"dropdown1_label": "uno"
|
||||
@@ -9,7 +9,7 @@ Background:
|
||||
|
||||
|
||||
Scenario: Returns a list of the uploaded documents for a given case
|
||||
Given I request "cases/3980158475331a1a0288fd3009853776/input-documents"
|
||||
Given I request "cases/64654381053382b8bb4c415067063003/input-documents"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
@@ -17,19 +17,19 @@ Scenario: Returns a list of the uploaded documents for a given case
|
||||
|
||||
|
||||
Scenario: Returns an uploaded documents for a given case
|
||||
Given I request "cases/3980158475331a1a0288fd3009853776/input-document/6075490825331a1c5eebff9015468244"
|
||||
Given I request "cases/64654381053382b8bb4c415067063003/input-document/6075490825331a1c5eebff9015468244"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Scenario: Post metadata and then upload documents for a given case
|
||||
Given POST upload an input document "/home/wendy/uploadfiles/test1.html" to "cases/3980158475331a1a0288fd3009853776/input-document"
|
||||
Given POST upload an input document "/home/wendy/uploadfiles/test1.html" to "cases/64654381053382b8bb4c415067063003/input-document"
|
||||
"""
|
||||
{
|
||||
|
||||
"inp_doc_uid": "inp_doc_uid",
|
||||
"tas_uid": "tas_uid",
|
||||
"inp_doc_uid": "68671480353319e5e1dee74089764900",
|
||||
"tas_uid": "19582733053319e304cfa76025663570",
|
||||
"app_doc_comment": "app_doc_comment"
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ Scenario: Post metadata and then upload documents for a given case
|
||||
|
||||
Scenario: Delete an uploaded or generated document from a case.
|
||||
Given that I want to delete a resource with the key "" stored in session array
|
||||
And I request "cases/3980158475331a1a0288fd3009853776/input-document/{app_doc_uid}"
|
||||
And I request "cases/64654381053382b8bb4c415067063003/input-document/{app_doc_uid}"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
@@ -9,7 +9,7 @@ Background:
|
||||
|
||||
|
||||
Scenario: Returns a list of the uploaded documents for a given case
|
||||
Given I request "cases/3980158475331a1a0288fd3009853776/input-documents"
|
||||
Given I request "cases/64654381053382b8bb4c415067063003/input-documents"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
@@ -17,7 +17,7 @@ Scenario: Returns a list of the uploaded documents for a given case
|
||||
|
||||
|
||||
Scenario Outline: Returns an uploaded documents for a given case
|
||||
Given I request "cases/3980158475331a1a0288fd3009853776/input-document/<input-document>"
|
||||
Given I request "cases/64654381053382b8bb4c415067063003/input-document/<input-document>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
@@ -38,4 +38,40 @@ Scenario Outline: Returns an uploaded documents for a given case
|
||||
| Get Input "Screenshot Case Archive.docx" | 3770386635331a1f49c78e8070071944 | 3770386635331a1f49c78e8070071944 | Screenshot Case Archive.docx | 68671480353319e5e1dee74089764900 | 1 | 2014-03-25 11:34:12 | , Administrator (admin) | INPUT | 2 | cases/cases_ShowDocument?a=3770386635331a1f49c78e8070071944&v=1 |
|
||||
| Get Input "alert_message.html" | 6382509235331a235b27a82003894796 | 6382509235331a235b27a82003894796 | alert_message.htm | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:17 | , Administrator (admin) | INPUT | 4 | cases/cases_ShowDocument?a=6382509235331a235b27a82003894796&v=1 |
|
||||
| Get Input "actionsByEmail-2.5.0.28.tar" | 3548449385331a24a34d273018695729 | 3548449385331a24a34d273018695729 | actionsByEmail-2.5.0.28.tar | 68588088053319e68d88f67081331478 | 1 | 2014-03-25 11:35:38 | , Administrator (admin) | INPUT | 5 | cases/cases_ShowDocument?a=3548449385331a24a34d273018695729&v=1 |
|
||||
| Get Input "Step_ordenamiento (5).pm" | 3814366275331a21b80d603018480738 | 3814366275331a21b80d603018480738 | Step_ordenamiento (5).pm | 68588088053319e68d88f67081331478 | 2 | 2014-03-25 11:36:11 | , Administrator (admin) | INPUT | 6 | cases/cases_ShowDocument?a=3814366275331a21b80d603018480738&v=2 |
|
||||
| Get Input "Step_ordenamiento (5).pm" | 3814366275331a21b80d603018480738 | 3814366275331a21b80d603018480738 | Step_ordenamiento (5).pm | 68588088053319e68d88f67081331478 | 2 | 2014-03-25 11:36:11 | , Administrator (admin) | INPUT | 6 | cases/cases_ShowDocument?a=3814366275331a21b80d603018480738&v=2 |
|
||||
|
||||
|
||||
Scenario Outline: Post metadata and then upload documents for a given case
|
||||
Given POST upload an input document "<document_file>" to "cases/<case_uid>/input-document"
|
||||
"""
|
||||
{
|
||||
|
||||
"inp_doc_uid": "<inp_doc_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"app_doc_comment": "<app_doc_comment>"
|
||||
|
||||
|
||||
}
|
||||
"""
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
And store "app_doc_uid" in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
|
||||
Examples:
|
||||
| app_doc_uid_number | document_file | case_uid | inp_doc_uid | tas_uid | app_doc_comment |
|
||||
| 1 | /home/wendy/uploadfiles/test1.html | 64654381053382b8bb4c415067063003 | 68671480353319e5e1dee74089764900 | 19582733053319e304cfa76025663570 | comment 1 |
|
||||
|
||||
|
||||
Scenario Outline: Delete an uploaded or generated document from a case.
|
||||
Given that I want to delete a resource with the key "app_doc_uid_<app_doc_uid_number>" stored in session array
|
||||
And I request "cases/64654381053382b8bb4c415067063003/input-document/"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
|
||||
Examples:
|
||||
| app_doc_uid_number |
|
||||
| 1 |
|
||||
@@ -9,7 +9,7 @@ Background:
|
||||
|
||||
|
||||
Scenario: Returns a list of the generated documents for a given cases
|
||||
Given I request "cases/24438110553330068247694030259829/output-documents"
|
||||
Given I request "cases/33125846153383cecdf64f1079330191/output-documents"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
@@ -17,7 +17,7 @@ Scenario: Returns a list of the generated documents for a given cases
|
||||
|
||||
|
||||
Scenario: Returns an generated document for a given case
|
||||
Given I request "cases/24438110553330068247694030259829/output-document/3000248055333006ab56a01005891659"
|
||||
Given I request "cases/33125846153383cecdf64f1079330191/output-document/3000248055333006ab56a01005891659"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "Object"
|
||||
@@ -30,17 +30,18 @@ Scenario: Generate or regenerates an output documents for a given case
|
||||
"out_doc_uid": "2087233055331ef4127d238097105696"
|
||||
}
|
||||
"""
|
||||
And I request "case/24438110553330068247694030259829/output-document"
|
||||
Then the response status code should be 201
|
||||
And I request "cases/33125846153383cecdf64f1079330191/output-document"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And store "app_doc_uid" in session array as variable "app_doc_uid_0"
|
||||
|
||||
|
||||
|
||||
Scenario: Delete an uploaded or generated document from a case.
|
||||
Given that I want to delete a resource with the key "" stored in session array
|
||||
And I request "output-document/{uid}"
|
||||
And that I want to delete a resource with the key "app_doc_uid_0" stored in session array
|
||||
Gie I request "output-document"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
@@ -15,7 +15,7 @@ Scenario Outline: Generate or regenerates an output documents for a given case
|
||||
"out_doc_uid": "<out_doc_uid>"
|
||||
}
|
||||
"""
|
||||
And I request "cases/551390121533343ee886813057396196/output-document"
|
||||
And I request "cases/33125846153383cecdf64f1079330191/output-document"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
@@ -33,7 +33,7 @@ Scenario Outline: Generate or regenerates an output documents for a given case
|
||||
|
||||
|
||||
Scenario: Returns a list of the generated documents for a given cases
|
||||
Given I request "cases/551390121533343ee886813057396196/output-documents"
|
||||
Given I request "cases/33125846153383cecdf64f1079330191/output-documents"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
@@ -47,7 +47,7 @@ Scenario: Returns a list of the generated documents for a given cases
|
||||
|
||||
|
||||
Scenario Outline: Returns an generated document for a given case
|
||||
Given I request "cases/551390121533343ee886813057396196/output-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
Given I request "cases/33125846153383cecdf64f1079330191/output-document/app_doc_uid" with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "Object"
|
||||
@@ -76,7 +76,7 @@ Scenario Outline: Returns an generated document for a given case
|
||||
|
||||
Scenario Outline: Delete an uploaded or generated document from a case.
|
||||
Given that I want to delete a resource with the key "app_doc_uid" stored in session array as variable "app_doc_uid_<app_doc_uid_number>"
|
||||
And I request "cases/551390121533343ee886813057396196/output-document"
|
||||
And I request "cases/33125846153383cecdf64f1079330191/output-document"
|
||||
And the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
@@ -123,7 +123,13 @@ Requirements:
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
And the response has 1 records
|
||||
|
||||
|
||||
|
||||
Scenario: List assignees of an activity
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee/all"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
|
||||
@@ -129,3 +129,10 @@ Scenario Outline: List assignees of an activity using a filter
|
||||
And the type is "array"
|
||||
And the response has 4 records
|
||||
|
||||
|
||||
Scenario: List assignees of an activity including users that are within groups
|
||||
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee/all"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
miche@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: ProcessPermissions Resources
|
||||
|
||||
@1: TEST FOR GET PROCESS PERMISSIONS /----------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FA<?php
|
||||
<?php
|
||||
use Behat\Behat\Context\BehatContext;
|
||||
use Behat\Gherkin\Node\PyStringNode;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
@@ -339,6 +339,8 @@ class RestContext extends BehatContext
|
||||
$this->_headers['Authorization'] = 'Bearer ' . $this->access_token;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($urlType=="absolute"){
|
||||
$this->_requestUrl = $pageUrl;
|
||||
@@ -367,7 +369,7 @@ class RestContext extends BehatContext
|
||||
case 'POST':
|
||||
$postFields = is_object($this->_restObject)
|
||||
? (array)$this->_restObject
|
||||
: $this->_restObject;
|
||||
: $this->_restObject;
|
||||
$this->_request = $this->_client
|
||||
->post($url, $this->_headers,
|
||||
(empty($this->_requestBody) ? $postFields :
|
||||
@@ -1481,43 +1483,15 @@ class RestContext extends BehatContext
|
||||
*/
|
||||
public function postUploadAnInputDocumentTo($file, $url, PyStringNode $string)
|
||||
{
|
||||
$baseUrl = $this->getParameter('base_url');
|
||||
$url = $baseUrl.$url;
|
||||
$accesstoken = $this->getParameter('access_token');
|
||||
$headr = array();
|
||||
$headr[] = 'Authorization: Bearer '.$accesstoken;
|
||||
|
||||
$postFields = json_decode($string);
|
||||
$postFields->form ='@'.$file;
|
||||
//print_r($postFields);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL,$url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
|
||||
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);
|
||||
print_r($postResult);
|
||||
curl_close($ch);
|
||||
|
||||
//Save result as usual
|
||||
$this->_type = 'json';
|
||||
//$this->_response = json_decode($postResult);
|
||||
$this->_data = json_decode($postResult);
|
||||
|
||||
|
||||
|
||||
// $postResult = (array)json_decode($postResult);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->_restObjectMethod = 'post';
|
||||
$this->_restObject = $postFields;
|
||||
$this->iRequest($url);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ EOT
|
||||
CLI::taskOpt("buildACV", "If the option is enabled, performs the Build Cache View.", "ACV", "buildACV");
|
||||
CLI::taskRun("run_upgrade");
|
||||
|
||||
|
||||
/**
|
||||
* A version of rm_dir which does not exits on error.
|
||||
*
|
||||
@@ -150,6 +149,7 @@ function run_upgrade($command, $args)
|
||||
|
||||
G::browserCacheFilesSetUid();
|
||||
|
||||
upgradeFilesManager($command);
|
||||
//Status
|
||||
if ($errors) {
|
||||
CLI::logging("Upgrade finished but there were errors upgrading workspaces.\n");
|
||||
@@ -162,3 +162,89 @@ function run_upgrade($command, $args)
|
||||
$flag = G::isPMUnderUpdating(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function upgradeFilesManager
|
||||
* access public
|
||||
*/
|
||||
|
||||
function upgradeFilesManager($command = "") {
|
||||
CLI::logging("> Updating Files Manager...\n\n");
|
||||
$workspaces = get_workspaces_from_args($command);
|
||||
foreach ($workspaces as $workspace) {
|
||||
$name = $workspace->name;
|
||||
require_once( PATH_DB . $name . '/db.php' );
|
||||
require_once( PATH_THIRDPARTY . 'propel/Propel.php');
|
||||
PROPEL::Init ( PATH_METHODS.'dbConnections/rootDbConnections.php' );
|
||||
$con = Propel::getConnection("root");
|
||||
$stmt = $con->createStatement();
|
||||
$sDirectory = PATH_DATA . "sites/" . $name . "/" . "mailTemplates/";
|
||||
$sDirectoryPublic = PATH_DATA . "sites/" . $name . "/" . "public/";
|
||||
if ($dh = opendir($sDirectory)) {
|
||||
$files = Array();
|
||||
while ($file = readdir($dh)) {
|
||||
if ($file != "." && $file != ".." && $file[0] != '.') {
|
||||
if (is_dir($sDirectory . "/" . $file)) {
|
||||
$inner_files = listFiles($sDirectory . $file);
|
||||
if (is_array($inner_files)) $files = array_merge($files, $inner_files);
|
||||
} else {
|
||||
array_push($files, $sDirectory . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
if ($dh = opendir($sDirectoryPublic)) {
|
||||
while ($file = readdir($dh)) {
|
||||
if ($file != "." && $file != ".." && $file[0] != '.') {
|
||||
if (is_dir($sDirectoryPublic . "/" . $file)) {
|
||||
$inner_files = listFiles($sDirectoryPublic . $file);
|
||||
if (is_array($inner_files)) $files = array_merge($files, $inner_files);
|
||||
} else {
|
||||
array_push($files, $sDirectoryPublic . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
foreach ($files as $aFile) {
|
||||
if (strpos($aFile, $sDirectory) !== false){
|
||||
$processUid = current(explode("/", str_replace($sDirectory,'',$aFile)));
|
||||
} else {
|
||||
$processUid = current(explode("/", str_replace($sDirectoryPublic,'',$aFile)));
|
||||
}
|
||||
$sql = "SELECT PROCESS_FILES.PRF_PATH FROM PROCESS_FILES WHERE PROCESS_FILES.PRF_PATH='" . $aFile ."'";
|
||||
$appRows = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
$fileUid = '';
|
||||
foreach ($appRows as $row) {
|
||||
$fileUid = $row["PRF_PATH"];
|
||||
}
|
||||
if ($fileUid !== $aFile) {
|
||||
$sPkProcessFiles = G::generateUniqueID();
|
||||
$sDate = date('Y-m-d H:i:s');
|
||||
$sql = "INSERT INTO PROCESS_FILES (PRF_UID, PRO_UID, USR_UID, PRF_UPDATE_USR_UID,
|
||||
PRF_PATH, PRF_TYPE, PRF_EDITABLE, PRF_CREATE_DATE, PRF_UPDATE_DATE)
|
||||
VALUES ('".$sPkProcessFiles."', '".$processUid."', '00000000000000000000000000000001', '',
|
||||
'".$aFile."', 'file', 'true', '".$sDate."', NULL)";
|
||||
$stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function listFiles($dir) {
|
||||
if($dh = opendir($dir)) {
|
||||
$files = Array();
|
||||
while ($file = readdir($dh)) {
|
||||
if ($file != "." && $file != ".." && $file[0] != '.') {
|
||||
if (is_dir($dir . "/" . $file)) {
|
||||
$inner_files = listFiles($dir . "/" . $file);
|
||||
if (is_array($inner_files)) $files = array_merge($files, $inner_files);
|
||||
} else {
|
||||
array_push($files, $dir . "/" . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return $files;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -265,7 +265,8 @@ class OutputDocument
|
||||
}
|
||||
}
|
||||
$g->sessionVarRestore();
|
||||
return $this->getCasesOutputDocument($applicationUid, $userUid, $sDocUID);
|
||||
$response = $this->getCasesOutputDocument($applicationUid, $userUid, $sDocUID);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ class DynaForm
|
||||
//Verify data
|
||||
$process = new \BusinessModel\Process();
|
||||
|
||||
$process->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
|
||||
|
||||
@@ -507,7 +507,7 @@ class DynaForm
|
||||
//Verify data
|
||||
$process = new \BusinessModel\Process();
|
||||
|
||||
$process->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
|
||||
|
||||
@@ -542,7 +542,7 @@ class DynaForm
|
||||
$dynaFormUidCopyImport = $arrayData["COPY_IMPORT"]["DYN_UID"];
|
||||
|
||||
//Verify data
|
||||
$process->throwExceptionIfNoExistsProcess($processUidCopyImport, $this->getFieldNameByFormatFieldName("COPY_IMPORT.PRJ_UID"));
|
||||
$process->throwExceptionIfNotExistsProcess($processUidCopyImport, $this->getFieldNameByFormatFieldName("COPY_IMPORT.PRJ_UID"));
|
||||
|
||||
$this->throwExceptionIfNotExistsDynaForm($dynaFormUidCopyImport, $processUidCopyImport, $this->getFieldNameByFormatFieldName("COPY_IMPORT.DYN_UID"));
|
||||
|
||||
@@ -710,7 +710,7 @@ class DynaForm
|
||||
//Verify data
|
||||
$process = new \BusinessModel\Process();
|
||||
|
||||
$process->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class Group
|
||||
*
|
||||
* return void Throw exception if doesn't exists the Group in table GROUP
|
||||
*/
|
||||
public function throwExceptionIfNoExistsGroup($groupUid, $fieldNameForException)
|
||||
public function throwExceptionIfNotExistsGroup($groupUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$group = new \Groupwf();
|
||||
@@ -229,7 +229,7 @@ class Group
|
||||
//Verify data
|
||||
$process = new \BusinessModel\Process();
|
||||
|
||||
$this->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);
|
||||
|
||||
@@ -268,7 +268,7 @@ class Group
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
//Delete
|
||||
$group = new \Groupwf();
|
||||
@@ -340,7 +340,7 @@ class Group
|
||||
|
||||
//Verif data
|
||||
if ($groupUid != "") {
|
||||
$this->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
}
|
||||
|
||||
//Get data
|
||||
@@ -387,7 +387,7 @@ class Group
|
||||
|
||||
//Verif data
|
||||
if ($groupUid != "") {
|
||||
$this->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
}
|
||||
|
||||
//Get data
|
||||
@@ -555,7 +555,7 @@ class Group
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
//Get data
|
||||
$arrayTotalUsersByGroup = $this->getTotalUsersByGroup($groupUid);
|
||||
@@ -673,7 +673,7 @@ class Group
|
||||
//Verify data
|
||||
$process = new \BusinessModel\Process();
|
||||
|
||||
$this->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$this->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);
|
||||
|
||||
|
||||
@@ -147,11 +147,11 @@ class User
|
||||
$process = new \BusinessModel\Process();
|
||||
$group = new \BusinessModel\Group();
|
||||
|
||||
$group->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
|
||||
|
||||
$process->throwExceptionIfNoExistsUser($arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
|
||||
$process->throwExceptionIfNotExistsUser($arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
$this->throwExceptionIfExistsGroupUser($groupUid, $arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
@@ -188,9 +188,9 @@ class User
|
||||
$process = new \BusinessModel\Process();
|
||||
$group = new \BusinessModel\Group();
|
||||
|
||||
$group->throwExceptionIfNoExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
$group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
$process->throwExceptionIfNoExistsUser($userUid, $this->arrayFieldNameForException["userUid"]);
|
||||
$process->throwExceptionIfNotExistsUser($userUid, $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
$this->throwExceptionIfNotExistsGroupUser($groupUid, $userUid, $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ class InputDocument
|
||||
//Verify data
|
||||
$process = new \BusinessModel\Process();
|
||||
|
||||
$process->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ class Process
|
||||
//
|
||||
} else {
|
||||
$eregDate = "[1-9]\d{3}\-(?:0[1-9]|1[012])\-(?:[0][1-9]|[12][0-9]|3[01])";
|
||||
$eregHour = "(?:[0-1]\d|2[0-3])\:(?:[0-5]\d)\:(?:[0-5]\d)";
|
||||
$eregHour = "(?:[0-1]\d|2[0-3])\:(?:[0-5]\d)(?:\:[0-5]\d)?";
|
||||
$eregDatetime = $eregDate . "\s" . $eregHour;
|
||||
|
||||
switch ($arrayFieldDefinition[$fieldName]["type"]) {
|
||||
@@ -237,14 +237,50 @@ class Process
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//type
|
||||
switch ($arrayFieldDefinition[$fieldName]["type"]) {
|
||||
case "array":
|
||||
//type
|
||||
if (!is_array($fieldValue)) {
|
||||
if ((!preg_match("/^\s*array\s*\(.*\)\s*$/", $fieldValue)) && $fieldValue != '') {
|
||||
if ($fieldValue != "" && !preg_match("/^\s*array\s*\(.*\)\s*$/", $fieldValue)) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array($fieldNameAux), "The \"{0}\" attribute is not array")));
|
||||
}
|
||||
}
|
||||
|
||||
//empty
|
||||
if (!$arrayFieldDefinition[$fieldName]["empty"]) {
|
||||
$arrayAux = array();
|
||||
|
||||
if (is_array($fieldValue)) {
|
||||
$arrayAux = $fieldValue;
|
||||
}
|
||||
|
||||
if (is_string($fieldValue) && trim($fieldValue) . "" != "") {
|
||||
eval("\$arrayAux = $fieldValue;");
|
||||
}
|
||||
|
||||
if (count($arrayAux) == 0) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array($fieldNameAux), "The \"{0}\" attribute is empty")));
|
||||
}
|
||||
}
|
||||
|
||||
//defaultValues
|
||||
if (count($arrayFieldDefinition[$fieldName]["defaultValues"]) > 0) {
|
||||
$arrayAux = array();
|
||||
|
||||
if (is_array($fieldValue)) {
|
||||
$arrayAux = $fieldValue;
|
||||
}
|
||||
|
||||
if (is_string($fieldValue) && trim($fieldValue) . "" != "") {
|
||||
eval("\$arrayAux = $fieldValue;");
|
||||
}
|
||||
|
||||
foreach ($arrayAux as $value) {
|
||||
if (!in_array($value, $arrayFieldDefinition[$fieldName]["defaultValues"])) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array($fieldNameAux), "Invalid value specified for \"{0}\"")));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -287,7 +323,7 @@ class Process
|
||||
*
|
||||
* return void Throw exception if doesn't exists the Process in table PROCESS
|
||||
*/
|
||||
public function throwExceptionIfNoExistsProcess($processUid, $fieldNameForException)
|
||||
public function throwExceptionIfNotExistsProcess($processUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$process = new \Process();
|
||||
@@ -310,7 +346,7 @@ class Process
|
||||
*
|
||||
* return void Throw exception if doesn't exists the User in table USERS
|
||||
*/
|
||||
public function throwExceptionIfNoExistsUser($userUid, $fieldNameForException)
|
||||
public function throwExceptionIfNotExistsUser($userUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$user = new \Users();
|
||||
@@ -347,29 +383,6 @@ class Process
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if doesn't exists the Calendar Definition in table CALENDAR_DEFINITION
|
||||
*
|
||||
* @param string $calendarDefinitionUid Unique id of Calendar Definition
|
||||
* @param string $fieldNameForException Field name for the exception
|
||||
*
|
||||
* return void Throw exception if doesn't exists the Calendar Definition in table CALENDAR_DEFINITION
|
||||
*/
|
||||
public function throwExceptionIfNotExistsCalendarDefinition($calendarDefinitionUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$obj = \CalendarDefinitionPeer::retrieveByPK($calendarDefinitionUid);
|
||||
|
||||
if (!(is_object($obj) && get_class($obj) == "CalendarDefinition")) {
|
||||
$msg = str_replace(array("{0}", "{1}"), array($fieldNameForException, $calendarDefinitionUid), "The calendar definition with {0}: {1}, does not exist");
|
||||
|
||||
throw (new \Exception($msg));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if doesn't exists the Process Category in table PROCESS_CATEGORY
|
||||
*
|
||||
@@ -498,7 +511,7 @@ class Process
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
$this->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, false);
|
||||
|
||||
@@ -507,7 +520,9 @@ class Process
|
||||
}
|
||||
|
||||
if (isset($arrayData["PRO_CALENDAR"]) && $arrayData["PRO_CALENDAR"] . "" != "") {
|
||||
$this->throwExceptionIfNotExistsCalendarDefinition($arrayData["PRO_CALENDAR"], $this->arrayFieldNameForException["processCalendar"]);
|
||||
$calendar = new \BusinessModel\Calendar();
|
||||
|
||||
$calendar->throwExceptionIfNotExistsCalendar($arrayData["PRO_CALENDAR"], $this->arrayFieldNameForException["processCalendar"]);
|
||||
}
|
||||
|
||||
if (isset($arrayData["PRO_CATEGORY"]) && $arrayData["PRO_CATEGORY"] . "" != "") {
|
||||
@@ -543,11 +558,11 @@ class Process
|
||||
}
|
||||
|
||||
if (isset($arrayData["PRO_PARENT"])) {
|
||||
$this->throwExceptionIfNoExistsProcess($arrayData["PRO_PARENT"], $this->arrayFieldNameForException["processParent"]);
|
||||
$this->throwExceptionIfNotExistsProcess($arrayData["PRO_PARENT"], $this->arrayFieldNameForException["processParent"]);
|
||||
}
|
||||
|
||||
if (isset($arrayData["PRO_CREATE_USER"]) && $arrayData["PRO_CREATE_USER"] . "" != "") {
|
||||
$this->throwExceptionIfNoExistsUser($arrayData["PRO_CREATE_USER"], $this->arrayFieldNameForException["processCreateUser"]);
|
||||
$this->throwExceptionIfNotExistsUser($arrayData["PRO_CREATE_USER"], $this->arrayFieldNameForException["processCreateUser"]);
|
||||
}
|
||||
|
||||
//Update
|
||||
@@ -598,7 +613,7 @@ class Process
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
//Get data
|
||||
//Load Process
|
||||
@@ -1372,7 +1387,7 @@ class Process
|
||||
$arrayDynaForm = array();
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
//Get data
|
||||
$dynaForm = new \BusinessModel\DynaForm();
|
||||
@@ -1413,7 +1428,7 @@ class Process
|
||||
$arrayInputDocument = array();
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
//Get data
|
||||
$inputDocument = new \BusinessModel\InputDocument();
|
||||
@@ -1545,7 +1560,7 @@ class Process
|
||||
$arrayVariable = array();
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
//Get data
|
||||
switch ($option) {
|
||||
@@ -1602,7 +1617,7 @@ class Process
|
||||
$arrayLibrary = array();
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
|
||||
|
||||
//Get data
|
||||
\G::LoadClass("triggerLibrary");
|
||||
|
||||
@@ -196,7 +196,7 @@ class Step
|
||||
*
|
||||
* return void Throw exception if doesn't exist the Step in table STEP
|
||||
*/
|
||||
public function throwExceptionIfNoExistsStep($stepUid)
|
||||
public function throwExceptionIfNotExistsStep($stepUid)
|
||||
{
|
||||
$step = new \Step();
|
||||
|
||||
@@ -217,7 +217,7 @@ class Step
|
||||
*
|
||||
* return void Throw exception if doesn't exist the Task in table TASK
|
||||
*/
|
||||
public function throwExceptionIfNoExistsTask($taskUid)
|
||||
public function throwExceptionIfNotExistsTask($taskUid)
|
||||
{
|
||||
$task = new \Task();
|
||||
|
||||
@@ -238,7 +238,7 @@ class Step
|
||||
*
|
||||
* return void Throw exception if doesn't exist the Process in table PROCESS
|
||||
*/
|
||||
public function throwExceptionIfNoExistsProcess($processUid)
|
||||
public function throwExceptionIfNotExistsProcess($processUid)
|
||||
{
|
||||
$process = new \Process();
|
||||
|
||||
@@ -269,9 +269,9 @@ class Step
|
||||
unset($arrayData["STEP_UID"]);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsTask($taskUid);
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
|
||||
$this->throwExceptionIfNoExistsProcess($processUid);
|
||||
$this->throwExceptionIfNotExistsProcess($processUid);
|
||||
|
||||
if (!isset($arrayData["STEP_TYPE_OBJ"])) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array($this->arrayParamException["stepTypeObj"]), "The \"{0}\" attribute is not defined")));
|
||||
@@ -361,7 +361,7 @@ class Step
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsStep($stepUid);
|
||||
$this->throwExceptionIfNotExistsStep($stepUid);
|
||||
|
||||
//Load Step
|
||||
$step = new \Step();
|
||||
@@ -460,7 +460,7 @@ class Step
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsStep($stepUid);
|
||||
$this->throwExceptionIfNotExistsStep($stepUid);
|
||||
|
||||
//Get position
|
||||
$criteria = new \Criteria("workflow");
|
||||
@@ -503,7 +503,7 @@ class Step
|
||||
$step->setArrayParamException($this->arrayParamException);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsTask($taskUid);
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
|
||||
//Get data
|
||||
$criteria = new \Criteria("workflow");
|
||||
@@ -544,7 +544,7 @@ class Step
|
||||
$arrayStep = array();
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsStep($stepUid);
|
||||
$this->throwExceptionIfNotExistsStep($stepUid);
|
||||
|
||||
//Get data
|
||||
//Call plugin
|
||||
@@ -642,11 +642,11 @@ class Step
|
||||
|
||||
//Verify data
|
||||
if ($stepUid != "") {
|
||||
$this->throwExceptionIfNoExistsStep($stepUid);
|
||||
$this->throwExceptionIfNotExistsStep($stepUid);
|
||||
}
|
||||
|
||||
if ($stepUid == "") {
|
||||
$this->throwExceptionIfNoExistsTask($taskUid);
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
}
|
||||
|
||||
//Get data
|
||||
@@ -757,11 +757,11 @@ class Step
|
||||
|
||||
//Verify data
|
||||
if ($stepUid != "") {
|
||||
$this->throwExceptionIfNoExistsStep($stepUid);
|
||||
$this->throwExceptionIfNotExistsStep($stepUid);
|
||||
}
|
||||
|
||||
if ($stepUid == "") {
|
||||
$this->throwExceptionIfNoExistsTask($taskUid);
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
}
|
||||
|
||||
//Get data
|
||||
|
||||
@@ -70,7 +70,7 @@ class Task
|
||||
*
|
||||
* return void Throw exception if doesn't exist the Task in table TASK
|
||||
*/
|
||||
public function throwExceptionIfNoExistsTask($taskUid)
|
||||
public function throwExceptionIfNotExistsTask($taskUid)
|
||||
{
|
||||
$task = new \Task();
|
||||
|
||||
@@ -438,7 +438,7 @@ class Task
|
||||
$arrayAvailableStep = array();
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsTask($taskUid);
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
|
||||
//Load Task
|
||||
$task = new \Task();
|
||||
@@ -641,7 +641,7 @@ class Task
|
||||
$step->setArrayParamException($this->arrayParamException);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNoExistsTask($taskUid);
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
|
||||
//Get data
|
||||
$criteria = new \Criteria("workflow");
|
||||
@@ -1937,5 +1937,254 @@ class Task
|
||||
unset($array[$variable]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of assignees of an activity
|
||||
*
|
||||
* @param string $sProcessUID {@min 32} {@max 32}
|
||||
* @param string $sTaskUID {@min 32} {@max 32}
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
* @param string $type
|
||||
*
|
||||
* return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getTaskAssigneesAll($sProcessUID, $sTaskUID, $filter, $start, $limit, $type)
|
||||
{
|
||||
try {
|
||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||
if (is_null($oProcess)) {
|
||||
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' does not correspond to a registered process'));
|
||||
}
|
||||
$oActivity = \TaskPeer::retrieveByPK( $sTaskUID );
|
||||
if (is_null($oActivity)) {
|
||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' does not correspond to a registered activity'));
|
||||
}
|
||||
$aUsers = array();
|
||||
$oTasks = new \Tasks();
|
||||
$aAux = $oTasks->getGroupsOfTask($sTaskUID, 1);
|
||||
$aGroupUids = array();
|
||||
foreach ($aAux as $aGroup) {
|
||||
$aGroupUids[] = $aGroup['GRP_UID'];
|
||||
}
|
||||
foreach ($aGroupUids as $results) {
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('USR_UID');
|
||||
$oCriteria->add(\GroupUserPeer::GRP_UID, $results);
|
||||
$oGroupDataset = \GroupUserPeer::doSelectRS($oCriteria);
|
||||
$oGroupDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oGroupDataset->next()) {
|
||||
$aGroupRow = $oGroupDataset->getRow();
|
||||
$oGroupCriteria = new \Criteria('workflow');
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
if ($filter != '') {
|
||||
$oGroupCriteria->add($oGroupCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%$filter%",
|
||||
\Criteria::LIKE)->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME,
|
||||
"%$filter%", \Criteria::LIKE))->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME,
|
||||
"%$filter%", \Criteria::LIKE)));
|
||||
}
|
||||
$oGroupCriteria->add(\UsersPeer::USR_UID, $aGroupRow["USR_UID"]);
|
||||
$oUserDataset = \UsersPeer::doSelectRS($oGroupCriteria);
|
||||
$oUserDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oUserDataset->next();
|
||||
while ($aUserRow = $oUserDataset->getRow()) {
|
||||
$aUsers[] = array('aas_uid' => $aUserRow['USR_UID'],
|
||||
'aas_name' => $aUserRow['USR_FIRSTNAME'],
|
||||
'aas_lastname' => $aUserRow['USR_LASTNAME'],
|
||||
'aas_username' => $aUserRow['USR_USERNAME'],
|
||||
'aas_type' => "user" );
|
||||
$oUserDataset->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
if ($filter != '') {
|
||||
$oCriteria->add($oCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%$filter%", \Criteria::LIKE)
|
||||
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%$filter%", \Criteria::LIKE))
|
||||
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%$filter%", \Criteria::LIKE )));
|
||||
}
|
||||
$oCriteria->addJoin(\TaskUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, 1);
|
||||
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
||||
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($type == '' || $type == 'user') {
|
||||
$aUsers[] = array('aas_uid' => $aRow['USR_UID'],
|
||||
'aas_name' => $aRow['USR_FIRSTNAME'],
|
||||
'aas_lastname' => $aRow['USR_LASTNAME'],
|
||||
'aas_username' => $aRow['USR_USERNAME'],
|
||||
'aas_type' => "user" );
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
$aUsersGroups = array();
|
||||
$exclude = array("");
|
||||
for ($i = 0; $i<=count($aUsers)-1; $i++) {
|
||||
if (!in_array(trim($aUsers[$i]["aas_uid"]) ,$exclude)) {
|
||||
$aUsersGroups[] = $aUsers[$i];
|
||||
$exclude[] = trim($aUsers[$i]["aas_uid"]);
|
||||
}
|
||||
}
|
||||
if ($start) {
|
||||
if ($start < 0) {
|
||||
throw (new \Exception( 'Invalid value specified for `start`.'));
|
||||
}
|
||||
} else {
|
||||
$start = 0;
|
||||
}
|
||||
if (isset($limit)) {
|
||||
if ($limit < 0) {
|
||||
throw (new \Exception( 'Invalid value specified for `limit`.'));
|
||||
} else {
|
||||
if ($limit == 0) {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$limit = 1000;
|
||||
}
|
||||
$aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit);
|
||||
return $aUsersGroups;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of adhoc assignees of an activity
|
||||
*
|
||||
* @param string $sProcessUID {@min 32} {@max 32}
|
||||
* @param string $sTaskUID {@min 32} {@max 32}
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
* @param string $type
|
||||
*
|
||||
* return array
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function getTaskAdhocAssigneesAll($sProcessUID, $sTaskUID, $filter, $start, $limit, $type)
|
||||
{
|
||||
try {
|
||||
$oProcess = \ProcessPeer::retrieveByPK( $sProcessUID );
|
||||
if (is_null($oProcess)) {
|
||||
throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' does not correspond to a registered process'));
|
||||
}
|
||||
$oActivity = \TaskPeer::retrieveByPK( $sTaskUID );
|
||||
if (is_null($oActivity)) {
|
||||
throw (new \Exception( 'This id for `act_uid`: '. $sTaskUID .' does not correspond to a registered activity'));
|
||||
}
|
||||
$aUsers = array();
|
||||
$oTasks = new \Tasks();
|
||||
$aAux = $oTasks->getGroupsOfTask($sTaskUID, 2);
|
||||
$aGroupUids = array();
|
||||
foreach ($aAux as $aGroup) {
|
||||
$aGroupUids[] = $aGroup['GRP_UID'];
|
||||
}
|
||||
foreach ($aGroupUids as $results) {
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('USR_UID');
|
||||
$oCriteria->add(\GroupUserPeer::GRP_UID, $results);
|
||||
$oGroupDataset = \GroupUserPeer::doSelectRS($oCriteria);
|
||||
$oGroupDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oGroupDataset->next()) {
|
||||
$aGroupRow = $oGroupDataset->getRow();
|
||||
$oGroupCriteria = new \Criteria('workflow');
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oGroupCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
if ($filter != '') {
|
||||
$oGroupCriteria->add($oGroupCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%$filter%",
|
||||
\Criteria::LIKE)->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME,
|
||||
"%$filter%", \Criteria::LIKE))->addOr($oGroupCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME,
|
||||
"%$filter%", \Criteria::LIKE)));
|
||||
}
|
||||
$oGroupCriteria->add(\UsersPeer::USR_UID, $aGroupRow["USR_UID"]);
|
||||
$oUserDataset = \UsersPeer::doSelectRS($oGroupCriteria);
|
||||
$oUserDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oUserDataset->next();
|
||||
while ($aUserRow = $oUserDataset->getRow()) {
|
||||
$aUsers[] = array('aas_uid' => $aUserRow['USR_UID'],
|
||||
'aas_name' => $aUserRow['USR_FIRSTNAME'],
|
||||
'aas_lastname' => $aUserRow['USR_LASTNAME'],
|
||||
'aas_username' => $aUserRow['USR_USERNAME'],
|
||||
'aas_type' => "user" );
|
||||
$oUserDataset->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
if ($filter != '') {
|
||||
$oCriteria->add($oCriteria->getNewCriterion(\UsersPeer::USR_USERNAME, "%$filter%", \Criteria::LIKE)
|
||||
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_FIRSTNAME, "%$filter%", \Criteria::LIKE))
|
||||
->addOr($oCriteria->getNewCriterion(\UsersPeer::USR_LASTNAME, "%$filter%", \Criteria::LIKE )));
|
||||
}
|
||||
$oCriteria->addJoin(\TaskUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
|
||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, 2);
|
||||
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
||||
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if ($type == '' || $type == 'user') {
|
||||
$aUsers[] = array('aas_uid' => $aRow['USR_UID'],
|
||||
'aas_name' => $aRow['USR_FIRSTNAME'],
|
||||
'aas_lastname' => $aRow['USR_LASTNAME'],
|
||||
'aas_username' => $aRow['USR_USERNAME'],
|
||||
'aas_type' => "user" );
|
||||
}
|
||||
$oDataset->next();
|
||||
}
|
||||
$aUsersGroups = array();
|
||||
$exclude = array("");
|
||||
for ($i = 0; $i<=count($aUsers)-1; $i++) {
|
||||
if (!in_array(trim($aUsers[$i]["aas_uid"]) ,$exclude)) {
|
||||
$aUsersGroups[] = $aUsers[$i];
|
||||
$exclude[] = trim($aUsers[$i]["aas_uid"]);
|
||||
}
|
||||
}
|
||||
if ($start) {
|
||||
if ($start < 0) {
|
||||
throw (new \Exception( 'Invalid value specified for `start`.'));
|
||||
}
|
||||
} else {
|
||||
$start = 0;
|
||||
}
|
||||
if (isset($limit)) {
|
||||
if ($limit < 0) {
|
||||
throw (new \Exception( 'Invalid value specified for `limit`.'));
|
||||
} else {
|
||||
if ($limit == 0) {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$limit = 1000;
|
||||
}
|
||||
$aUsersGroups = $this->arrayPagination($aUsersGroups, $start, $limit);
|
||||
return $aUsersGroups;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user