Merge branch 'master' of bitbucket.org:colosa/processmaker into master-core

This commit is contained in:
Freddy Daniel Rojas Valda
2014-12-09 16:19:00 -04:00
16 changed files with 338 additions and 243 deletions

View File

@@ -8,9 +8,9 @@ default:
client_secret: 179ad45c6ce2cb97cf1029e212046e81
#uploadFilesFolder: /opt/uploadfiles
#cd5cff9b2e3ebabf49e276e47e977fab5988c00e
login_url: http://processmaker-ip-or-domaint/sys[workspace]/en/neoclassic/login/login
login_url: http://processmaker-ip-or-domain/sys[workspace]/en/neoclassic/login/login
authentication_url: http://processmaker-ip-or-domain/sys[workspace]/en/neoclassic/login/authentication.php
oauth_app_url: http://processmaker-ip-or-domaint/sys[workspace]/en/neoclassic/oauth2/clientSetupAjax
oauth_app_url: http://processmaker-ip-or-domain/sys[workspace]/en/neoclassic/oauth2/clientSetupAjax
oauth_authorization_url: http://processmaker-ip-or-domain/[workspace]/oauth2/authorize
user_name: <your-admin-username>
user_password: <your-admin-password>

View File

@@ -17,9 +17,9 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET
"""
Examples:
| Description | application_number | application_name | application_description | application_website | application_redirectUri |
| Create token normal | 1 | Demo3 | Demo3 desc | http://www.demowendy3.com | www.demowendy3.com/auth |
| Create token normal | 2 | Demo4 | Demo4 desc | http://www.demowendy4.com | http://www.processmaker.com |
| 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

View File

@@ -20,7 +20,7 @@ Scenario Outline: Get the case schedulers list when there are exactly case sched
| test_description | project | record |
| Get case scheduler of process Test Michelangelo | 1265557095225ff5c688f46031700471 | 0 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 1 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 2 |
Scenario Outline: Create any case scheduler for a project
@@ -110,7 +110,7 @@ Scenario: Create a new case scheduler with same name
And the response status message should have the following text "Duplicate"
Scenario Outline: Get the case schedulers list when there are exactly 16 case schedulers in each process
Scenario Outline: Get the case schedulers list when there are exactly 16 after 18 case schedulers in each process
Given I request "project/<project>/case-schedulers"
Then the response status code should be 200
And the response charset is "UTF-8"
@@ -122,7 +122,7 @@ Scenario Outline: Get the case schedulers list when there are exactly 16 case sc
| test_description | project | record |
| Get case scheduler of process Test Michelangelo | 1265557095225ff5c688f46031700471 | 16 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 17 |
| Get case scheduler of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 18 |
Scenario Outline: Update the case schedulers for a project and then check if the values had changed

View File

@@ -5,11 +5,12 @@ Feature: DataBase Connections Main Tests Mysql
and workspace with the project 87648819953a85c0abc01d3080475981 ("testExecutionOfDerivationScreen") already loaded
there are zero Database Connections in the processes.
# MySQL is tagged like 1
Background:
Given that I have a valid access_token
# GET /api/1.0/{workspace}/project/<project-id>/database-connections
# GET /api/1.0/{workspace}/project/<project-id>/database-connections
# Get list DataBase| dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description | Connections
Scenario Outline: Get the DataBase Connections List when there are exactly zero DataBase Connections
Given I request "project/<project>/database-connections"
@@ -19,8 +20,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | record |
| 106912358530c9b14ac15d3001790900 | 0 |
| 1265557095225ff5c688f46031700471 | 0 |
| 74737540052e1641ab88249082085472 | 0 |
| 87648819953a85c0abc01d3080475981 | 0 |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection/test
@@ -48,8 +49,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -79,8 +80,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -94,8 +95,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 | 1 |
| 1265557095225ff5c688f46031700471 | 1 | 2 |
| 74737540052e1641ab88249082085472 | 1 | 1 |
| 87648819953a85c0abc01d3080475981 | 1 | 2 |
# PUT /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -124,8 +125,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -149,8 +150,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
# DELETE /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -165,8 +166,8 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 |
| 1265557095225ff5c688f46031700471 | 2 |
| 74737540052e1641ab88249082085472 | 1 |
| 87648819953a85c0abc01d3080475981 | 2 |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -180,5 +181,5 @@ Feature: DataBase Connections Main Tests Mysql
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 0 | 1 |
| 1265557095225ff5c688f46031700471 | 0 | 2 |
| 74737540052e1641ab88249082085472 | 0 | 1 |
| 87648819953a85c0abc01d3080475981 | 0 | 2 |

View File

@@ -5,6 +5,7 @@ Feature: DataBase Connections Main Tests SQL Server
and workspace with the project 87648819953a85c0abc01d3080475981 ("testExecutionOfDerivationScreen") already loaded
there are zero Database Connections in the processes.
# Microsoft SQL Server is tagged like 2
Background:
Given that I have a valid access_token
@@ -19,8 +20,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | record |
| 106912358530c9b14ac15d3001790900 | 0 |
| 1265557095225ff5c688f46031700471 | 0 |
| 74737540052e1641ab88249082085472 | 0 |
| 87648819953a85c0abc01d3080475981 | 0 |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection/test
@@ -48,8 +49,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# POST /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -79,8 +80,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -94,8 +95,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 | 1 |
| 1265557095225ff5c688f46031700471 | 1 | 2 |
| 74737540052e1641ab88249082085472 | 1 | 1 |
| 87648819953a85c0abc01d3080475981 | 1 | 2 |
# PUT /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -124,8 +125,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -149,8 +150,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| dbs_uid_number | project | dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| 1 | 106912358530c9b14ac15d3001790900 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 1265557095225ff5c688f46031700471 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 1 | 74737540052e1641ab88249082085472 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
| 2 | 87648819953a85c0abc01d3080475981 | <sqlsrv_db_type> | <sqlsrv_db_server> | <sqlsrv_db_name> | <sqlsrv_db_username> | <sqlsrv_db_password> | <sqlsrv_db_port> | <sqlsrv_db_encode> | <sqlsrv_db_description> |
# DELETE /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -165,8 +166,8 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 1 |
| 1265557095225ff5c688f46031700471 | 2 |
| 74737540052e1641ab88249082085472 | 1 |
| 87648819953a85c0abc01d3080475981 | 2 |
# GET /api/1.0/{workspace}/project/<project-id>/database-connection
@@ -180,5 +181,5 @@ Feature: DataBase Connections Main Tests SQL Server
Examples:
| project | record | dbs_uid_number |
| 106912358530c9b14ac15d3001790900 | 0 | 1 |
| 1265557095225ff5c688f46031700471 | 0 | 2 |
| 74737540052e1641ab88249082085472 | 0 | 1 |
| 87648819953a85c0abc01d3080475981 | 0 | 2 |

View File

@@ -47,9 +47,9 @@ Feature: DataBase Connections Negative Tests
"""
And I request "project/74737540052e1641ab88249082085472/database-connection"
Then the response status code should be 400
And the response status message should have the following text "port"
And the response status message should have the following text "Error"
Examples:
| dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | <mys_db_port> | <mys_db_encode> | <mys_db_description> |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | 33O6 | <mys_db_encode> | <mys_db_description> |
| <mys_db_type> | <mys_db_server> | <mys_db_name> | <mys_db_username> | <mys_db_password> | 33o6 | <mys_db_encode> | <mys_db_description> |

View File

@@ -152,7 +152,7 @@ Scenario: Delete a Project created previously in this script
Scenario Outline: Import a process
Given POST upload a project file "<project_file>" to "project/import?option=<import_option>&option_group=merge"
Then the response status code should be 201
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"
@@ -426,7 +426,7 @@ Scenario: Get a list of projects
Scenario Outline: Import a process
Given POST upload a project file "<project_file>" to "project/import?option=<import_option>"
Then the response status code should be 201
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"
@@ -455,7 +455,7 @@ Scenario: Delete a Project created previously in this script "Export process emp
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
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"

View File

@@ -1725,7 +1725,7 @@ class RestContext extends BehatContext
/**
* @Given /^that "([^"]*)" property in object "([^"]*)" equals "([^"]*)"$/
*/
public function thatPropertyInObjectEquals($propertyName, $propertyParent, $value)
public function thatPropertyInObjectEquals($propertyName, $propertyParent, $propertyValue)
{
$data = $this->_data;
if (empty($data)) {
@@ -1893,13 +1893,12 @@ class RestContext extends BehatContext
*/
public function databaseConnectionWithIdIsActive($dbConnectionId)
{
if (file_exists("session.data")) {
if (file_exists("session.data")) {
$sessionData = json_decode(file_get_contents("session.data"));
} else {
$sessionData = new StdClass();
}
$sessionData = new StdClass();
if(!$sessionData->dbconnectionStatus->$dbConnectionId){
throw new PendingException("Skip inactive dbconnection: $dbConnectionId");
}

View File

@@ -50,75 +50,73 @@ class Derivation
var $case;
/**
* prepareInformationTaskDerivation
* prepareInformationTask
*
* @param array $arrayDerivation Derivation
* @param array $arrayTaskData Task data (derivation)
*
* return array Return array
*/
public function prepareInformationTaskDerivation(array $arrayDerivation)
public function prepareInformationTask(array $arrayTaskData)
{
try {
$task = new Task();
$taskFields = $task->load($arrayDerivation["TAS_UID"]);
$arrayTaskData = G::array_merges($arrayTaskData, $task->load($arrayTaskData["TAS_UID"]));
$arrayDerivation = G::array_merges($arrayDerivation, $taskFields);
//2. If next case is an special case
if ((int)($arrayTaskData["ROU_NEXT_TASK"]) < 0) {
$arrayTaskData["NEXT_TASK"]["TAS_UID"] = (int)($arrayTaskData["ROU_NEXT_TASK"]);
$arrayTaskData["NEXT_TASK"]["TAS_ASSIGN_TYPE"] = "nobody";
$arrayTaskData["NEXT_TASK"]["TAS_PRIORITY_VARIABLE"] = "";
$arrayTaskData["NEXT_TASK"]["TAS_DEF_PROC_CODE"] = "";
$arrayTaskData["NEXT_TASK"]["TAS_PARENT"] = "";
$arrayTaskData["NEXT_TASK"]["TAS_TRANSFER_FLY"] = "";
//2. if next case is an special case
if ((int)($arrayDerivation["ROU_NEXT_TASK"]) < 0) {
$arrayDerivation["NEXT_TASK"]["TAS_UID"] = (int)($arrayDerivation["ROU_NEXT_TASK"]);
$arrayDerivation["NEXT_TASK"]["TAS_ASSIGN_TYPE"] = "nobody";
$arrayDerivation["NEXT_TASK"]["TAS_PRIORITY_VARIABLE"] = "";
$arrayDerivation["NEXT_TASK"]["TAS_DEF_PROC_CODE"] = "";
$arrayDerivation["NEXT_TASK"]["TAS_PARENT"] = "";
$arrayDerivation["NEXT_TASK"]["TAS_TRANSFER_FLY"] = "";
switch ($arrayDerivation["ROU_NEXT_TASK"]) {
switch ($arrayTaskData["ROU_NEXT_TASK"]) {
case -1:
$arrayDerivation["NEXT_TASK"]["TAS_TITLE"] = G::LoadTranslation("ID_END_OF_PROCESS");
$arrayTaskData["NEXT_TASK"]["TAS_TITLE"] = G::LoadTranslation("ID_END_OF_PROCESS");
break;
case -2:
$arrayDerivation["NEXT_TASK"]["TAS_TITLE"] = G::LoadTranslation("ID_TAREA_COLGANTE");
$arrayTaskData["NEXT_TASK"]["TAS_TITLE"] = G::LoadTranslation("ID_TAREA_COLGANTE");
break;
}
$arrayDerivation["NEXT_TASK"]["USR_UID"] = "";
$arrayDerivation["NEXT_TASK"]["USER_ASSIGNED"] = array("USR_UID" => "");
$arrayTaskData["NEXT_TASK"]["USR_UID"] = "";
$arrayTaskData["NEXT_TASK"]["USER_ASSIGNED"] = array("USR_UID" => "");
} else {
//3. load the task information of normal NEXT_TASK
$arrayDerivation["NEXT_TASK"] = $task->load($arrayDerivation["ROU_NEXT_TASK"]); //print $arrayDerivation["ROU_NEXT_TASK"]." **** ".$arrayDerivation["NEXT_TASK"]["TAS_TYPE"]."<hr>";
//3. Load the task information of normal NEXT_TASK
$arrayTaskData["NEXT_TASK"] = $task->load($arrayTaskData["ROU_NEXT_TASK"]); //print $arrayTaskData["ROU_NEXT_TASK"]." **** ".$arrayTaskData["NEXT_TASK"]["TAS_TYPE"]."<hr>";
if ($arrayDerivation["NEXT_TASK"]["TAS_TYPE"] == "SUBPROCESS") {
$sTaskParent = $arrayDerivation["NEXT_TASK"]["TAS_UID"];
if ($arrayTaskData["NEXT_TASK"]["TAS_TYPE"] == "SUBPROCESS") {
$taskParent = $arrayTaskData["NEXT_TASK"]["TAS_UID"];
$criteria = new Criteria("workflow");
$criteria->add(SubProcessPeer::PRO_PARENT, $arrayDerivation["PRO_UID"]);
$criteria->add(SubProcessPeer::TAS_PARENT, $arrayDerivation["NEXT_TASK"]["TAS_UID"]);
$criteria->add(SubProcessPeer::PRO_PARENT, $arrayTaskData["PRO_UID"]);
$criteria->add(SubProcessPeer::TAS_PARENT, $arrayTaskData["NEXT_TASK"]["TAS_UID"]);
$rsCriteria = SubProcessPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
$arrayDerivation["ROU_NEXT_TASK"] = $row["TAS_UID"]; //print "<hr>Life is just a lonely highway";
$arrayDerivation["NEXT_TASK"] = $task->load($arrayDerivation["ROU_NEXT_TASK"]); //print "<hr>Life is just a lonely highway";print"<hr>";
$arrayTaskData["ROU_NEXT_TASK"] = $row["TAS_UID"]; //print "<hr>Life is just a lonely highway";
$arrayTaskData["NEXT_TASK"] = $task->load($arrayTaskData["ROU_NEXT_TASK"]); //print "<hr>Life is just a lonely highway";print"<hr>";
$process = new Process();
$row = $process->load($row["PRO_UID"]);
$arrayDerivation["NEXT_TASK"]["TAS_TITLE"] .= " (" . $row["PRO_TITLE"] . ")";
$arrayDerivation["NEXT_TASK"]["TAS_PARENT"] = $sTaskParent;
$arrayTaskData["NEXT_TASK"]["TAS_TITLE"] .= " (" . $row["PRO_TITLE"] . ")";
$arrayTaskData["NEXT_TASK"]["TAS_PARENT"] = $taskParent;
//unset($task, $process, $row, $sTaskParent);
//unset($task, $process, $row, $taskParent);
} else {
$arrayDerivation["NEXT_TASK"]["TAS_PARENT"] = "";
$arrayTaskData["NEXT_TASK"]["TAS_PARENT"] = "";
}
$arrayDerivation["NEXT_TASK"]["USER_ASSIGNED"] = $this->getNextAssignedUser($arrayDerivation);
$arrayTaskData["NEXT_TASK"]["USER_ASSIGNED"] = ($arrayTaskData["NEXT_TASK"]["TAS_TYPE"] != "GATEWAYTOGATEWAY")? $this->getNextAssignedUser($arrayTaskData) : array("USR_UID" => "");
}
//Return
return $arrayDerivation;
return $arrayTaskData;
} catch (Exception $e) {
throw $e;
}
@@ -127,92 +125,129 @@ class Derivation
/**
* prepareInformation
*
* @param array $aData
* @return $taskInfo
* @param array $arrayData Data
* @param string $taskUid Unique id of Task
*
* return array Return array
*/
function prepareInformation ($aData)
public function prepareInformation(array $arrayData, $taskUid = "")
{
$oTask = new Task();
//SELECT *
//FROM APP_DELEGATION AS A
//LEFT JOIN TASK AS T ON(T.TAS_UID = A.TAS_UID)
//LEFT JOIN ROUTE AS R ON(R.TAS_UID = A.TAS_UID)
//WHERE
//APP_UID = '$aData['APP_UID']'
//AND DEL_INDEX = '$aData['DEL_INDEX']'
$c = new Criteria( 'workflow' );
$c->clearSelectColumns();
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
$c->addSelectColumn(RoutePeer::ROU_NEXT_TASK);
$c->addSelectColumn(RoutePeer::ROU_TYPE);
$c->addSelectColumn(RoutePeer::ROU_DEFAULT);
$c->addSelectColumn(RoutePeer::ROU_CONDITION);
$c->addJoin( AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN );
$c->addJoin( AppDelegationPeer::TAS_UID, RoutePeer::TAS_UID, Criteria::LEFT_JOIN );
$c->add( AppDelegationPeer::APP_UID, $aData['APP_UID'] );
$c->add( AppDelegationPeer::DEL_INDEX, $aData['DEL_INDEX'] );
$c->addAscendingOrderByColumn( RoutePeer::ROU_CASE );
$rs = AppDelegationPeer::doSelectRs( $c );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$aDerivation = $rs->getRow();
$i = 0;
$taskInfo = array();
$arrayDerivationDefault = array();
$oUser = new Users();
if (!class_exists('Cases')) {
G::LoadClass('case');
}
$this->case = new Cases();
// 1. there is no rule
if (is_null( $aDerivation['ROU_NEXT_TASK'] )) {
throw (new Exception( G::LoadTranslation( 'ID_NO_DERIVATION_RULE' ) ));
}
while (is_array( $aDerivation )) {
$aDerivation = G::array_merges($aDerivation, $aData);
if ((int)($aDerivation["ROU_DEFAULT"]) == 1) {
$arrayDerivationDefault = $aDerivation;
try {
if (!class_exists("Cases")) {
G::LoadClass("case");
}
$bContinue = true;
$this->case = new Cases();
$task = new Task();
//evaluate the condition if there are conditions defined.
if (isset( $aDerivation['ROU_CONDITION'] ) && trim( $aDerivation['ROU_CONDITION'] ) != '' && ($aDerivation['ROU_TYPE'] != 'SELECT' || $aDerivation['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION')) {
$AppFields = $this->case->loadCase( $aData['APP_UID'] );
G::LoadClass( 'pmScript' );
$oPMScript = new PMScript();
$oPMScript->setFields( $AppFields['APP_DATA'] );
$oPMScript->setScript( $aDerivation['ROU_CONDITION'] );
$bContinue = $oPMScript->evaluate();
$arrayNextTask = array();
$arrayNextTaskDefault = array();
$i = 0;
//SELECT *
//FROM APP_DELEGATION AS A
//LEFT JOIN TASK AS T ON(T.TAS_UID = A.TAS_UID)
//LEFT JOIN ROUTE AS R ON(R.TAS_UID = A.TAS_UID)
//WHERE
//APP_UID = '$arrayData["APP_UID"]'
//AND DEL_INDEX = '$arrayData["DEL_INDEX"]'
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(RoutePeer::TAS_UID);
$criteria->addSelectColumn(RoutePeer::ROU_NEXT_TASK);
$criteria->addSelectColumn(RoutePeer::ROU_TYPE);
$criteria->addSelectColumn(RoutePeer::ROU_DEFAULT);
$criteria->addSelectColumn(RoutePeer::ROU_CONDITION);
if ($taskUid != "") {
$criteria->add(RoutePeer::TAS_UID, $taskUid, Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rsCriteria = RoutePeer::doSelectRS($criteria);
} else {
$criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->addJoin(AppDelegationPeer::TAS_UID, RoutePeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(AppDelegationPeer::APP_UID, $arrayData["APP_UID"], Criteria::EQUAL);
$criteria->add(AppDelegationPeer::DEL_INDEX, $arrayData["DEL_INDEX"], Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rsCriteria = AppDelegationPeer::doSelectRS($criteria);
}
if ($aDerivation['ROU_TYPE'] == 'EVALUATE') {
if (count( $taskInfo ) >= 1) {
$bContinue = false;
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$arrayRouteData = G::array_merges($rsCriteria->getRow(), $arrayData);
if ((int)($arrayRouteData["ROU_DEFAULT"]) == 1) {
$arrayNextTaskDefault = $arrayRouteData;
}
$flagContinue = true;
//Evaluate the condition if there are conditions defined
if (isset($arrayRouteData["ROU_CONDITION"]) && trim($arrayRouteData["ROU_CONDITION"]) != "" && ($arrayRouteData["ROU_TYPE"] != "SELECT" || $arrayRouteData["ROU_TYPE"] == "PARALLEL-BY-EVALUATION")) {
G::LoadClass("pmScript");
$arrayApplicationData = $this->case->loadCase($arrayData["APP_UID"]);
$pmScript = new PMScript();
$pmScript->setFields($arrayApplicationData["APP_DATA"]);
$pmScript->setScript($arrayRouteData["ROU_CONDITION"]);
$flagContinue = $pmScript->evaluate();
}
if (isset($arrayRouteData["ROU_CONDITION"]) && trim($arrayRouteData["ROU_CONDITION"]) == "" && $arrayRouteData["ROU_NEXT_TASK"] != "-1") {
$arrayTaskData = $task->load($arrayRouteData["ROU_NEXT_TASK"]);
if ($arrayTaskData["TAS_TYPE"] == "GATEWAYTOGATEWAY") {
$flagContinue = false;
}
}
if ($arrayRouteData["ROU_TYPE"] == "EVALUATE" && count($arrayNextTask) > 0) {
$flagContinue = false;
}
if ($flagContinue) {
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayRouteData);
}
}
if ($bContinue) {
$i++;
$taskInfo[$i] = $this->prepareInformationTaskDerivation($aDerivation);
if (count($arrayNextTask) == 0 && count($arrayNextTaskDefault) > 0) {
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayNextTaskDefault);
}
$rs->next();
$aDerivation = $rs->getRow();
//Check Task GATEWAYTOGATEWAY
$arrayNextTaskBk = $arrayNextTask;
$arrayNextTask = array();
$i = 0;
foreach ($arrayNextTaskBk as $value) {
$arrayNextTaskData = $value;
if ($arrayNextTaskData["NEXT_TASK"]["TAS_UID"] != "-1" && $arrayNextTaskData["NEXT_TASK"]["TAS_TYPE"] == "GATEWAYTOGATEWAY") {
$arrayAux = $this->prepareInformation($arrayData, $arrayNextTaskData["NEXT_TASK"]["TAS_UID"]);
foreach ($arrayAux as $value2) {
$arrayNextTask[++$i] = $value2;
}
} else {
$arrayNextTask[++$i] = $arrayNextTaskData;
}
}
//1. There is no rule
if (count($arrayNextTask) == 0) {
throw new Exception(G::LoadTranslation("ID_NO_DERIVATION_RULE"));
}
//Return
return $arrayNextTask;
} catch (Exception $e) {
throw $e;
}
if (count($taskInfo) == 0 && count($arrayDerivationDefault) > 0) {
$i++;
$taskInfo[$i] = $this->prepareInformationTaskDerivation($arrayDerivationDefault);
}
//Return
return $taskInfo;
}
/**

View File

@@ -68,7 +68,8 @@ class PMLicensedFeatures
if (!class_exists("pmLicenseManager")) {
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
}
$licenseManager = pmLicenseManager::getSingleton();
$licenseManager = pmLicenseManager::getSingleton(false);
$_SESSION['__sw__'] = true;
$padl = new padl();

View File

@@ -10,7 +10,7 @@ class pmLicenseManager
private static $instance = null;
public function __construct()
public function __construct($flagActivatePlugins = true)
{
G::LoadClass('serverConfiguration');
$oServerConf = &serverConf::getSingleton();
@@ -109,13 +109,15 @@ class pmLicenseManager
$oServerConf->setProperty ( 'LICENSE_INFO', $licInfoA );
}
$this->activateFeatures ();
if ($flagActivatePlugins) {
$this->activateFeatures();
}
}
public static function getSingleton()
public static function getSingleton($flagActivatePlugins = true)
{
if (self::$instance == null) {
self::$instance = new pmLicenseManager();
self::$instance = new pmLicenseManager($flagActivatePlugins);
}
return self::$instance;
}

View File

@@ -159,7 +159,7 @@ class TaskMapBuilder
$tMap->addColumn('TAS_SELFSERVICE_EXECUTION', 'TasSelfserviceExecution', 'string', CreoleTypes::VARCHAR, false, 15);
$tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN', 'Please select a valid value for TAS_TYPE.');
$tMap->addValidator('TAS_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'NORMAL|ADHOC|SUBPROCESS|HIDDEN|GATEWAYTOGATEWAY', 'Please enter a valid value for TAS_TYPE');
$tMap->addValidator('TAS_TIMEUNIT', 'validValues', 'propel.validator.ValidValuesValidator', 'MINUTES|HOURS|DAYS|WEEKS|MONTHS', 'Please select a valid value for TAS_TIMEUNIT.');

View File

@@ -1248,7 +1248,7 @@
<column name="TAS_SELFSERVICE_EXECUTION" type="VARCHAR" size="15" default="EVERY_TIME"/>
<validator column="TAS_TYPE">
<rule name="validValues" value="NORMAL|ADHOC|SUBPROCESS|HIDDEN" message="Please select a valid value for TAS_TYPE."/>
<rule name="validValues" value="NORMAL|ADHOC|SUBPROCESS|HIDDEN|GATEWAYTOGATEWAY" message="Please enter a valid value for TAS_TYPE"/>
</validator>
<validator column="TAS_TIMEUNIT">
<rule name="validValues" value="MINUTES|HOURS|DAYS|WEEKS|MONTHS" message="Please select a valid value for TAS_TIMEUNIT."/>

View File

@@ -91,7 +91,7 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
G::SendTemporalMessage ($e->getMessage(), "warning", 'string');
}
} else {
if ($userData['USR_AUTH_TYPE'] === '') {
if ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] === 'MYSQL') {
$msg = G::LoadTranslation('ID_USER') . ' ' . htmlentities($data['USR_USERNAME'], ENT_QUOTES, 'UTF-8') . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
} else {
$msg = G::LoadTranslation('ID_USER_NOT_FUNCTIONALITY');

View File

@@ -436,104 +436,132 @@ class BpmnWorkflow extends Project\Bpmn
}
}
public function mapBpmnGatewayToWorkflowRoutes($activityUid, $gatewayUid)
{
try {
$arrayGatewayData = \BpmnGateway::findOneBy(\BpmnGatewayPeer::GAT_UID, $gatewayUid)->toArray();
switch ($arrayGatewayData["GAT_TYPE"]) {
//case "SELECTION":
case self::BPMN_GATEWAY_COMPLEX:
$routeType = "SELECT";
break;
//case "EVALUATION":
case self::BPMN_GATEWAY_EXCLUSIVE:
$routeType = "EVALUATE";
break;
//case "PARALLEL":
case self::BPMN_GATEWAY_PARALLEL:
if ($arrayGatewayData["GAT_DIRECTION"] == "DIVERGING") {
$routeType = "PARALLEL";
} else {
if ($arrayGatewayData["GAT_DIRECTION"] == "CONVERGING") {
$routeType = "SEC-JOIN";
} else {
throw new \LogicException(
"Invalid Gateway direction, accepted values: [DIVERGING|CONVERGING], given: " . $arrayGatewayData["GAT_DIRECTION"]
);
}
}
break;
//case "PARALLEL_EVALUATION":
case self::BPMN_GATEWAY_INCLUSIVE:
if ($arrayGatewayData["GAT_DIRECTION"] == "DIVERGING") {
$routeType = "PARALLEL-BY-EVALUATION";
} else {
if ($arrayGatewayData["GAT_DIRECTION"] == "CONVERGING") {
$routeType = "SEC-JOIN";
} else {
throw new \LogicException(
"Invalid Gateway direction, accepted values: [DIVERGING|CONVERGING], given: " . $arrayGatewayData["GAT_DIRECTION"]
);
}
}
break;
default:
throw new \LogicException("Unsupported Gateway type: " . $arrayGatewayData["GAT_TYPE"]);
break;
}
$arrayGatewayFlowData = \BpmnFlow::findAllBy(array(
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN => $gatewayUid,
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnGateway"
));
if ($arrayGatewayFlowData > 0) {
$this->wp->resetTaskRoutes($activityUid);
}
foreach ($arrayGatewayFlowData as $value) {
$arrayFlowData = $value->toArray();
$routeDefault = (array_key_exists("FLO_TYPE", $arrayFlowData) && $arrayFlowData["FLO_TYPE"] == "DEFAULT")? 1 : 0;
$routeCondition = (array_key_exists("FLO_CONDITION", $arrayFlowData))? $arrayFlowData["FLO_CONDITION"] : "";
switch ($arrayFlowData["FLO_ELEMENT_DEST_TYPE"]) {
case "bpmnActivity":
case "bpmnEvent":
//Gateway ----> Activity
//Gateway ----> Event
if ($arrayFlowData["FLO_ELEMENT_DEST_TYPE"] == "bpmnEvent") {
$event = \BpmnEventPeer::retrieveByPK($arrayFlowData["FLO_ELEMENT_DEST"]);
if ($event->getEvnType() == "END") {
$result = $this->wp->addRoute($activityUid, -1, $routeType, $routeCondition, $routeDefault);
}
} else {
$result = $this->wp->addRoute($activityUid, $arrayFlowData["FLO_ELEMENT_DEST"], $routeType, $routeCondition, $routeDefault);
}
break;
case "bpmnGateway":
//Gateway ----> Gateway
$taskUid = $this->wp->addTask(array(
"TAS_TYPE" => "GATEWAYTOGATEWAY",
"TAS_TITLE" => "GATEWAYTOGATEWAY",
"TAS_POSX" => (int)($arrayFlowData["FLO_X1"]),
"TAS_POSY" => (int)($arrayFlowData["FLO_Y1"])
));
$result = $this->wp->addRoute($activityUid, $taskUid, $routeType, $routeCondition, $routeDefault);
$this->mapBpmnGatewayToWorkflowRoutes($taskUid, $arrayFlowData["FLO_ELEMENT_DEST"]);
break;
default:
//For processmaker is only allowed flows between: "gateway -> activity", "gateway -> gateway"
//any another flow is considered invalid
throw new \LogicException(
"For ProcessMaker is only allowed flows between: \"gateway -> activity\", \"gateway -> gateway\" " . PHP_EOL .
"Given: bpmnGateway -> " . $arrayFlowData["FLO_ELEMENT_DEST_TYPE"]
);
}
}
} catch (\Exception $e) {
throw $e;
}
}
public function mapBpmnFlowsToWorkflowRoutes()
{
$this->wp->deleteTaskGatewayToGateway($this->wp->getUid());
$activities = $this->getActivities();
foreach ($activities as $activity) {
$flows = \BpmnFlow::findAllBy(array(
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN => $activity["ACT_UID"],
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnActivity"
));
//
foreach ($flows as $flow) {
switch ($flow->getFloElementDestType()) {
case "bpmnActivity":
// (activity -> activity)
$this->wp->addRoute($activity["ACT_UID"], $flow->getFloElementDest(), "SEQUENTIAL");
break;
case "bpmnGateway":
// (activity -> gateway)
// we must find the related flows: gateway -> <object>
$gatUid = $flow->getFloElementDest();
$gatewayFlows = \BpmnFlow::findAllBy(array(
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN => $gatUid,
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnGateway"
));
if ($gatewayFlows > 0) {
$this->wp->resetTaskRoutes($activity["ACT_UID"]);
}
foreach ($gatewayFlows as $gatewayFlow) {
$gatewayFlow = $gatewayFlow->toArray();
switch ($gatewayFlow['FLO_ELEMENT_DEST_TYPE']) {
case 'bpmnEvent':
case 'bpmnActivity':
// (gateway -> activity)
$gateway = \BpmnGateway::findOneBy(\BpmnGatewayPeer::GAT_UID, $gatUid)->toArray();
switch ($gateway["GAT_TYPE"]) {
//case 'SELECTION':
case self::BPMN_GATEWAY_COMPLEX:
$routeType = "SELECT";
break;
//case 'EVALUATION':
case self::BPMN_GATEWAY_EXCLUSIVE:
$routeType = "EVALUATE";
break;
//case 'PARALLEL':
case self::BPMN_GATEWAY_PARALLEL:
if ($gateway["GAT_DIRECTION"] == "DIVERGING") {
$routeType = "PARALLEL";
} elseif ($gateway["GAT_DIRECTION"] == "CONVERGING") {
$routeType = "SEC-JOIN";
} else {
throw new \LogicException(sprintf(
"Invalid Gateway direction, accepted values: [%s|%s], given: %s.",
"DIVERGING", "CONVERGING", $gateway["GAT_DIRECTION"]
));
}
break;
//case 'PARALLEL_EVALUATION':
case self::BPMN_GATEWAY_INCLUSIVE:
if ($gateway["GAT_DIRECTION"] == "DIVERGING") {
$routeType = "PARALLEL-BY-EVALUATION";
} elseif ($gateway["GAT_DIRECTION"] == "CONVERGING") {
$routeType = "SEC-JOIN";
} else {
throw new \LogicException(sprintf(
"Invalid Gateway direction, accepted values: [%s|%s], given: %s.",
"DIVERGING", "CONVERGING", $gateway["GAT_DIRECTION"]
));
}
break;
default:
throw new \LogicException(sprintf("Unsupported Gateway type: %s", $gateway['GAT_TYPE']));
}
$condition = array_key_exists('FLO_CONDITION', $gatewayFlow) ? $gatewayFlow["FLO_CONDITION"] : '';
if ($gatewayFlow['FLO_ELEMENT_DEST_TYPE'] == 'bpmnEvent') {
$event = \BpmnEventPeer::retrieveByPK($gatewayFlow['FLO_ELEMENT_DEST']);
if ($event->getEvnType() == "END") {
$this->wp->addRoute($activity["ACT_UID"], -1, $routeType, $condition);
}
} else {
$this->wp->addRoute($activity["ACT_UID"], $gatewayFlow["FLO_ELEMENT_DEST"], $routeType, $condition, ($gatewayFlow["FLO_TYPE"] == "DEFAULT")? 1 : 0);
}
break;
default:
// for processmaker is only allowed flows between "gateway -> activity"
// any another flow is considered invalid
throw new \LogicException(sprintf(
"For ProcessMaker is only allowed flows between \"gateway -> activity\" " . PHP_EOL .
"Given: bpmnGateway -> " . $gatewayFlow['FLO_ELEMENT_DEST_TYPE']
));
}
}
$this->mapBpmnGatewayToWorkflowRoutes($activity["ACT_UID"], $flow->getFloElementDest());
break;
}
}

View File

@@ -1161,5 +1161,33 @@ class Workflow extends Handler
throw $e;
}
}
public function deleteTaskGatewayToGateway($processUid)
{
try {
$task = new \Tasks();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\TaskPeer::TAS_UID);
$criteria->add(\TaskPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$criteria->add(\TaskPeer::TAS_TYPE, "GATEWAYTOGATEWAY", \Criteria::EQUAL);
$rsCriteria = \TaskPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$taskUid = $row["TAS_UID"];
$task->deleteTask($taskUid);
}
} catch (\Exception $e) {
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
throw $e;
}
}
}