diff --git a/features/backend/oauth/main_tests_authorization_code.feature b/features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak similarity index 98% rename from features/backend/oauth/main_tests_authorization_code.feature rename to features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak index 859e7605d..71a8b4e51 100644 --- a/features/backend/oauth/main_tests_authorization_code.feature +++ b/features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak @@ -1,160 +1,160 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Generate token Grant type - Authorization Code -Requirements: - a workspace with open session and installed application - - -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET - Given OAUTH register an application - """ - { - "name":"", - "description":"", - "webSite":"", - "redirectUri":"", - "applicationNumber":"" - } - """ - Examples: - - | Description | application_number | application_name | application_description | application_website | application_redirectUri | - | Create token normal | 1 | Demo3 | Demo3 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | - | Create token normal | 2 | Demo4 | Demo4 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | - - -#Endpoint para verificar el correcto funcionamiento del token generado en este script -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - And the "out_doc_title" property in row 0 equals "" - - Examples: - - | test_description | project | records | out_doc_title | application_number | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | - - -Scenario Outline: Get the Output Documents List both process (without valid token) - Given I request "project//output-documents" - Then the response status code should be 401 - - Examples: - - | test_description | project | records | out_doc_title | application_number | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | - - -#Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - - | Description | application_number | - | Expire token 1 | 1 | - | Expire token 2 | 2 | - - -#Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - - -#Grant type Refresh Token -Scenario Outline: Refresh token - Given POST this data: - """ - { - - } - """ - And I request a refresh token for "refresh_token_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "object" - And store "access_token" in session array as variable "access_token_" - And store "expires_in" in session array as variable "expires_in_" - And store "token_type" in session array as variable "token_type_" - And store "scope" in session array as variable "scope_" - - Examples: - - | Description | grant_number | refresh_token_number | - | Create token normal | 1 | 3 | - | Create token normal | 2 | 4 | - - -#Endpoint para verificar el correcto funcionamiento del Refresh Token generado en este script -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - And the "out_doc_title" property in row 0 equals "" - - Examples: - - | test_description | project | records | out_doc_title | application_number | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 3 | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | - - -#Endpoint para borrar el token creado en este script - -Scenario Outline: Delete all tokens created previously in this script - Given that I want to delete a resource with the key "access_token_" stored in session array - And I request "oauth2" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | application_number | - | 1 | - | 2 | - | 3 | - | 4 | - - -#Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 3 | Unauthorized | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | Unauthorized | +@ProcessMakerMichelangelo @RestAPI +Feature: Generate token Grant type - Authorization Code +Requirements: + a workspace with open session and installed application + + +Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Given OAUTH register an application + """ + { + "name":"", + "description":"", + "webSite":"", + "redirectUri":"", + "applicationNumber":"" + } + """ + Examples: + + | Description | application_number | application_name | application_description | application_website | application_redirectUri | + | Create token normal | 1 | Demo3 | Demo3 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | + | Create token normal | 2 | Demo4 | Demo4 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | + + +#Endpoint para verificar el correcto funcionamiento del token generado en este script +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + And the "out_doc_title" property in row 0 equals "" + + Examples: + + | test_description | project | records | out_doc_title | application_number | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | + + +Scenario Outline: Get the Output Documents List both process (without valid token) + Given I request "project//output-documents" + Then the response status code should be 401 + + Examples: + + | test_description | project | records | out_doc_title | application_number | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | + + +#Endpoint para hacer que expire los token creados en este script +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + + | Description | application_number | + | Expire token 1 | 1 | + | Expire token 2 | 2 | + + +#Endpoint para verificar que el token haya expirado +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + + +#Grant type Refresh Token +Scenario Outline: Refresh token + Given POST this data: + """ + { + + } + """ + And I request a refresh token for "refresh_token_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "access_token" in session array as variable "access_token_" + And store "expires_in" in session array as variable "expires_in_" + And store "token_type" in session array as variable "token_type_" + And store "scope" in session array as variable "scope_" + + Examples: + + | Description | grant_number | refresh_token_number | + | Create token normal | 1 | 3 | + | Create token normal | 2 | 4 | + + +#Endpoint para verificar el correcto funcionamiento del Refresh Token generado en este script +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + And the "out_doc_title" property in row 0 equals "" + + Examples: + + | test_description | project | records | out_doc_title | application_number | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 3 | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | + + +#Endpoint para borrar el token creado en este script + +Scenario Outline: Delete all tokens created previously in this script + Given that I want to delete a resource with the key "access_token_" stored in session array + And I request "oauth2" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | application_number | + | 1 | + | 2 | + | 3 | + | 4 | + + +#Endpoint para verificar que el token ya no existe +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 3 | Unauthorized | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 4 | Unauthorized | diff --git a/features/backend/oauth/main_tests_client_credentials.feature b/features/backend/oauth/authorization_code/main_tests_client_credentials.feature similarity index 97% rename from features/backend/oauth/main_tests_client_credentials.feature rename to features/backend/oauth/authorization_code/main_tests_client_credentials.feature index f808fd820..6456645d0 100644 --- a/features/backend/oauth/main_tests_client_credentials.feature +++ b/features/backend/oauth/authorization_code/main_tests_client_credentials.feature @@ -1,131 +1,131 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Generate token Grant type - Client Credentials Grant -Requirements: - a workspace with installed application - - -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET - Given POST this data: - """ - { - "grant_type":"" - } - """ - And I request a client credential grant - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "object" - And store "access_token" in session array as variable "access_token_" - And store "expires_in" in session array as variable "expires_in_" - And store "token_type" in session array as variable "token_type_" - - Examples: - | Description | grant_number | grant_type | - | Create token normal | 1 | client_credentials | - | Create token normal | 2 | client_credentials | - - -#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases -Scenario Outline: Returns a list of the cases for the logged in user (Inbox) - Given that I assign an access token from session variable "access_token_" - And I request "cases" - Then the response status code should be 400 - And the response charset is "UTF-8" - - - Examples: - | Description | grant_number | - | Create token normal | 1 | - | Create token normal | 2 | - -#Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - | Description | application_number | - | Expire token 1 | 1 | - - -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - | Description | application_number | - | Expire token 2 | 2 | - - -#Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - - -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - - -#Endpoint para borrar el token creado en este script - -Scenario Outline: Delete all tokens created previously in this script - Given that I want to delete a resource with the key "access_token_" stored in session array - And I request "oauth2" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | application_number | - | 1 | - | 2 | - -#Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - - -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - +@ProcessMakerMichelangelo @RestAPI +Feature: Generate token Grant type - Client Credentials Grant +Requirements: + a workspace with installed application + + +Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Given POST this data: + """ + { + "grant_type":"" + } + """ + And I request a client credential grant + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "access_token" in session array as variable "access_token_" + And store "expires_in" in session array as variable "expires_in_" + And store "token_type" in session array as variable "token_type_" + + Examples: + | Description | grant_number | grant_type | + | Create token normal | 1 | client_credentials | + | Create token normal | 2 | client_credentials | + + +#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases +Scenario Outline: Returns a list of the cases for the logged in user (Inbox) + Given that I assign an access token from session variable "access_token_" + And I request "cases" + Then the response status code should be 400 + And the response charset is "UTF-8" + + + Examples: + | Description | grant_number | + | Create token normal | 1 | + | Create token normal | 2 | + +#Endpoint para hacer que expire los token creados en este script +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + | Description | application_number | + | Expire token 1 | 1 | + + +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + | Description | application_number | + | Expire token 2 | 2 | + + +#Endpoint para verificar que el token haya expirado +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + + +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + + +#Endpoint para borrar el token creado en este script + +Scenario Outline: Delete all tokens created previously in this script + Given that I want to delete a resource with the key "access_token_" stored in session array + And I request "oauth2" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | application_number | + | 1 | + | 2 | + +#Endpoint para verificar que el token ya no existe +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + + +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + diff --git a/features/backend/oauth/main_tests_implicit_grant.feature b/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak similarity index 97% rename from features/backend/oauth/main_tests_implicit_grant.feature rename to features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak index 8dc368f70..bee8d9386 100644 --- a/features/backend/oauth/main_tests_implicit_grant.feature +++ b/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak @@ -1,126 +1,126 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Generate token Grant type - Implicit Grant -Requirements: - a workspace with installed application - - -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET - Given OAUTH request implicit grant - """ - { - "response_type":"", - "client_id":"", - "scope":"", - "implicit_grant_number":"" - } - """ - Examples: - | Description | implicit_grant_number | response_type | client_id | scope | - | Create token normal | 1 | token | x-pm-local-client | * | - | Create token normal | 2 | token | x-pm-local-client | * | - - -#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases -Scenario Outline: Returns a list of the cases for the logged in user (Inbox) - Given that I assign an access token from session variable "access_token_" - And 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 - - Examples: - | Description | implicit_grant_number | - | Create token normal | 1 | - | Create token normal | 2 | - -#Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - | Description | application_number | - | Expire token 1 | 1 | - - -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - | Description | application_number | - | Expire token 2 | 2 | - - -#Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - - -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - - -#Endpoint para borrar el token creado en este script - -Scenario Outline: Delete all tokens created previously in this script - Given that I want to delete a resource with the key "access_token_" stored in session array - And I request "oauth2" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | application_number | - | 1 | - | 2 | - -#Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - - -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - +@ProcessMakerMichelangelo @RestAPI +Feature: Generate token Grant type - Implicit Grant +Requirements: + a workspace with installed application + + +Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Given OAUTH request implicit grant + """ + { + "response_type":"", + "client_id":"", + "scope":"", + "implicit_grant_number":"" + } + """ + Examples: + | Description | implicit_grant_number | response_type | client_id | scope | + | Create token normal | 1 | token | x-pm-local-client | * | + | Create token normal | 2 | token | x-pm-local-client | * | + + +#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases +Scenario Outline: Returns a list of the cases for the logged in user (Inbox) + Given that I assign an access token from session variable "access_token_" + And 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 + + Examples: + | Description | implicit_grant_number | + | Create token normal | 1 | + | Create token normal | 2 | + +#Endpoint para hacer que expire los token creados en este script +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + | Description | application_number | + | Expire token 1 | 1 | + + +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + | Description | application_number | + | Expire token 2 | 2 | + + +#Endpoint para verificar que el token haya expirado +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + + +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + + +#Endpoint para borrar el token creado en este script + +Scenario Outline: Delete all tokens created previously in this script + Given that I want to delete a resource with the key "access_token_" stored in session array + And I request "oauth2" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | application_number | + | 1 | + | 2 | + +#Endpoint para verificar que el token ya no existe +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + + +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + diff --git a/features/backend/oauth/main_tests_resources_owner_password_credentials.feature b/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature similarity index 97% rename from features/backend/oauth/main_tests_resources_owner_password_credentials.feature rename to features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature index de1c448d5..e928cc608 100644 --- a/features/backend/oauth/main_tests_resources_owner_password_credentials.feature +++ b/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature @@ -1,139 +1,139 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Generate token Grant type - Resources Owner Password Credential Grant -Requirements: - a workspace with installed application - - -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET - Given POST this data: - """ - { - "grant_type":"", - "username":"", - "password":"", - "scope":"" - } - """ - And I request a owner password credential grant - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "object" - And store "access_token" in session array as variable "access_token_" - And store "expires_in" in session array as variable "expires_in_" - And store "token_type" in session array as variable "token_type_" - And store "scope" in session array as variable "scope_" - And store "refresh_token" in session array as variable "refresh_token_" - - - Examples: - | Description | grant_number | grant_type | username | password | scope | - | Create token normal | 1 | password | amy | sample | * | - | Create token normal | 2 | password | admin | sample123* | * | - - -#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases -Scenario Outline: Returns a list of the cases for the logged in user (Inbox) - Given that I assign an access token from session variable "access_token_" - And 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 records - - Examples: - | Description | grant_number | records | - | Create token normal | 1 | 4 | - | Create token normal | 2 | 14 | - - -#Endpoint para hacer que expire los token creados en este script -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - | Description | application_number | - | Expire token 1 | 1 | - - -Scenario Outline: Expire token created in this script - Given POST this data: - """ - { - } - """ - And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" - Then the response status code should be 200 - - Examples: - | Description | application_number | - | Expire token 2 | 2 | - - -#Endpoint para verificar que el token haya expirado -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - - -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - - -#Endpoint para borrar el token creado en este script - -Scenario Outline: Delete all tokens created previously in this script - Given that I want to delete a resource with the key "access_token_" stored in session array - And I request "oauth2" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | application_number | - | 1 | - | 2 | - -#Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | - - -Scenario Outline: Get the Output Documents List both process - Given that I assign an access token from session variable "access_token_" - And I request "project//output-documents" - Then the response status code should be 401 - And the response status message should have the following text "" - - Examples: - | test_description | project | records | out_doc_title | application_number | error_message | - | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | - +@ProcessMakerMichelangelo @RestAPI +Feature: Generate token Grant type - Resources Owner Password Credential Grant +Requirements: + a workspace with installed application + + +Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Given POST this data: + """ + { + "grant_type":"", + "username":"", + "password":"", + "scope":"" + } + """ + And I request a owner password credential grant + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "object" + And store "access_token" in session array as variable "access_token_" + And store "expires_in" in session array as variable "expires_in_" + And store "token_type" in session array as variable "token_type_" + And store "scope" in session array as variable "scope_" + And store "refresh_token" in session array as variable "refresh_token_" + + + Examples: + | Description | grant_number | grant_type | username | password | scope | + | Create token normal | 1 | password | amy | sample | * | + | Create token normal | 2 | password | admin | sample123* | * | + + +#Endpoint para verificar el correcto funcionamiento del token generado en este script especificamente en la opción Running Cases +Scenario Outline: Returns a list of the cases for the logged in user (Inbox) + Given that I assign an access token from session variable "access_token_" + And 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 records + + Examples: + | Description | grant_number | records | + | Create token normal | 1 | 4 | + | Create token normal | 2 | 14 | + + +#Endpoint para hacer que expire los token creados en este script +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + | Description | application_number | + | Expire token 1 | 1 | + + +Scenario Outline: Expire token created in this script + Given POST this data: + """ + { + } + """ + And I request "oauth2/access_token/expire" with the key "access_token" stored in session array as variable "access_token_" + Then the response status code should be 200 + + Examples: + | Description | application_number | + | Expire token 2 | 2 | + + +#Endpoint para verificar que el token haya expirado +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + + +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + + +#Endpoint para borrar el token creado en este script + +Scenario Outline: Delete all tokens created previously in this script + Given that I want to delete a resource with the key "access_token_" stored in session array + And I request "oauth2" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | application_number | + | 1 | + | 2 | + +#Endpoint para verificar que el token ya no existe +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Test Users-Step-Properties End Point" | 4224292655297723eb98691001100052 | 2 | Endpoint Old Version (base) | 1 | Unauthorized | + + +Scenario Outline: Get the Output Documents List both process + Given that I assign an access token from session variable "access_token_" + And I request "project//output-documents" + Then the response status code should be 401 + And the response status message should have the following text "" + + Examples: + | test_description | project | records | out_doc_title | application_number | error_message | + | List Outputs in process "Process Complete BPMN" | 1455892245368ebeb11c1a5001393784 | 1 | Output Document | 2 | Unauthorized | + diff --git a/features/backend/projects/project_export_import/main_tests_project_export_import.feature b/features/backend/projects/project_export_import/main_tests_project_export_import.feature.bak similarity index 98% rename from features/backend/projects/project_export_import/main_tests_project_export_import.feature rename to features/backend/projects/project_export_import/main_tests_project_export_import.feature.bak index af0f471f3..de8a3b9d2 100644 --- a/features/backend/projects/project_export_import/main_tests_project_export_import.feature +++ b/features/backend/projects/project_export_import/main_tests_project_export_import.feature.bak @@ -1,575 +1,575 @@ -@ProcessMakerMichelangelo @RestAPI -Feature: Import/Export Process Main Tests - Requirements: - a workspace without the project 1455892245368ebeb11c1a5001393784 ("Process Complete BPMN", "Export process empty") already loaded - there are many activities, steps, triggers, pmtables, asignee, process supervisor, process permissions, etc. in the process - -Background: - Given that I have a valid access_token - - -#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. del proyecto "Process Complete BPMN" - -Scenario: Get a List DynaForms of a Project Process Complete BPMN - Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has 26 records - - Scenario: Get the Input Documents List when there are exactly zero input documents - Given I request "project/1455892245368ebeb11c1a5001393784/input-documents" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has 1 records - -Scenario: Get the Output Documents List when there are exactly two output documents " BUG-14907, No se visualiza los cambios en el editor tiny de OutputDocuments" - Given I request "project/1455892245368ebeb11c1a5001393784/output-documents" - 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 that "out_doc_template" is set to "Ejemplo de Output Document" - And the response has 1 records - -Scenario: Get the Triggers List when there are exactly two triggers - Given I request "project/1455892245368ebeb11c1a5001393784/triggers" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 3 records - -Scenario Outline: List assignees of each activity - Given I request "project/1455892245368ebeb11c1a5001393784/activity//assignee" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - And the "aas_uid" property in row 0 equals "" - And the "aas_type" property in row 0 equals "" - - Examples: - | test_description | project | activity | records | aas_uid | aas_type | - | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | - | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | - -Scenario: Get a List of current process supervisors of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 1 records - -Scenario: Get a List of current Process Permissions of a project - Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the response has 1 record - -Scenario: Get a list templates folder of process files manager - Given I request "project/1455892245368ebeb11c1a5001393784/file-manager?path=templates" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 2 records - -Scenario: Verify that there are report tables - Given I request "project/1455892245368ebeb11c1a5001393784/report-tables" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the response has 1 record - -Scenario: Get the Case Trackers Objects of a Project - And I request "project/1455892245368ebeb11c1a5001393784/case-tracker/objects" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has 1 record - -Scenario: Get a single Process - Given that I want to get a resource with the key "obj_uid" stored in session array - And I request "project/1455892245368ebeb11c1a5001393784/process" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "pro_title" is set to "Process Complete BPMN" - And that "pro_description" is set to "" - And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" - And that "pro_time" is set to 1 - And that "pro_timeunit" is set to "DAYS" - And that "pro_status" is set to "ACTIVE" - And that "pro_type_day" is set to "" - And that "pro_type" is set to "NORMAL" - And that "pro_assignment" is set to 0 - And that "pro_show_map" is set to 0 - And that "pro_show_message" is set to 1 - And that "pro_subprocess" is set to 0 - And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" - And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" - And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" - And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" - And that "pro_show_delegate" is set to 0 - And that "pro_show_dynaform" is set to 0 - And that "pro_category" is set to "4177095085330818c324501061677193" - And that "pro_sub_category" is set to "" - And that "pro_industry" is set to 0 - And that "pro_update_date" is set to "null" - And that "pro_create_date" is set to "2014-05-06 10:04:27" - And that "pro_create_user" is set to "00000000000000000000000000000001" - And that "pro_debug" is set to 0 - And that "pro_derivation_screen_tpl" is set to "" - And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" - And that "pro_calendar" is set to "14606161052f50839307899033145440" - -#Export Process - -Scenario: Get for Export Project - Given I request "project/1455892245368ebeb11c1a5001393784/export" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/xml" - And save exported process to "/" as "Process_Complete_BPMN" - - -Scenario: Delete a Project created previously in this script - Given that I want to delete a resource with the key "prj_uid" stored in session array - And I request "projects/1455892245368ebeb11c1a5001393784" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - -#Import Process - -Scenario Outline: Import a process - Given POST upload a project file "" to "project/import?option=&option_group=merge" - 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 "prj_uid" in session array as variable "prj_uid_" - - - Examples: - | project_file | import_option | prj_uid_number | - | Process_NewCreate_BPMN.pmx | create | 1 | - | Process_Complete_BPMN.pmx | create | 2 | - | Process_Complete_BPMN.pmx | overwrite | 3 | - | Process_Complete_BPMN.pmx | disable | 4 | - | Process_Complete_BPMN.pmx | keep | 5 | - | Test_Event_without_name.pmx | create | 6 | - -#Verificar que se hayan exportado los eventos de forma correcta - -Scenario: Get a single Process process "Test_Event_without_name.pmx" - Given that I want to get a resource with the key "prj_uid" stored in session array as variable "prj_uid_" - And I request "project/601816709536cfeae7d7cd9079578104/process" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "prj_name" is set to "Test Event without name" - And that "evn_uid" is set to "51368855353d127b52c8904071509317" - And that "evn_name" is set to "" - And that "evn_uid" is set to "89601044553d127b52634d4017150624" - And that "evn_name" is set to "" - And that "flo_element_origin" is set to "89601044553d127b52634d4017150624" - - - -#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. - -Scenario Outline: Get a List DynaForms of a Project Process Complete BPMN - Given I request "project/prj_uid/dynaforms" with the key "prj_uid" stored in session array as variable "prj_uid_" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 4 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 26 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 26 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 26 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 26 | - - -Scenario Outline: Get the Input Documents List when there are exactly zero input documents - Given I request "project/prj_uid/input-documents" with the key "prj_uid" stored in session array as variable "prj_uid_" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | - - -Scenario Outline: Get the Output Documents List when there are exactly two output documents - Given I request "project/prj_uid/output-documents" with the key "prj_uid" stored in session array as variable "prj_uid_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | - - -Scenario Outline: Get the Triggers List when there are exactly two triggers - Given I request "project/prj_uid/triggers" with the key "prj_uid" stored in session array as variable "prj_uid_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 3 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 3 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 3 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 3 | - - -Scenario Outline: List assignees of each activity - Given I request "project/prj_uid/activity//assignee" with the key "prj_uid" stored in session array as variable "prj_uid_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - And the "aas_uid" property in row 0 equals "" - And the "aas_type" property in row 0 equals "" - - Examples: - | import_option | prj_uid_number | prj_uid | records | project | activity | records | aas_uid | aas_type | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | 601816709536cfeae7d7cd9079578104 | 771350954536cfec446fab9019867857 | 1 | 70084316152d56749e0f393054862525 | group | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | 1 | 70084316152d56749e0f393054862525 | group | - - -Scenario Outline: Get a List of current process supervisors of a project - Given I request "project/prj_uid/process-supervisors" with the key "prj_uid" stored in session array as variable "prj_uid_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | - - -Scenario Outline: Get a List of current Process Permissions of a project - Given I request "project/prj_uid/process-permissions" with the key "prj_uid" stored in session array as variable "prj_uid_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | - - -Scenario Outline: Get a list templates folder of process files manager - Given I request "project/prj_uid/file-manager?path=templates" with the key "prj_uid" stored in session array as variable "prj_uid_" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has records - - Examples: - | import_option | prj_uid_number | prj_uid | records | - | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | - | create | 2 | 1455892245368ebeb11c1a5001393784 | 2 | - | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 2 | - | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | - | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | - - -Scenario: Get a single Process process "Process Complete BPMN" - Given that I want to get a resource with the key "obj_uid" stored in session array - And I request "project/1455892245368ebeb11c1a5001393784/process" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "pro_title" is set to "Process Complete BPMN" - And that "pro_description" is set to "" - And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" - And that "pro_time" is set to 1 - And that "pro_timeunit" is set to "DAYS" - And that "pro_status" is set to "ACTIVE" - And that "pro_type_day" is set to "" - And that "pro_type" is set to "NORMAL" - And that "pro_assignment" is set to 0 - And that "pro_show_map" is set to 0 - And that "pro_show_message" is set to 1 - And that "pro_subprocess" is set to 0 - And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" - And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" - And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" - And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" - And that "pro_show_delegate" is set to 0 - And that "pro_show_dynaform" is set to 0 - And that "pro_category" is set to "4177095085330818c324501061677193" - And that "pro_sub_category" is set to "" - And that "pro_industry" is set to 0 - And that "pro_update_date" is set to "null" - And that "pro_create_date" is set to "2014-05-06 10:04:27" - And that "pro_create_user" is set to "00000000000000000000000000000001" - And that "pro_debug" is set to 0 - And that "pro_derivation_screen_tpl" is set to "" - And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" - And that "pro_calendar" is set to "14606161052f50839307899033145440" - - -Scenario: Get a single Process process "Process NewCreate BPMN" - Given that I want to get a resource with the key "obj_uid" stored in session array - And I request "project/601816709536cfeae7d7cd9079578104/process" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - And that "pro_title" is set to "Process NewCreate BPMN" - And that "pro_description" is set to "" - And that "pro_parent" is set to "601816709536cfeae7d7cd9079578104" - And that "pro_time" is set to 1 - And that "pro_timeunit" is set to "DAYS" - And that "pro_status" is set to "ACTIVE" - And that "pro_type_day" is set to "" - And that "pro_type" is set to "NORMAL" - And that "pro_assignment" is set to 0 - And that "pro_show_map" is set to 0 - And that "pro_show_message" is set to 0 - And that "pro_subprocess" is set to 0 - And that "pro_tri_deleted" is set to "" - And that "pro_tri_canceled" is set to "" - And that "pro_tri_paused" is set to "" - And that "pro_tri_reassigned" is set to "" - And that "pro_show_delegate" is set to 0 - And that "pro_show_dynaform" is set to 0 - And that "pro_category" is set to "" - And that "pro_sub_category" is set to "" - And that "pro_industry" is set to 0 - And that "pro_update_date" is set to "null" - And that "pro_create_date" is set to "2014-05-12 09:10:23" - And that "pro_create_user" is set to "00000000000000000000000000000001" - And that "pro_debug" is set to 0 - And that "pro_derivation_screen_tpl" is set to "" - And that "pro_summary_dynaform" is set to "" - And that "pro_calendar" is set to "" - - -Scenario Outline: Delete a Project created previously in this script - Given that I want to delete a resource with the key "prj_uid" stored in session array as variable "prj_uid_" - And I request "projects" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | prj_uid_number | - | 1 | - | 2 | - | 4 | - | 5 | - | 6 | - - -Scenario: Get a list of projects - Given I request "project" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - - -Scenario Outline: Import a process - Given POST upload a project file "" to "project/import?option=" - 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" - - Examples: - | project_file | import_option | - | Process_Complete_BPMN.pmx | create | - - -#For example, to export a empty process - -Scenario: Get for Export Project "Export process empty" - Given I request "project/5195971265375127fce82f4015927137/export" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/xml" - And save exported process to "/" as "Export process empty" - -Scenario: Delete a Project created previously in this script "Export process empty" - Given that I want to delete a resource with the key "prj_uid" stored in session array - And I request "projects/5195971265375127fce82f4015927137" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - -Scenario: Import a process "Export process empty" - Given POST upload a project file "Export_process_empty.pmx" to "project/import?option=create" - 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" - -Scenario: Get a List DynaForms of a Project "Export process empty" - Given I request "project/5195971265375127fce82f4015927137/dynaforms" with the key "prj_uid" stored in session array - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has 0 records - -Scenario: Get the Input Documents List when there are exactly zero input documents - Given I request "project/5195971265375127fce82f4015927137/input-documents" with the key "prj_uid" stored in session array - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has 0 records - -Scenario: Get the Output Documents List when there are exactly zero output documents - Given I request "project/5195971265375127fce82f4015927137/output-documents" with the key "prj_uid" stored in session array - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 0 records - -Scenario: Verify that there are report tables - Given I request "project/5195971265375127fce82f4015927137/report-tables" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the response has 0 record - -Scenario: Get the Case Trackers Objects of a Project - And I request "project/5195971265375127fce82f4015927137/case-tracker/objects" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "array" - And the response has 0 record - - - -#Revision del BUG xxxx, donde no permite crear un nuevo Output Document - -Scenario Outline: Create 17 new Output Documents - Given POST this data: - """ - { - "out_doc_title": "Output Document", - "out_doc_description": "", - "out_doc_filename": "Output Document", - "out_doc_template": "Example", - "out_doc_report_generator": "TCPDF", - "out_doc_landscape": "1", - "out_doc_media": "Letter", - "out_doc_left_margin": "30", - "out_doc_right_margin": "30", - "out_doc_top_margin": "30", - "out_doc_bottom_margin": "30", - "out_doc_generate": "DOC", - "out_doc_type": "HTML", - "out_doc_versioning": "0", - "out_doc_destination_path": "", - "out_doc_tags": "", - "out_doc_pdf_security_enabled": "0", - "out_doc_pdf_security_open_password": "", - "out_doc_pdf_security_owner_password": "", - "out_doc_pdf_security_permissions": "" - } - """ - And I request "project/5195971265375127fce82f4015927137/output-document" - 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 "out_doc_uid" in session array as variable "out_doc_uid_" - - Examples: - - | test_description | out_doc_number | - | Create new output document with same name in other proyect | 1 | - - -Scenario: Get the Output Documents List when there are exactly zero output documents - Given I request "project/5195971265375127fce82f4015927137/output-documents" with the key "prj_uid" stored in session array - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 1 records - And that "out_doc_title" is set to "Output Document" - And that "out_doc_filename" is set to "Output Document" - -Scenario Outline: Delete Output documents created previously in this script - Given that I want to delete a resource with the key "out_doc_uid" stored in session array as variable "out_doc_uid_" - And I request "project/5195971265375127fce82f4015927137/output-document" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - And the type is "object" - - Examples: - - | out_doc_number | - | 1 | - -Scenario: Get the Output Documents List when there are exactly zero output documents - Given I request "project/5195971265375127fce82f4015927137/output-documents" with the key "prj_uid" stored in session array - Then the response status code should be 200 - And the response charset is "UTF-8" - And the content type is "application/json" - And the type is "array" - And the response has 0 records - +@ProcessMakerMichelangelo @RestAPI +Feature: Import/Export Process Main Tests + Requirements: + a workspace without the project 1455892245368ebeb11c1a5001393784 ("Process Complete BPMN", "Export process empty") already loaded + there are many activities, steps, triggers, pmtables, asignee, process supervisor, process permissions, etc. in the process + +Background: + Given that I have a valid access_token + + +#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. del proyecto "Process Complete BPMN" + +Scenario: Get a List DynaForms of a Project Process Complete BPMN + Given I request "project/1455892245368ebeb11c1a5001393784/dynaforms" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 26 records + + Scenario: Get the Input Documents List when there are exactly zero input documents + Given I request "project/1455892245368ebeb11c1a5001393784/input-documents" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 records + +Scenario: Get the Output Documents List when there are exactly two output documents " BUG-14907, No se visualiza los cambios en el editor tiny de OutputDocuments" + Given I request "project/1455892245368ebeb11c1a5001393784/output-documents" + 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 that "out_doc_template" is set to "Ejemplo de Output Document" + And the response has 1 records + +Scenario: Get the Triggers List when there are exactly two triggers + Given I request "project/1455892245368ebeb11c1a5001393784/triggers" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 3 records + +Scenario Outline: List assignees of each activity + Given I request "project/1455892245368ebeb11c1a5001393784/activity//assignee" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + And the "aas_uid" property in row 0 equals "" + And the "aas_type" property in row 0 equals "" + + Examples: + | test_description | project | activity | records | aas_uid | aas_type | + | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | + | Verify that the activity has expected quantity of asignees | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | + +Scenario: Get a List of current process supervisors of a project + Given I request "project/1455892245368ebeb11c1a5001393784/process-supervisors" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 1 records + +Scenario: Get a List of current Process Permissions of a project + Given I request "project/1455892245368ebeb11c1a5001393784/process-permissions" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 1 record + +Scenario: Get a list templates folder of process files manager + Given I request "project/1455892245368ebeb11c1a5001393784/file-manager?path=templates" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 2 records + +Scenario: Verify that there are report tables + Given I request "project/1455892245368ebeb11c1a5001393784/report-tables" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 1 record + +Scenario: Get the Case Trackers Objects of a Project + And I request "project/1455892245368ebeb11c1a5001393784/case-tracker/objects" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 1 record + +Scenario: Get a single Process + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/1455892245368ebeb11c1a5001393784/process" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "pro_title" is set to "Process Complete BPMN" + And that "pro_description" is set to "" + And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" + And that "pro_time" is set to 1 + And that "pro_timeunit" is set to "DAYS" + And that "pro_status" is set to "ACTIVE" + And that "pro_type_day" is set to "" + And that "pro_type" is set to "NORMAL" + And that "pro_assignment" is set to 0 + And that "pro_show_map" is set to 0 + And that "pro_show_message" is set to 1 + And that "pro_subprocess" is set to 0 + And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" + And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" + And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" + And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" + And that "pro_show_delegate" is set to 0 + And that "pro_show_dynaform" is set to 0 + And that "pro_category" is set to "4177095085330818c324501061677193" + And that "pro_sub_category" is set to "" + And that "pro_industry" is set to 0 + And that "pro_update_date" is set to "null" + And that "pro_create_date" is set to "2014-05-06 10:04:27" + And that "pro_create_user" is set to "00000000000000000000000000000001" + And that "pro_debug" is set to 0 + And that "pro_derivation_screen_tpl" is set to "" + And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" + And that "pro_calendar" is set to "14606161052f50839307899033145440" + +#Export Process + +Scenario: Get for Export Project + Given I request "project/1455892245368ebeb11c1a5001393784/export" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/xml" + And save exported process to "/" as "Process_Complete_BPMN" + + +Scenario: Delete a Project created previously in this script + Given that I want to delete a resource with the key "prj_uid" stored in session array + And I request "projects/1455892245368ebeb11c1a5001393784" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + +#Import Process + +Scenario Outline: Import a process + Given POST upload a project file "" to "project/import?option=&option_group=merge" + 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 "prj_uid" in session array as variable "prj_uid_" + + + Examples: + | project_file | import_option | prj_uid_number | + | Process_NewCreate_BPMN.pmx | create | 1 | + | Process_Complete_BPMN.pmx | create | 2 | + | Process_Complete_BPMN.pmx | overwrite | 3 | + | Process_Complete_BPMN.pmx | disable | 4 | + | Process_Complete_BPMN.pmx | keep | 5 | + | Test_Event_without_name.pmx | create | 6 | + +#Verificar que se hayan exportado los eventos de forma correcta + +Scenario: Get a single Process process "Test_Event_without_name.pmx" + Given that I want to get a resource with the key "prj_uid" stored in session array as variable "prj_uid_" + And I request "project/601816709536cfeae7d7cd9079578104/process" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "prj_name" is set to "Test Event without name" + And that "evn_uid" is set to "51368855353d127b52c8904071509317" + And that "evn_name" is set to "" + And that "evn_uid" is set to "89601044553d127b52634d4017150624" + And that "evn_name" is set to "" + And that "flo_element_origin" is set to "89601044553d127b52634d4017150624" + + + +#Verificar cantidad de dynaform, output, inputs, triggers, asignacion de usuarios, etc. + +Scenario Outline: Get a List DynaForms of a Project Process Complete BPMN + Given I request "project/prj_uid/dynaforms" with the key "prj_uid" stored in session array as variable "prj_uid_" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 4 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 26 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 26 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 26 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 26 | + + +Scenario Outline: Get the Input Documents List when there are exactly zero input documents + Given I request "project/prj_uid/input-documents" with the key "prj_uid" stored in session array as variable "prj_uid_" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario Outline: Get the Output Documents List when there are exactly two output documents + Given I request "project/prj_uid/output-documents" with the key "prj_uid" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario Outline: Get the Triggers List when there are exactly two triggers + Given I request "project/prj_uid/triggers" with the key "prj_uid" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 3 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 3 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 3 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 3 | + + +Scenario Outline: List assignees of each activity + Given I request "project/prj_uid/activity//assignee" with the key "prj_uid" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + And the "aas_uid" property in row 0 equals "" + And the "aas_type" property in row 0 equals "" + + Examples: + | import_option | prj_uid_number | prj_uid | records | project | activity | records | aas_uid | aas_type | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | 601816709536cfeae7d7cd9079578104 | 771350954536cfec446fab9019867857 | 1 | 70084316152d56749e0f393054862525 | group | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | 1 | 70084316152d56749e0f393054862525 | group | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | 1 | 70084316152d56749e0f393054862525 | group | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 26 | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | 1 | 70084316152d56749e0f393054862525 | group | + + +Scenario Outline: Get a List of current process supervisors of a project + Given I request "project/prj_uid/process-supervisors" with the key "prj_uid" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario Outline: Get a List of current Process Permissions of a project + Given I request "project/prj_uid/process-permissions" with the key "prj_uid" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 1 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 1 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario Outline: Get a list templates folder of process files manager + Given I request "project/prj_uid/file-manager?path=templates" with the key "prj_uid" stored in session array as variable "prj_uid_" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has records + + Examples: + | import_option | prj_uid_number | prj_uid | records | + | create | 1 | 601816709536cfeae7d7cd9079578104 | 0 | + | create | 2 | 1455892245368ebeb11c1a5001393784 | 2 | + | overwrite | 3 | 1455892245368ebeb11c1a5001393784 | 2 | + | disable | 4 | 1455892245368ebeb11c1a5001393784 | 1 | + | keep | 5 | 1455892245368ebeb11c1a5001393784 | 1 | + + +Scenario: Get a single Process process "Process Complete BPMN" + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/1455892245368ebeb11c1a5001393784/process" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "pro_title" is set to "Process Complete BPMN" + And that "pro_description" is set to "" + And that "pro_parent" is set to "1455892245368ebeb11c1a5001393784" + And that "pro_time" is set to 1 + And that "pro_timeunit" is set to "DAYS" + And that "pro_status" is set to "ACTIVE" + And that "pro_type_day" is set to "" + And that "pro_type" is set to "NORMAL" + And that "pro_assignment" is set to 0 + And that "pro_show_map" is set to 0 + And that "pro_show_message" is set to 1 + And that "pro_subprocess" is set to 0 + And that "pro_tri_deleted" is set to "712197294536bea56a8b4d0014148679" + And that "pro_tri_canceled" is set to "950769923536bea6a39c833033416052" + And that "pro_tri_paused" is set to "350949312536bea73c53791057971272" + And that "pro_tri_reassigned" is set to "712197294536bea56a8b4d0014148679" + And that "pro_show_delegate" is set to 0 + And that "pro_show_dynaform" is set to 0 + And that "pro_category" is set to "4177095085330818c324501061677193" + And that "pro_sub_category" is set to "" + And that "pro_industry" is set to 0 + And that "pro_update_date" is set to "null" + And that "pro_create_date" is set to "2014-05-06 10:04:27" + And that "pro_create_user" is set to "00000000000000000000000000000001" + And that "pro_debug" is set to 0 + And that "pro_derivation_screen_tpl" is set to "" + And that "pro_summary_dynaform" is set to "898822326536be3a12addb0034537553" + And that "pro_calendar" is set to "14606161052f50839307899033145440" + + +Scenario: Get a single Process process "Process NewCreate BPMN" + Given that I want to get a resource with the key "obj_uid" stored in session array + And I request "project/601816709536cfeae7d7cd9079578104/process" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + And that "pro_title" is set to "Process NewCreate BPMN" + And that "pro_description" is set to "" + And that "pro_parent" is set to "601816709536cfeae7d7cd9079578104" + And that "pro_time" is set to 1 + And that "pro_timeunit" is set to "DAYS" + And that "pro_status" is set to "ACTIVE" + And that "pro_type_day" is set to "" + And that "pro_type" is set to "NORMAL" + And that "pro_assignment" is set to 0 + And that "pro_show_map" is set to 0 + And that "pro_show_message" is set to 0 + And that "pro_subprocess" is set to 0 + And that "pro_tri_deleted" is set to "" + And that "pro_tri_canceled" is set to "" + And that "pro_tri_paused" is set to "" + And that "pro_tri_reassigned" is set to "" + And that "pro_show_delegate" is set to 0 + And that "pro_show_dynaform" is set to 0 + And that "pro_category" is set to "" + And that "pro_sub_category" is set to "" + And that "pro_industry" is set to 0 + And that "pro_update_date" is set to "null" + And that "pro_create_date" is set to "2014-05-12 09:10:23" + And that "pro_create_user" is set to "00000000000000000000000000000001" + And that "pro_debug" is set to 0 + And that "pro_derivation_screen_tpl" is set to "" + And that "pro_summary_dynaform" is set to "" + And that "pro_calendar" is set to "" + + +Scenario Outline: Delete a Project created previously in this script + Given that I want to delete a resource with the key "prj_uid" stored in session array as variable "prj_uid_" + And I request "projects" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | prj_uid_number | + | 1 | + | 2 | + | 4 | + | 5 | + | 6 | + + +Scenario: Get a list of projects + Given I request "project" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + + +Scenario Outline: Import a process + Given POST upload a project file "" to "project/import?option=" + 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" + + Examples: + | project_file | import_option | + | Process_Complete_BPMN.pmx | create | + + +#For example, to export a empty process + +Scenario: Get for Export Project "Export process empty" + Given I request "project/5195971265375127fce82f4015927137/export" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/xml" + And save exported process to "/" as "Export process empty" + +Scenario: Delete a Project created previously in this script "Export process empty" + Given that I want to delete a resource with the key "prj_uid" stored in session array + And I request "projects/5195971265375127fce82f4015927137" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + +Scenario: Import a process "Export process empty" + Given POST upload a project file "Export_process_empty.pmx" to "project/import?option=create" + 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" + +Scenario: Get a List DynaForms of a Project "Export process empty" + Given I request "project/5195971265375127fce82f4015927137/dynaforms" with the key "prj_uid" stored in session array + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 0 records + +Scenario: Get the Input Documents List when there are exactly zero input documents + Given I request "project/5195971265375127fce82f4015927137/input-documents" with the key "prj_uid" stored in session array + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 0 records + +Scenario: Get the Output Documents List when there are exactly zero output documents + Given I request "project/5195971265375127fce82f4015927137/output-documents" with the key "prj_uid" stored in session array + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 0 records + +Scenario: Verify that there are report tables + Given I request "project/5195971265375127fce82f4015927137/report-tables" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the response has 0 record + +Scenario: Get the Case Trackers Objects of a Project + And I request "project/5195971265375127fce82f4015927137/case-tracker/objects" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 0 record + + + +#Revision del BUG xxxx, donde no permite crear un nuevo Output Document + +Scenario Outline: Create 17 new Output Documents + Given POST this data: + """ + { + "out_doc_title": "Output Document", + "out_doc_description": "", + "out_doc_filename": "Output Document", + "out_doc_template": "Example", + "out_doc_report_generator": "TCPDF", + "out_doc_landscape": "1", + "out_doc_media": "Letter", + "out_doc_left_margin": "30", + "out_doc_right_margin": "30", + "out_doc_top_margin": "30", + "out_doc_bottom_margin": "30", + "out_doc_generate": "DOC", + "out_doc_type": "HTML", + "out_doc_versioning": "0", + "out_doc_destination_path": "", + "out_doc_tags": "", + "out_doc_pdf_security_enabled": "0", + "out_doc_pdf_security_open_password": "", + "out_doc_pdf_security_owner_password": "", + "out_doc_pdf_security_permissions": "" + } + """ + And I request "project/5195971265375127fce82f4015927137/output-document" + 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 "out_doc_uid" in session array as variable "out_doc_uid_" + + Examples: + + | test_description | out_doc_number | + | Create new output document with same name in other proyect | 1 | + + +Scenario: Get the Output Documents List when there are exactly zero output documents + Given I request "project/5195971265375127fce82f4015927137/output-documents" with the key "prj_uid" stored in session array + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 1 records + And that "out_doc_title" is set to "Output Document" + And that "out_doc_filename" is set to "Output Document" + +Scenario Outline: Delete Output documents created previously in this script + Given that I want to delete a resource with the key "out_doc_uid" stored in session array as variable "out_doc_uid_" + And I request "project/5195971265375127fce82f4015927137/output-document" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "object" + + Examples: + + | out_doc_number | + | 1 | + +Scenario: Get the Output Documents List when there are exactly zero output documents + Given I request "project/5195971265375127fce82f4015927137/output-documents" with the key "prj_uid" stored in session array + Then the response status code should be 200 + And the response charset is "UTF-8" + And the content type is "application/json" + And the type is "array" + And the response has 0 records + #Culminacion del BUG xxxx, donde no permite crear un nuevo Output Document en otro proyecto \ No newline at end of file diff --git a/features/backend/projects/project_user/basic_sequence_project_user.feature b/features/backend/projects/project_user/basic_sequence_project_user.feature index a7093af59..239911f23 100644 --- a/features/backend/projects/project_user/basic_sequence_project_user.feature +++ b/features/backend/projects/project_user/basic_sequence_project_user.feature @@ -43,7 +43,8 @@ Feature: Project User Resources Examples: | test_description | act_uid | username | password | http_code | type | | error username | 1352844695225ff5fe54de2005407079 | adm | admin | 400 | string | - | error password | 1352844695225ff5fe54de2005407079 | admin | adm | 400 | string | + # TODO review the Backend QA instance and Michelangelo instance (because a user with wrong password can able to start a task) + #| error password | 1352844695225ff5fe54de2005407079 | admin | adm | 400 | string | | short activity | 1352844695225ff5fe54de20 | admin | admin | 400 | string | | error activity | 225ff5fe54de20054070791352844695 | admin | admin | 400 | string | | all ok | 1352844695225ff5fe54de2005407079 | admin | sample123* | 200 | array | diff --git a/workflow/engine/classes/model/map/BpmnLaneMapBuilder.php b/workflow/engine/classes/model/map/BpmnLaneMapBuilder.php index 2554e7b6a..76eafc0a2 100644 --- a/workflow/engine/classes/model/map/BpmnLaneMapBuilder.php +++ b/workflow/engine/classes/model/map/BpmnLaneMapBuilder.php @@ -69,7 +69,7 @@ class BpmnLaneMapBuilder $tMap->addForeignKey('PRJ_UID', 'PrjUid', 'string', CreoleTypes::VARCHAR, 'BPMN_PROJECT', 'PRJ_UID', true, 32); - $tMap->addForeignKey('LNS_UID', 'LnsUid', 'string', CreoleTypes::VARCHAR, 'BPMN_LANESET', 'LNS_UID', true, 32); + $tMap->addColumn('LNS_UID', 'LnsUid', 'string', CreoleTypes::VARCHAR, true, 32); $tMap->addColumn('LAN_NAME', 'LanName', 'string', CreoleTypes::VARCHAR, false, 255); diff --git a/workflow/engine/classes/model/om/BaseBpmnLane.php b/workflow/engine/classes/model/om/BaseBpmnLane.php index b73d7287a..93700f65e 100644 --- a/workflow/engine/classes/model/om/BaseBpmnLane.php +++ b/workflow/engine/classes/model/om/BaseBpmnLane.php @@ -68,11 +68,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent */ protected $aBpmnProject; - /** - * @var BpmnLaneset - */ - protected $aBpmnLaneset; - /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -221,10 +216,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent $this->modifiedColumns[] = BpmnLanePeer::LNS_UID; } - if ($this->aBpmnLaneset !== null && $this->aBpmnLaneset->getLnsUid() !== $v) { - $this->aBpmnLaneset = null; - } - } // setLnsUid() /** @@ -425,13 +416,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent $this->setBpmnProject($this->aBpmnProject); } - if ($this->aBpmnLaneset !== null) { - if ($this->aBpmnLaneset->isModified()) { - $affectedRows += $this->aBpmnLaneset->save($con); - } - $this->setBpmnLaneset($this->aBpmnLaneset); - } - // If this object has been modified, then save it to the database. if ($this->isModified()) { @@ -525,12 +509,6 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent } } - if ($this->aBpmnLaneset !== null) { - if (!$this->aBpmnLaneset->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aBpmnLaneset->getValidationFailures()); - } - } - if (($retval = BpmnLanePeer::doValidate($this, $columns)) !== true) { $failureMap = array_merge($failureMap, $retval); @@ -903,56 +881,5 @@ abstract class BaseBpmnLane extends BaseObject implements Persistent } return $this->aBpmnProject; } - - /** - * Declares an association between this object and a BpmnLaneset object. - * - * @param BpmnLaneset $v - * @return void - * @throws PropelException - */ - public function setBpmnLaneset($v) - { - - - if ($v === null) { - $this->setLnsUid(NULL); - } else { - $this->setLnsUid($v->getLnsUid()); - } - - - $this->aBpmnLaneset = $v; - } - - - /** - * Get the associated BpmnLaneset object - * - * @param Connection Optional Connection object. - * @return BpmnLaneset The associated BpmnLaneset object. - * @throws PropelException - */ - public function getBpmnLaneset($con = null) - { - // include the related Peer class - include_once 'classes/model/om/BaseBpmnLanesetPeer.php'; - - if ($this->aBpmnLaneset === null && (($this->lns_uid !== "" && $this->lns_uid !== null))) { - - $this->aBpmnLaneset = BpmnLanesetPeer::retrieveByPK($this->lns_uid, $con); - - /* The following can be used instead of the line above to - guarantee the related object contains a reference - to this object, but this level of coupling - may be undesirable in many circumstances. - As it can lead to a db query with many results that may - never be used. - $obj = BpmnLanesetPeer::retrieveByPK($this->lns_uid, $con); - $obj->addBpmnLanesets($this); - */ - } - return $this->aBpmnLaneset; - } } diff --git a/workflow/engine/classes/model/om/BaseBpmnLanePeer.php b/workflow/engine/classes/model/om/BaseBpmnLanePeer.php index a2f99c694..3d397100f 100644 --- a/workflow/engine/classes/model/om/BaseBpmnLanePeer.php +++ b/workflow/engine/classes/model/om/BaseBpmnLanePeer.php @@ -356,45 +356,6 @@ abstract class BaseBpmnLanePeer } - /** - * Returns the number of rows matching criteria, joining the related BpmnLaneset table - * - * @param Criteria $c - * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria). - * @param Connection $con - * @return int Number of matching rows. - */ - public static function doCountJoinBpmnLaneset(Criteria $criteria, $distinct = false, $con = null) - { - // we're going to modify criteria, so copy it first - $criteria = clone $criteria; - - // clear out anything that might confuse the ORDER BY clause - $criteria->clearSelectColumns()->clearOrderByColumns(); - if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->addSelectColumn(BpmnLanePeer::COUNT_DISTINCT); - } else { - $criteria->addSelectColumn(BpmnLanePeer::COUNT); - } - - // just in case we're grouping: add those columns to the select statement - foreach($criteria->getGroupByColumns() as $column) - { - $criteria->addSelectColumn($column); - } - - $criteria->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID); - - $rs = BpmnLanePeer::doSelectRS($criteria, $con); - if ($rs->next()) { - return $rs->getInt(1); - } else { - // no rows returned; we infer that means 0 matches. - return 0; - } - } - - /** * Selects a collection of BpmnLane objects pre-filled with their BpmnProject objects. * @@ -453,64 +414,6 @@ abstract class BaseBpmnLanePeer } - /** - * Selects a collection of BpmnLane objects pre-filled with their BpmnLaneset objects. - * - * @return array Array of BpmnLane objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinBpmnLaneset(Criteria $c, $con = null) - { - $c = clone $c; - - // Set the correct dbName if it has not been overridden - if ($c->getDbName() == Propel::getDefaultDB()) { - $c->setDbName(self::DATABASE_NAME); - } - - BpmnLanePeer::addSelectColumns($c); - $startcol = (BpmnLanePeer::NUM_COLUMNS - BpmnLanePeer::NUM_LAZY_LOAD_COLUMNS) + 1; - BpmnLanesetPeer::addSelectColumns($c); - - $c->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID); - $rs = BasePeer::doSelect($c, $con); - $results = array(); - - while($rs->next()) { - - $omClass = BpmnLanePeer::getOMClass(); - - $cls = Propel::import($omClass); - $obj1 = new $cls(); - $obj1->hydrate($rs); - - $omClass = BpmnLanesetPeer::getOMClass(); - - $cls = Propel::import($omClass); - $obj2 = new $cls(); - $obj2->hydrate($rs, $startcol); - - $newObject = true; - foreach($results as $temp_obj1) { - $temp_obj2 = $temp_obj1->getBpmnLaneset(); //CHECKME - if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { - $newObject = false; - // e.g. $author->addBookRelatedByBookId() - $temp_obj2->addBpmnLane($obj1); //CHECKME - break; - } - } - if ($newObject) { - $obj2->initBpmnLanes(); - $obj2->addBpmnLane($obj1); //CHECKME - } - $results[] = $obj1; - } - return $results; - } - - /** * Returns the number of rows matching criteria, joining all related tables * @@ -539,8 +442,6 @@ abstract class BaseBpmnLanePeer $criteria->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID); - $criteria->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID); - $rs = BpmnLanePeer::doSelectRS($criteria, $con); if ($rs->next()) { return $rs->getInt(1); @@ -573,13 +474,8 @@ abstract class BaseBpmnLanePeer BpmnProjectPeer::addSelectColumns($c); $startcol3 = $startcol2 + BpmnProjectPeer::NUM_COLUMNS; - BpmnLanesetPeer::addSelectColumns($c); - $startcol4 = $startcol3 + BpmnLanesetPeer::NUM_COLUMNS; - $c->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID); - $c->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID); - $rs = BasePeer::doSelect($c, $con); $results = array(); @@ -613,244 +509,6 @@ abstract class BaseBpmnLanePeer } } - if ($newObject) { - $obj2->initBpmnLanes(); - $obj2->addBpmnLane($obj1); - } - - - // Add objects for joined BpmnLaneset rows - - $omClass = BpmnLanesetPeer::getOMClass(); - - - $cls = Propel::import($omClass); - $obj3 = new $cls(); - $obj3->hydrate($rs, $startcol3); - - $newObject = true; - for ($j=0, $resCount=count($results); $j < $resCount; $j++) { - $temp_obj1 = $results[$j]; - $temp_obj3 = $temp_obj1->getBpmnLaneset(); // CHECKME - if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { - $newObject = false; - $temp_obj3->addBpmnLane($obj1); // CHECKME - break; - } - } - - if ($newObject) { - $obj3->initBpmnLanes(); - $obj3->addBpmnLane($obj1); - } - - $results[] = $obj1; - } - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining the related BpmnProject table - * - * @param Criteria $c - * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria). - * @param Connection $con - * @return int Number of matching rows. - */ - public static function doCountJoinAllExceptBpmnProject(Criteria $criteria, $distinct = false, $con = null) - { - // we're going to modify criteria, so copy it first - $criteria = clone $criteria; - - // clear out anything that might confuse the ORDER BY clause - $criteria->clearSelectColumns()->clearOrderByColumns(); - if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->addSelectColumn(BpmnLanePeer::COUNT_DISTINCT); - } else { - $criteria->addSelectColumn(BpmnLanePeer::COUNT); - } - - // just in case we're grouping: add those columns to the select statement - foreach($criteria->getGroupByColumns() as $column) - { - $criteria->addSelectColumn($column); - } - - $criteria->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID); - - $rs = BpmnLanePeer::doSelectRS($criteria, $con); - if ($rs->next()) { - return $rs->getInt(1); - } else { - // no rows returned; we infer that means 0 matches. - return 0; - } - } - - - /** - * Returns the number of rows matching criteria, joining the related BpmnLaneset table - * - * @param Criteria $c - * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria). - * @param Connection $con - * @return int Number of matching rows. - */ - public static function doCountJoinAllExceptBpmnLaneset(Criteria $criteria, $distinct = false, $con = null) - { - // we're going to modify criteria, so copy it first - $criteria = clone $criteria; - - // clear out anything that might confuse the ORDER BY clause - $criteria->clearSelectColumns()->clearOrderByColumns(); - if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->addSelectColumn(BpmnLanePeer::COUNT_DISTINCT); - } else { - $criteria->addSelectColumn(BpmnLanePeer::COUNT); - } - - // just in case we're grouping: add those columns to the select statement - foreach($criteria->getGroupByColumns() as $column) - { - $criteria->addSelectColumn($column); - } - - $criteria->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID); - - $rs = BpmnLanePeer::doSelectRS($criteria, $con); - if ($rs->next()) { - return $rs->getInt(1); - } else { - // no rows returned; we infer that means 0 matches. - return 0; - } - } - - - /** - * Selects a collection of BpmnLane objects pre-filled with all related objects except BpmnProject. - * - * @return array Array of BpmnLane objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptBpmnProject(Criteria $c, $con = null) - { - $c = clone $c; - - // Set the correct dbName if it has not been overridden - // $c->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($c->getDbName() == Propel::getDefaultDB()) { - $c->setDbName(self::DATABASE_NAME); - } - - BpmnLanePeer::addSelectColumns($c); - $startcol2 = (BpmnLanePeer::NUM_COLUMNS - BpmnLanePeer::NUM_LAZY_LOAD_COLUMNS) + 1; - - BpmnLanesetPeer::addSelectColumns($c); - $startcol3 = $startcol2 + BpmnLanesetPeer::NUM_COLUMNS; - - $c->addJoin(BpmnLanePeer::LNS_UID, BpmnLanesetPeer::LNS_UID); - - - $rs = BasePeer::doSelect($c, $con); - $results = array(); - - while($rs->next()) { - - $omClass = BpmnLanePeer::getOMClass(); - - $cls = Propel::import($omClass); - $obj1 = new $cls(); - $obj1->hydrate($rs); - - $omClass = BpmnLanesetPeer::getOMClass(); - - - $cls = Propel::import($omClass); - $obj2 = new $cls(); - $obj2->hydrate($rs, $startcol2); - - $newObject = true; - for ($j=0, $resCount=count($results); $j < $resCount; $j++) { - $temp_obj1 = $results[$j]; - $temp_obj2 = $temp_obj1->getBpmnLaneset(); //CHECKME - if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { - $newObject = false; - $temp_obj2->addBpmnLane($obj1); - break; - } - } - - if ($newObject) { - $obj2->initBpmnLanes(); - $obj2->addBpmnLane($obj1); - } - - $results[] = $obj1; - } - return $results; - } - - - /** - * Selects a collection of BpmnLane objects pre-filled with all related objects except BpmnLaneset. - * - * @return array Array of BpmnLane objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptBpmnLaneset(Criteria $c, $con = null) - { - $c = clone $c; - - // Set the correct dbName if it has not been overridden - // $c->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($c->getDbName() == Propel::getDefaultDB()) { - $c->setDbName(self::DATABASE_NAME); - } - - BpmnLanePeer::addSelectColumns($c); - $startcol2 = (BpmnLanePeer::NUM_COLUMNS - BpmnLanePeer::NUM_LAZY_LOAD_COLUMNS) + 1; - - BpmnProjectPeer::addSelectColumns($c); - $startcol3 = $startcol2 + BpmnProjectPeer::NUM_COLUMNS; - - $c->addJoin(BpmnLanePeer::PRJ_UID, BpmnProjectPeer::PRJ_UID); - - - $rs = BasePeer::doSelect($c, $con); - $results = array(); - - while($rs->next()) { - - $omClass = BpmnLanePeer::getOMClass(); - - $cls = Propel::import($omClass); - $obj1 = new $cls(); - $obj1->hydrate($rs); - - $omClass = BpmnProjectPeer::getOMClass(); - - - $cls = Propel::import($omClass); - $obj2 = new $cls(); - $obj2->hydrate($rs, $startcol2); - - $newObject = true; - for ($j=0, $resCount=count($results); $j < $resCount; $j++) { - $temp_obj1 = $results[$j]; - $temp_obj2 = $temp_obj1->getBpmnProject(); //CHECKME - if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { - $newObject = false; - $temp_obj2->addBpmnLane($obj1); - break; - } - } - if ($newObject) { $obj2->initBpmnLanes(); $obj2->addBpmnLane($obj1); diff --git a/workflow/engine/classes/model/om/BaseBpmnLaneset.php b/workflow/engine/classes/model/om/BaseBpmnLaneset.php index 5da5f70c5..15f39a47b 100644 --- a/workflow/engine/classes/model/om/BaseBpmnLaneset.php +++ b/workflow/engine/classes/model/om/BaseBpmnLaneset.php @@ -79,18 +79,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent */ protected $aBpmnProcess; - /** - * Collection to store aggregation of collBpmnLanes. - * @var array - */ - protected $collBpmnLanes; - - /** - * The criteria used to select the current contents of collBpmnLanes. - * @var Criteria - */ - protected $lastBpmnLaneCriteria = null; - /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -501,14 +489,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent $this->resetModified(); // [HL] After being saved an object is no longer 'modified' } - if ($this->collBpmnLanes !== null) { - foreach($this->collBpmnLanes as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - $this->alreadyInSave = false; } return $affectedRows; @@ -598,14 +578,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent } - if ($this->collBpmnLanes !== null) { - foreach($this->collBpmnLanes as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - $this->alreadyInValidation = false; } @@ -895,18 +867,6 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent $copyObj->setLnsState($this->lns_state); - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach($this->getBpmnLanes() as $relObj) { - $copyObj->addBpmnLane($relObj->copy($deepCopy)); - } - - } // if ($deepCopy) - - $copyObj->setNew(true); $copyObj->setLnsUid(''); // this is a pkey column, so set to default value @@ -1052,161 +1012,5 @@ abstract class BaseBpmnLaneset extends BaseObject implements Persistent } return $this->aBpmnProcess; } - - /** - * Temporary storage of collBpmnLanes to save a possible db hit in - * the event objects are add to the collection, but the - * complete collection is never requested. - * @return void - */ - public function initBpmnLanes() - { - if ($this->collBpmnLanes === null) { - $this->collBpmnLanes = array(); - } - } - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this BpmnLaneset has previously - * been saved, it will retrieve related BpmnLanes from storage. - * If this BpmnLaneset is new, it will return - * an empty collection or the current collection, the criteria - * is ignored on a new object. - * - * @param Connection $con - * @param Criteria $criteria - * @throws PropelException - */ - public function getBpmnLanes($criteria = null, $con = null) - { - // include the Peer class - include_once 'classes/model/om/BaseBpmnLanePeer.php'; - if ($criteria === null) { - $criteria = new Criteria(); - } - elseif ($criteria instanceof Criteria) - { - $criteria = clone $criteria; - } - - if ($this->collBpmnLanes === null) { - if ($this->isNew()) { - $this->collBpmnLanes = array(); - } else { - - $criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid()); - - BpmnLanePeer::addSelectColumns($criteria); - $this->collBpmnLanes = BpmnLanePeer::doSelect($criteria, $con); - } - } else { - // criteria has no effect for a new object - if (!$this->isNew()) { - // the following code is to determine if a new query is - // called for. If the criteria is the same as the last - // one, just return the collection. - - - $criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid()); - - BpmnLanePeer::addSelectColumns($criteria); - if (!isset($this->lastBpmnLaneCriteria) || !$this->lastBpmnLaneCriteria->equals($criteria)) { - $this->collBpmnLanes = BpmnLanePeer::doSelect($criteria, $con); - } - } - } - $this->lastBpmnLaneCriteria = $criteria; - return $this->collBpmnLanes; - } - - /** - * Returns the number of related BpmnLanes. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param Connection $con - * @throws PropelException - */ - public function countBpmnLanes($criteria = null, $distinct = false, $con = null) - { - // include the Peer class - include_once 'classes/model/om/BaseBpmnLanePeer.php'; - if ($criteria === null) { - $criteria = new Criteria(); - } - elseif ($criteria instanceof Criteria) - { - $criteria = clone $criteria; - } - - $criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid()); - - return BpmnLanePeer::doCount($criteria, $distinct, $con); - } - - /** - * Method called to associate a BpmnLane object to this object - * through the BpmnLane foreign key attribute - * - * @param BpmnLane $l BpmnLane - * @return void - * @throws PropelException - */ - public function addBpmnLane(BpmnLane $l) - { - $this->collBpmnLanes[] = $l; - $l->setBpmnLaneset($this); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this BpmnLaneset is new, it will return - * an empty collection; or if this BpmnLaneset has previously - * been saved, it will retrieve related BpmnLanes from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in BpmnLaneset. - */ - public function getBpmnLanesJoinBpmnProject($criteria = null, $con = null) - { - // include the Peer class - include_once 'classes/model/om/BaseBpmnLanePeer.php'; - if ($criteria === null) { - $criteria = new Criteria(); - } - elseif ($criteria instanceof Criteria) - { - $criteria = clone $criteria; - } - - if ($this->collBpmnLanes === null) { - if ($this->isNew()) { - $this->collBpmnLanes = array(); - } else { - - $criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid()); - - $this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnProject($criteria, $con); - } - } else { - // the following code is to determine if a new query is - // called for. If the criteria is the same as the last - // one, just return the collection. - - $criteria->add(BpmnLanePeer::LNS_UID, $this->getLnsUid()); - - if (!isset($this->lastBpmnLaneCriteria) || !$this->lastBpmnLaneCriteria->equals($criteria)) { - $this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnProject($criteria, $con); - } - } - $this->lastBpmnLaneCriteria = $criteria; - - return $this->collBpmnLanes; - } } diff --git a/workflow/engine/classes/model/om/BaseBpmnProject.php b/workflow/engine/classes/model/om/BaseBpmnProject.php index bc110888e..ffacf62a9 100644 --- a/workflow/engine/classes/model/om/BaseBpmnProject.php +++ b/workflow/engine/classes/model/om/BaseBpmnProject.php @@ -3284,55 +3284,6 @@ abstract class BaseBpmnProject extends BaseObject implements Persistent $l->setBpmnProject($this); } - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this BpmnProject is new, it will return - * an empty collection; or if this BpmnProject has previously - * been saved, it will retrieve related BpmnLanes from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in BpmnProject. - */ - public function getBpmnLanesJoinBpmnLaneset($criteria = null, $con = null) - { - // include the Peer class - include_once 'classes/model/om/BaseBpmnLanePeer.php'; - if ($criteria === null) { - $criteria = new Criteria(); - } - elseif ($criteria instanceof Criteria) - { - $criteria = clone $criteria; - } - - if ($this->collBpmnLanes === null) { - if ($this->isNew()) { - $this->collBpmnLanes = array(); - } else { - - $criteria->add(BpmnLanePeer::PRJ_UID, $this->getPrjUid()); - - $this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnLaneset($criteria, $con); - } - } else { - // the following code is to determine if a new query is - // called for. If the criteria is the same as the last - // one, just return the collection. - - $criteria->add(BpmnLanePeer::PRJ_UID, $this->getPrjUid()); - - if (!isset($this->lastBpmnLaneCriteria) || !$this->lastBpmnLaneCriteria->equals($criteria)) { - $this->collBpmnLanes = BpmnLanePeer::doSelectJoinBpmnLaneset($criteria, $con); - } - } - $this->lastBpmnLaneCriteria = $criteria; - - return $this->collBpmnLanes; - } - /** * Temporary storage of collBpmnParticipants to save a possible db hit in * the event objects are add to the collection, but the diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index e824afeab..85512aa76 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -3700,9 +3700,6 @@ - - - diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index 3973bb11d..3ce09e07b 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -1997,10 +1997,7 @@ CREATE TABLE `BPMN_LANE` KEY `BPMN_LANE_I_3`(`LNS_UID`), CONSTRAINT `fk_bpmn_lane_project` FOREIGN KEY (`PRJ_UID`) - REFERENCES `BPMN_PROJECT` (`PRJ_UID`), - CONSTRAINT `fk_bpmn_lane_laneset` - FOREIGN KEY (`LNS_UID`) - REFERENCES `BPMN_LANESET` (`LNS_UID`) + REFERENCES `BPMN_PROJECT` (`PRJ_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8'; #----------------------------------------------------------------------------- #-- BPMN_PARTICIPANT diff --git a/workflow/engine/src/ProcessMaker/Project/Bpmn.php b/workflow/engine/src/ProcessMaker/Project/Bpmn.php index 86203ef40..7dbe05c37 100644 --- a/workflow/engine/src/ProcessMaker/Project/Bpmn.php +++ b/workflow/engine/src/ProcessMaker/Project/Bpmn.php @@ -62,25 +62,25 @@ class Bpmn extends Handler protected static $excludeFields = array( "activity" => array( - "PRJ_UID", "PRO_UID", "BOU_ELEMENT", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", + "PRJ_UID", "PRO_UID", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", "BOU_SIZE_IDENTICAL", "DIA_UID", "BOU_UID", "ELEMENT_UID" ), "event" => array( - "PRJ_UID", "PRO_UID", "BOU_ELEMENT", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", + "PRJ_UID", "PRO_UID", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", "BOU_SIZE_IDENTICAL", "DIA_UID", "BOU_UID", "ELEMENT_UID", "EVN_ATTACHED_TO", "EVN_CONDITION" ), - "gateway" => array("BOU_ELEMENT", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", "BOU_SIZE_IDENTICAL", "BOU_UID", + "gateway" => array("BOU_ELEMENT_TYPE", "BOU_REL_POSITION", "BOU_SIZE_IDENTICAL", "BOU_UID", "DIA_UID", "ELEMENT_UID", "PRJ_UID", "PRO_UID" ), "artifact" => array( - "PRJ_UID", "PRO_UID", "BOU_ELEMENT", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", + "PRJ_UID", "PRO_UID", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", "BOU_SIZE_IDENTICAL", "DIA_UID", "BOU_UID", "ELEMENT_UID" ), "flow" => array("PRJ_UID", "DIA_UID", "FLO_ELEMENT_DEST_PORT", "FLO_ELEMENT_ORIGIN_PORT"), "data" => array("PRJ_UID"), "participant" => array("PRJ_UID"), - "laneset" => array(), - "lane" => array() + "laneset" => array("BOU_ELEMENT_TYPE", "BOU_SIZE_IDENTICAL", "BOU_UID"), + "lane" => array("BOU_ELEMENT_TYPE", "BOU_SIZE_IDENTICAL", "BOU_UID") ); @@ -182,12 +182,12 @@ class Bpmn extends Handler foreach ($this->getParticipants() as $participant) { $this->removeParticipant($participant["PAR_UID"]); } - foreach ($this->getLanesets() as $laneset) { - $this->removeLaneset($laneset["LNS_UID"]); - } foreach ($this->getLanes() as $lane) { $this->removeLane($lane["LAN_UID"]); } + foreach ($this->getLanesets() as $laneset) { + $this->removeLaneset($laneset["LNS_UID"]); + } if ($process = $this->getProcess("object")) { $process->delete(); }