From 118d71e972510cbb7a0ed5445dbd948d81ffe701 Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Mon, 5 Jan 2015 17:43:39 -0400 Subject: [PATCH 01/24] Were added some changes in order to do refactor related to input data. --- .../calendar/basic_sequence_calendar.feature | 89 +++++----- .../calendar/main_tests_calendar.feature | 157 +++++++++--------- 2 files changed, 120 insertions(+), 126 deletions(-) diff --git a/features/backend/admin_setup/calendar/basic_sequence_calendar.feature b/features/backend/admin_setup/calendar/basic_sequence_calendar.feature index f9efe0209..5f4671381 100644 --- a/features/backend/admin_setup/calendar/basic_sequence_calendar.feature +++ b/features/backend/admin_setup/calendar/basic_sequence_calendar.feature @@ -1,32 +1,25 @@ @ProcessMakerMichelangelo @RestAPI Feature: Calendar -Requirements: - a workspace with two calendar in this workspace "Default Calendar and Test Process" + Requirements: + a workspace with one calendar in this workspace "Default Calendar" -Background: + Background: Given that I have a valid access_token -Scenario: List of calendar + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar Given I request "calendars" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 2 records + And the response has 1 records -Scenario: Get a single calendar - Given I request "calendar/14606161052f50839307899033145440" - 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 the "cal_uid" property equals "14606161052f50839307899033145440" - And the "cal_name" property equals "Test Process" - And the "cal_description" property equals "Calendar para el feature Process" - - -Scenario Outline: Create a new Calendars + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendars Given POST this data: """ { @@ -38,8 +31,8 @@ Scenario Outline: Create a new Calendars {"day": 7, "hour_start": "09:00", "hour_end": "17:00"} ], "cal_holiday": [ - {"name": "holiday1", "date_start": "2010-01-01", "date_end": "2010-01-10"}, - {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"} + {"name": "holiday1", "date_start": "2015-01-01", "date_end": "2015-01-10"}, + {"name": "holiday2", "date_start": "2015-04-01", "date_end": "2015-04-04"} ] } """ @@ -50,14 +43,15 @@ Scenario Outline: Create a new Calendars And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | - | Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | - | Create calendar 2 | 2 | Calendar 2 | Prueba de Creacion de Calendario 2 | + Examples: + | cal_uid_number | cal_name | cal_description | + | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | + | 2 | Calendar 2 | Prueba de Creacion de Calendario 2 | -Scenario Outline: Update the calendars and then check if the values had changed + # PUT /api/1.0/{workspace}/calendar + # Update a Calendar + Scenario Outline: Update the calendars and then check if the values had changed Given PUT this data: """ { @@ -74,7 +68,6 @@ Scenario Outline: Update the calendars and then check if the values had changed {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"} ] } - """ And that I want to update a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" @@ -82,14 +75,15 @@ Scenario Outline: Update the calendars and then check if the values had changed Then the response status code should be 200 And the response charset is "UTF-8" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | cal_status | - | Update calendar 1 | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | Update calendar 2 | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + Examples: + | cal_uid_number | cal_name | cal_description | cal_status | + | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | + | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Get a single calendar + # GET /api/1.0/{workspace}/calendar + # Get an specific Calendar + Scenario Outline: Get a single calendar Given that I want to get a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" Then the response status code should be 200 @@ -97,25 +91,34 @@ Scenario Outline: Get a single calendar And the content type is "application/json" And the type is "object" And the "cal_name" property equals "" - And the "cal_description" property equals "" - And the "cal_status" property equals "" + And the "cal_description" property equals "" + And the "cal_status" property equals "" - Examples: - - | cal_uid_number | cal_name | cal_description | cal_status | + Examples: + | cal_uid_number | cal_name | cal_description | cal_status | | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Delete all Calendars created previously in this script + # DELETE /api/1.0/{workspace}/calendar + # Delete an specific calendar + Scenario Outline: Delete all Calendars created previously in this script (one by one ) Given that I want to delete a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" And the content type is "application/json" Then the response status code should be 200 - - - Examples: + Examples: | cal_uid_number | | 1 | - | 2 | \ No newline at end of file + | 2 | + + + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar + Given I request "calendars" + 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 \ No newline at end of file diff --git a/features/backend/admin_setup/calendar/main_tests_calendar.feature b/features/backend/admin_setup/calendar/main_tests_calendar.feature index a52b596b4..2050e44ed 100644 --- a/features/backend/admin_setup/calendar/main_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/main_tests_calendar.feature @@ -1,31 +1,25 @@ @ProcessMakerMichelangelo @RestAPI Feature: Calendar Main Tests -Requirements: - a workspace with two calendar in this workspace "Default Calendar and Test Process" + Requirements: + a workspace with one calendar in this workspace "Default Calendar" -Background: + Background: Given that I have a valid access_token -Scenario: List of calendar + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar Given I request "calendars" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 2 records + And the response has 1 records -Scenario: Get a single calendar "Test Process" - Given I request "calendar/14606161052f50839307899033145440" - 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 the "cal_uid" property equals "14606161052f50839307899033145440" - And the "cal_name" property equals "Test Process" - And the "cal_description" property equals "Calendar para el feature Process" - -Scenario: Get a single calendar "Default Calendar" + # GET /api/1.0/{workspace}/calendar/ + # Get an specific Calendar + Scenario: Get a single calendar "Default Calendar" Given I request "calendar/00000000000000000000000000000001" Then the response status code should be 200 And the response charset is "UTF-8" @@ -36,7 +30,9 @@ Scenario: Get a single calendar "Default Calendar" And the "cal_description" property equals "Default Calendar" -Scenario Outline: Create a new Calendars + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create new Calendars (one by one) Given POST this data: """ { @@ -60,16 +56,17 @@ Scenario Outline: Create a new Calendars And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | - | Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | + Examples: + | test_description | cal_uid_number | cal_name | cal_description | + | Create calendar 1 | 1 | Calendar 1 | Prueba de Creacion de Calendario 1 | | Create calendar with short name | 2 | C | Prueba de Creacion de Calendario 2 | | Create calendar with name long | 3 | Creacion de nuevo Calendar con nombre largo para las pruebas behat | Prueba de Creacion de Calendario 3 | | Create calendar with special character | 4 | Calendar 4 !@#$%^& | Prueba de Creacion de Calendario 4 | - -Scenario Outline: Create a new Calendar with parameter cal_work_days diferent + + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendar with parameter cal_work_days diferent Given POST this data: """ { @@ -93,13 +90,14 @@ Scenario Outline: Create a new Calendar with parameter cal_work_days diferent And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | cal_uid_number | + Examples: + | cal_uid_number | | 5 | -Scenario Outline: Create a new Calendar with parameter cal_work_hour diferent + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendar with parameter cal_work_hour diferent Given POST this data: """ { @@ -123,13 +121,14 @@ Scenario Outline: Create a new Calendar with parameter cal_work_hour diferent And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | cal_uid_number | + Examples: + | cal_uid_number | | 6 | -Scenario Outline: Create a new Calendar with parameter cal_holiday diferent + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create a new Calendar with parameter cal_holiday diferent Given POST this data: """ { @@ -153,13 +152,14 @@ Scenario Outline: Create a new Calendar with parameter cal_holiday diferent And the type is "object" And store "cal_uid" in session array as variable "cal_uid_" - Examples: - - | cal_uid_number | + Examples: + | cal_uid_number | | 7 | -Scenario: Create a new Calendar with same name + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendar with same name Given POST this data: """ { @@ -181,8 +181,9 @@ Scenario: Create a new Calendar with same name And the response status message should have the following text "already exists" - -Scenario Outline: Update the calendars and then check if the values had changed + # PUT /api/1.0/{workspace}/calendar + # Update a Calendar + Scenario Outline: Update the calendars and then check if the values had changed Given PUT this data: """ { @@ -199,7 +200,6 @@ Scenario Outline: Update the calendars and then check if the values had changed {"name": "holiday2", "date_start": "2014-04-01", "date_end": "2014-04-04"} ] } - """ And that I want to update a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" @@ -207,43 +207,15 @@ Scenario Outline: Update the calendars and then check if the values had changed Then the response status code should be 200 And the response charset is "UTF-8" - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | cal_status | + Examples: + | test_description | cal_uid_number | cal_name | cal_description | cal_status | | Update calendar 1 | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | Update calendar 2 | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + | Update calendar 2 | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Update the calendars with same name - Given PUT this data: - """ - { - "cal_name": "", - "cal_description": "", - "cal_work_days": [1,2,3,4,5], - "cal_status": "", - "cal_work_hour": [ - {"day": 4, "hour_start": "02:00", "hour_end": "21:00"}, - {"day": 0, "hour_start": "09:00", "hour_end": "17:00"} - ], - "cal_holiday": [ - {"name": "Dia del trabajo", "date_start": "2014-05-01", "date_end": "2014-05-01"} - ] - } - - """ - And that I want to update a resource with the key "cal_uid" stored in session array as variable "cal_uid_" - And I request "calendar" - Then the response status code should be 400 - And the response status message should have the following text "already exists" - - Examples: - - | test_description | cal_uid_number | cal_name | cal_description | cal_status | - | Update calendar 1 | 1 | Test Process | Calendar para el feature Process | ACTIVE | - - -Scenario Outline: Get a single calendar + # GET /api/1.0/{workspace}/calendar + # Get an specific Calendar + Scenario Outline: Get a single calendar Given that I want to get a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" Then the response status code should be 200 @@ -251,25 +223,34 @@ Scenario Outline: Get a single calendar And the content type is "application/json" And the type is "object" And the "cal_name" property equals "" - And the "cal_description" property equals "" - And the "cal_status" property equals "" + And the "cal_description" property equals "" + And the "cal_status" property equals "" - Examples: - - | cal_uid_number | cal_name | cal_description | cal_status | + Examples: + | cal_uid_number | cal_name | cal_description | cal_status | | 1 | Update Calendar 1 | Update Prueba de Creacion de Calendario 1 | ACTIVE | - | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | + | 2 | Update Calendar 2 | Update Prueba de Creacion de Calendario 2 | INACTIVE | -Scenario Outline: Delete all Calendars created previously in this script + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar + Given I request "calendars" + Then the response status code should be 200 + And the response charset is "UTF-8" + And the type is "array" + And the response has 8 records + + + # DELETE /api/1.0/{workspace}/calendar + # Delete an specific calendar + Scenario Outline: Delete all Calendars created previously in this script Given that I want to delete a resource with the key "cal_uid" stored in session array as variable "cal_uid_" And I request "calendar" And the content type is "application/json" Then the response status code should be 200 - - - Examples: + Examples: | cal_uid_number | | 1 | | 2 | @@ -277,4 +258,14 @@ Scenario Outline: Delete all Calendars created previously in this script | 4 | | 5 | | 6 | - | 7 | \ No newline at end of file + | 7 | + + + # GET /api/1.0/{workspace}/calendars + # Get Calendar list + Scenario: List of calendar + Given I request "calendars" + 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 \ No newline at end of file From b91aa7a82074c82a95f3d0747500843cf1c6501d Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Tue, 6 Jan 2015 11:39:38 -0400 Subject: [PATCH 02/24] Were added some adjustments in order to make the calendar negative tests are independents. --- .../calendar/negative_tests_calendar.feature | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/features/backend/admin_setup/calendar/negative_tests_calendar.feature b/features/backend/admin_setup/calendar/negative_tests_calendar.feature index 2aa083afa..c761f9a44 100644 --- a/features/backend/admin_setup/calendar/negative_tests_calendar.feature +++ b/features/backend/admin_setup/calendar/negative_tests_calendar.feature @@ -1,12 +1,13 @@ @ProcessMakerMichelangelo @RestAPI Feature: Calendar Negative Tests - -Background: + Background: Given that I have a valid access_token -Scenario Outline: Create a new Calendars (Negative Tests) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario Outline: Create new Calendars (Without cal_name) Given POST this data: """ { @@ -27,13 +28,14 @@ Scenario Outline: Create a new Calendars (Negative Tests) Then the response status code should be And the response status message should have the following text "" - Examples: + Examples: + | cal_name | cal_description | error_code | error_message | + | | Prueba de Creacion de Calendario 1 | 400 | cal_name | - | test_description | cal_name | cal_description | error_code | error_message | - | Create whitout cal_name | | Prueba de Creacion de Calendario 1 | 400 | cal_name | - -Scenario: Create a new Calendars (Wrong cal_work_days) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendars (Wrong cal_work_days) Given POST this data: """ { @@ -55,7 +57,9 @@ Scenario: Create a new Calendars (Wrong cal_work_days) And the response status message should have the following text "cal_work_days" -Scenario: Create a new Calendars (cal_work_hour . day) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create new Calendars (cal_work_hour . day) Given POST this data: """ { @@ -77,7 +81,9 @@ Scenario: Create a new Calendars (cal_work_hour . day) And the response status message should have the following text "day" -Scenario: Create a new Calendars (without cal_work_days) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendars (Without cal_work_days) Given POST this data: """ { @@ -99,7 +105,9 @@ Scenario: Create a new Calendars (without cal_work_days) And the response status message should have the following text "cal_work_days" -Scenario: Create a new Calendars (wrong date_start ) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create a new Calendars (Wrong date_start ) Given POST this data: """ { @@ -120,8 +128,9 @@ Scenario: Create a new Calendars (wrong date_start ) Then the response status code should be 400 And the response status message should have the following text "date_start" - -Scenario: Create a new Calendars (wrong date_end) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create new Calendars (wrong date_end) Given POST this data: """ { @@ -143,7 +152,9 @@ Scenario: Create a new Calendars (wrong date_end) And the response status message should have the following text "date_end" -Scenario: Create a new Calendars (with work days less than 3) + # POST /api/1.0/{workspace}/calendar + # Create a new Calendar + Scenario: Create new Calendars (With work days less than 3) Given POST this data: """ { @@ -165,9 +176,10 @@ Scenario: Create a new Calendars (with work days less than 3) And the response status message should have the following text "least 3 Working Days" - -Scenario: Delete Calendar when it is assigned to a project "Test Process" + # DELETE /api/1.0/{workspace}/calendar + # Delete an specific calendar + Scenario: Delete a Calendar that does not exists Given that I want to delete a "Calendar" And I request "calendar/14606161052f50839307899033145440" Then the response status code should be 400 - And the response status message should have the following text "cannot be deleted" \ No newline at end of file + And the response status message should have the following text "does not exist" \ No newline at end of file From 0620f7f1e8d163cc4239094b1786416764ef31ce Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Tue, 6 Jan 2015 15:32:05 -0400 Subject: [PATCH 03/24] PMFormDesigner --- Rakefile | 3 +-- .../engine/js/cases/core/cases_Step_Pmdynaform.js | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Rakefile b/Rakefile index 40f0a5ebb..920ab3a8f 100644 --- a/Rakefile +++ b/Rakefile @@ -230,8 +230,7 @@ def buildMafe(homeDir, targetDir, mode) "#{homeDir}/build/js/designer.js" => "#{mafeDir}/designer.min.js", "#{homeDir}/build/js/mafe.js" => "#{mafeDir}/mafe.min.js", "#{homeDir}/build/css/mafe.css" => "#{mafeDir}/mafe.min.css", - "#{homeDir}/img/*.*" => "#{imgTargetDir}", - "#{homeDir}/srcForm/img/*.*" => "#{imgTargetDir}" + "#{homeDir}/img/*.*" => "#{imgTargetDir}" }) puts "\nCopying lib files into: #{jsTargetDir}".bold diff --git a/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js b/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js index 3ecda0e5e..c00f8e6aa 100644 --- a/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js +++ b/workflow/engine/js/cases/core/cases_Step_Pmdynaform.js @@ -46,21 +46,6 @@ $(window).load(function () { var form = document.getElementsByTagName("form")[0]; - var el = form.elements; - var dt = data.items[0].items; - for (var i = 0; i < dt.length; i++) { - var dr = dt[i]; - for (var j = 0; j < dr.length; j++) { - if (dr[j].name) { - for (var k = 0; k < el.length; k++) { - if (el[k].name === dr[j].name) { - el[k].name = "form[" + dr[j].name + "]"; - } - } - } - } - } - var type = document.createElement("input"); type.type = "hidden"; type.name = "TYPE"; From e4684bee7a271d199edc3554e0ae2ec3d57c2b37 Mon Sep 17 00:00:00 2001 From: norahmollo Date: Tue, 6 Jan 2015 16:57:38 -0400 Subject: [PATCH 04/24] PM-1123 Podado de features para 3.0 Marcas para Code Scan --- workflow/engine/bin/tasks/cliWorkspaces.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index cfb4ff39d..07778674a 100755 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -186,6 +186,7 @@ EOT CLI::taskArg("workspace-name", true, true); CLI::taskRun("run_database_generate_self_service_by_value"); +/*----------------------------------********---------------------------------*/ CLI::taskName("check-workspace-disabled-code"); CLI::taskDescription(<<getMessage()) . "\n"; } } - +/*----------------------------------********---------------------------------*/ function run_check_workspace_disabled_code($args, $opts) { try { @@ -630,4 +632,4 @@ function run_check_workspace_disabled_code($args, $opts) echo CLI::error($e->getMessage()) . "\n"; } } - +/*----------------------------------********---------------------------------*/ From d0a3d36dc30f4a9c288a4e8171a231a593a40b3d Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Tue, 6 Jan 2015 17:19:59 -0400 Subject: [PATCH 05/24] "Se adiciona end points. GET data with value y POST data value" --- .../src/ProcessMaker/BusinessModel/Cases.php | 126 +++++++++++++++++- .../src/ProcessMaker/Services/Api/Cases.php | 58 ++++++++ 2 files changed, 183 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index b36cc3cf9..14b9aa188 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1905,5 +1905,129 @@ class Cases throw $e; } } -} + protected static $excludeFields = array( + "dataFields" => array( + "SYS_LANG", "SYS_SKIN", "SYS_SYS", "APPLICATION", "PROCESS", + "TASK", "INDEX", "USER_LOGGED", "USR_USERNAME", "PIN"), + "dataFieldsPost" => array( + "APP_PARENT", "APP_STATUS", "PRO_UID", "APP_PROC_STATUS", "APP_PROC_CODE", + "APP_PARALLEL", "APP_INIT_USER", "APP_CUR_USER", "APP_CREATE_DATE", "APP_INIT_DATE", + "APP_FINISH_DATE", "APP_UPDATE_DATE", "APP_DATA", "APP_PIN", "APP_DESCRIPTION", + "STATUS", "TITLE", "DESCRIPTION", "CREATOR", "CREATE_DATE", "UPDATE_DATE") + ); + + public static function filterArrayKeys($data, $filter = array()) + { + $result = array(); + + foreach ($data as $key => $value) { + if (! in_array($key, $filter)) { + $result[$key] = $value; + } + } + + return $result; + } + + /** + * Get data + * + * @param string $applicationUid Unique id of Case + * + * return array Return an array with Data + */ + public function getCaseData($applicationUid) + { + try { + $aFieldsAssoc = array(); + + //Verify data + Validator::isString($applicationUid, '$app_uid'); + Validator::appUid($applicationUid, '$app_uid'); + + //Set variables + $oApp = new \Application(); + $aFields = $oApp->Load($applicationUid); + + $appData = unserialize($aFields['APP_DATA']); + + $aFields['APP_DATA'] = \G::array_merges(\G::getSystemConstants(), $appData); + $aFields = $aFields['APP_DATA']; + + $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFields"]); + + foreach($aFields as $key => $value) { + $aFieldsAssoc[] = array ('name' => $key, 'value' => $value); + } + + //Return + return $aFieldsAssoc; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get data non assoc + * + * @param string $applicationUid Unique id of Case + * + * return array Return an array with all Data + */ + public function getCaseDataNonAssoc($applicationUid) + { + try { + //Verify data + Validator::isString($applicationUid, '$app_uid'); + Validator::appUid($applicationUid, '$app_uid'); + + //Set variables + $oApp = new \Application(); + $aFields = $oApp->Load($applicationUid); + + $appData = unserialize($aFields['APP_DATA']); + + $aFields['APP_DATA'] = \G::array_merges(\G::getSystemConstants(), $appData); + $aFields = $aFields['APP_DATA']; + + $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFields"]); + + //Return + return $aFields; + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Post data + * + * @param string $applicationUid Unique id of Case + * @param array $data + * + * return array Return an array with all Data + */ + public function addCaseData($applicationUid, $data) + { + try { + Validator::isString($applicationUid, '$app_uid'); + Validator::appUid($applicationUid, '$app_uid'); + Validator::isArray($data, '$app_data'); + + $case = new \Cases(); + $aFields = $case->loadCase($applicationUid); + + $data['APP_DATA'] = array_merge($aFields['APP_DATA'], $data); + $case->updateCase($applicationUid, $data); + + $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFieldsPost"]); + $aFields = array_change_key_case($aFields, CASE_LOWER); + //Return + return $aFields; + + } catch (\Exception $e) { + throw $e; + } + } +} diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index e27f6017a..fc62b89b2 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -994,5 +994,63 @@ class Cases extends Api throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); } } + + /** + * @url GET /:app_uid/data/non-assoc + * + * @param string $app_uid {@min 32}{@max 32} + */ + public function doGetCaseDataNonAssoc($app_uid) + { + try { + $case = new \ProcessMaker\BusinessModel\Cases(); + $case->setFormatFieldNameInUppercase(false); + + $response = $case->getCaseDataNonAssoc($app_uid); + + return $response; + } catch (\Exception $e) { + throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); + } + } + + /** + * @url GET /:app_uid/data + * + * @param string $app_uid {@min 32}{@max 32} + */ + public function doGetCaseData($app_uid) + { + try { + $case = new \ProcessMaker\BusinessModel\Cases(); + $case->setFormatFieldNameInUppercase(false); + + $response = $case->getCaseData($app_uid); + + return $response; + } catch (\Exception $e) { + throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); + } + } + + /** + * @url POST /:app_uid/data + * + * @param string $app_uid {@min 32}{@max 32} + * @param array $variables {@from body} + * + */ + public function doPostCaseData($app_uid, $variables = null) + { + try { + $cases = new \ProcessMaker\BusinessModel\Cases(); + + $response = $cases->addCaseData($app_uid, $variables); + + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } } From 869896ae79e784499d6c49b15c95362dd8ebd0c3 Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Tue, 6 Jan 2015 18:02:04 -0400 Subject: [PATCH 06/24] Were added some adjustments in order to make the tests are independents. --- .../category/basic_sequence_category.feature | 80 ++++++---- .../category/main_tests_category.feature | 138 +++++++++--------- .../category/negative_tests_category.feature | 18 ++- 3 files changed, 127 insertions(+), 109 deletions(-) diff --git a/features/backend/admin_setup/category/basic_sequence_category.feature b/features/backend/admin_setup/category/basic_sequence_category.feature index 1957bbdcc..08c39793a 100644 --- a/features/backend/admin_setup/category/basic_sequence_category.feature +++ b/features/backend/admin_setup/category/basic_sequence_category.feature @@ -1,31 +1,27 @@ @ProcessMakerMichelangelo @RestAPI Feature: Process Category Requirements: - a workspace with the workspace with one process category + a workspace with the workspace with one process category -Background: + Background: Given that I have a valid access_token -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" 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 the response has 0 records -Scenario: Get a Category specific - Given I request "project/category/4177095085330818c324501061677193" - 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: Create a new Categories + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario: Create a new Category Given POST this data: """ { @@ -40,33 +36,61 @@ Scenario: Create a new Categories And store "cat_uid" in session array as variable "cat_uid" -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" 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 + And the response has 1 records -Scenario: Update the Category created in this script + # PUT /api/1.0/{workspace}/project/categories + # Update an specific Category + Scenario: Update the Category created in this script Given PUT this data: - """ + """ { "cat_name": "Name Updated" } """ - And that I want to update a resource with the key "cat_uid" stored in session array - And I request "project/category" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" + And that I want to update a resource with the key "cat_uid" stored in session array + And I request "project/category" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" -Scenario: Delete the Category created previously in this script + # GET /api/1.0/{workspace}/project/category/ + # Get an specific Category + Scenario: Get an specific Category + Given that I want to get a resource with the key "cat_uid" stored in session array + And I request "project/category" + 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" + + + # DELETE /api/1.0/{workspace}/project/category + # Delete an specific Category + Scenario: Delete the Category created previously in this script Given that I want to delete a resource with the key "cat_uid" stored in session array - And I request "project/category" - 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" \ No newline at end of file + And I request "project/category" + 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" + + + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories + Given I request "project/categories" + 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 \ No newline at end of file diff --git a/features/backend/admin_setup/category/main_tests_category.feature b/features/backend/admin_setup/category/main_tests_category.feature index 6b1c5148a..63d0e35bc 100644 --- a/features/backend/admin_setup/category/main_tests_category.feature +++ b/features/backend/admin_setup/category/main_tests_category.feature @@ -1,34 +1,27 @@ @ProcessMakerMichelangelo @RestAPI Feature: Process Category Main Test Requirements: - a workspace with the workspace with one process category + a workspace with the workspace with one process category -Background: + Background: Given that I have a valid access_token -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" 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 the response has 0 records -Scenario: Get a Category specific - Given I request "project/category/4177095085330818c324501061677193" - 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 "cat_uid" property equals "4177095085330818c324501061677193" - And the "cat_name" property equals "Category Cases Lists" - And the "cat_total_processes" property equals 6 - -Scenario Outline: Create a new Categories + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario Outline: Create new Categories Given POST this data: """ { @@ -42,18 +35,20 @@ Scenario Outline: Create a new Categories And the type is "object" And store "cat_uid" in session array as variable "cat_uid_" - Examples: - + Examples: | test_description | cat_uid_number | cat_name | - | Create new Category with character special | 1 | sample!@#$%^^& | + | Create new Category with character special | 1 | sample!@#$%^^& | | Create new Category with only character numeric | 2 | 32425325 | | Create new Category with only character special | 3 | @$@$#@% | | Create new Category with normal character | 4 | sample | | Create new Category with short name | 5 | s | | Create new Category with long name | 6 | Prueba de Creacion de nuevo categoria con nombre largo | + | Create new Category with long name | 7 | Right Category | -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" Then the response status code should be 200 And the response charset is "UTF-8" @@ -62,39 +57,43 @@ Scenario: Get list of Categories And the response has 7 records -Scenario: Create Category with same name - Given POST this data: - """ + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario: Create Category with same name twice + Given POST this data: + """ { "cat_name": "sample" } """ - And I request "project/category" - Then the response status code should be 400 - And the response status message should have the following text "exist" + And I request "project/category" + Then the response status code should be 400 + And the response status message should have the following text "exist" -Scenario Outline: Update the Category created in this script + # PUT /api/1.0/{workspace}/project/categories + # Update an specific Category + Scenario Outline: Update the Categories created in this script Given PUT this data: - """ + """ { "cat_name": "" } """ - And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" - And the content type is "application/json" - Then the response status code should be 200 - And the response charset is "UTF-8" - - - Examples: + And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" + And the content type is "application/json" + Then the response status code should be 200 + And the response charset is "UTF-8" + Examples: | test_description | cat_uid_number | cat_name | - | Update Category | 1 | UPDATE sample!@#$%^^& | + | Update Category | 1 | UPDATE sample!@#$%^^& | | Update Category | 2 | UPDATE 32425325 | -Scenario Outline: Update the Category putting the same name + # PUT /api/1.0/{workspace}/project/categories + # Update an specific Category + Scenario Outline: Update the Category putting the same name Given PUT this data: """ { @@ -104,64 +103,57 @@ Scenario Outline: Update the Category putting the same name And I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_uid_" Then the response status code should be 400 And the response status message should have the following text "exist" - - Examples: + Examples: | test_description | cat_uid_number | cat_name | - | Update Category | 5 | sample | - + | Update Category | 5 | sample | - -Scenario Outline: Get a Category specific + # GET /api/1.0/{workspace}/project/categories + # Get an specific Category + Scenario Outline: Get an specific Category Given I request "project/category/cat_uid" with the key "cat_uid" stored in session array as variable "cat_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 "cat_name" property equals "" - And the "cat_total_processes" property equals + And the "cat_total_processes" property equals "" - Examples: + Examples: | cat_uid_number | cat_name | cat_total_processes | - | 1 | UPDATE sample!@#$%^^& | 0 | + | 1 | UPDATE sample!@#$%^^& | 0 | | 2 | UPDATE 32425325 | 0 | -Scenario Outline: Delete the Category created previously in this script + # DELETE /api/1.0/{workspace}/project/category + # Delete an specific Category + Scenario Outline: Delete the Category created previously in this script Given that I want to delete a resource with the key "cat_uid" stored in session array as variable "cat_uid_" - And I request "project/category" - 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 I request "project/category" + 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: - - | cat_uid_number | - | 1 | - | 2 | - | 3 | - | 4 | - | 5 | - | 6 | + Examples: + | cat_uid_number | + | 1 | + | 2 | + | 3 | + | 4 | + | 5 | + | 6 | + | 7 | -Scenario: Get list of Categories + # GET /api/1.0/{workspace}/project/categories + # Get Category list + Scenario: Get list of Categories Given I request "project/categories" 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 Category specific - Given I request "project/category/4177095085330818c324501061677193" - 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 "cat_uid" property equals "4177095085330818c324501061677193" - And the "cat_name" property equals "Category Cases Lists" - And the "cat_total_processes" property equals 6 \ No newline at end of file + And the response has 0 records \ No newline at end of file diff --git a/features/backend/admin_setup/category/negative_tests_category.feature b/features/backend/admin_setup/category/negative_tests_category.feature index a79411105..0c9420dca 100644 --- a/features/backend/admin_setup/category/negative_tests_category.feature +++ b/features/backend/admin_setup/category/negative_tests_category.feature @@ -2,11 +2,13 @@ Feature: Process Category Negative Tests -Background: + Background: Given that I have a valid access_token -Scenario Outline: Create a new Categories (Negative Test) + # POST /api/1.0/{workspace}/project/category + # Create a new Category + Scenario Outline: Create a new Category (Negative Test) Given POST this data: """ { @@ -17,15 +19,15 @@ Scenario Outline: Create a new Categories (Negative Test) Then the response status code should be And the response status message should have the following text "" - Examples: - + Examples: | test_description | cat_name | error_code | error_message | - | without name | | 400 | cat_name | + | without name | | 400 | cat_name | - -Scenario: Delete the Category when it is assigned to a project "Category Cases Lists" + # DELETE /api/1.0/{workspace}/project/category + # Delete an specific Category + Scenario: Delete the Category when it is assigned to a project "Category Cases Lists" Given that I want to delete a "Category" And I request "project/category/4177095085330818c324501061677193" Then the response status code should be 400 - And the response status message should have the following text "cannot be deleted" \ No newline at end of file + And the response status message should have the following text "does not exist" \ No newline at end of file From 7378bc23fb44d5736be318a40dbf03af426cb8cf Mon Sep 17 00:00:00 2001 From: norahmollo Date: Wed, 7 Jan 2015 16:47:21 -0400 Subject: [PATCH 07/24] PM-1123 Marks Added for Community version Omitting gulliver options --- gulliver/bin/tasks/pakeGulliver.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gulliver/bin/tasks/pakeGulliver.php b/gulliver/bin/tasks/pakeGulliver.php index ce6721b17..4160cc929 100755 --- a/gulliver/bin/tasks/pakeGulliver.php +++ b/gulliver/bin/tasks/pakeGulliver.php @@ -69,8 +69,10 @@ pake_task('workspace-backup', 'project_exists'); pake_desc("restore a previously backed-up workspace\n args: [-o|--overwrite] "); pake_task('workspace-restore', 'project_exists'); +/*----------------------------------********---------------------------------*/ pake_desc("check standard code\n args: "); pake_task('check-standard-code', 'project_exists' ); +/*----------------------------------********---------------------------------*/ /** * Function run_version From 7e2cc9f40890be199823e4359fe3e67f04ee3e20 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Wed, 7 Jan 2015 09:17:47 -0400 Subject: [PATCH 08/24] "Se adiciona end points. GET data with value y POST data value" --- .../src/ProcessMaker/BusinessModel/Cases.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 14b9aa188..f34586f31 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1947,12 +1947,9 @@ class Cases Validator::appUid($applicationUid, '$app_uid'); //Set variables - $oApp = new \Application(); - $aFields = $oApp->Load($applicationUid); + $case = new \Cases(); + $aFields = $case->loadCase($applicationUid); - $appData = unserialize($aFields['APP_DATA']); - - $aFields['APP_DATA'] = \G::array_merges(\G::getSystemConstants(), $appData); $aFields = $aFields['APP_DATA']; $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFields"]); @@ -1983,12 +1980,9 @@ class Cases Validator::appUid($applicationUid, '$app_uid'); //Set variables - $oApp = new \Application(); - $aFields = $oApp->Load($applicationUid); + $case = new \Cases(); + $aFields = $case->loadCase($applicationUid); - $appData = unserialize($aFields['APP_DATA']); - - $aFields['APP_DATA'] = \G::array_merges(\G::getSystemConstants(), $appData); $aFields = $aFields['APP_DATA']; $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFields"]); From 42668f52aebbad78654c68d7a51f60d37820a47f Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Thu, 8 Jan 2015 11:54:19 -0400 Subject: [PATCH 09/24] "Se modifica la funcion doPutCaseVariables para el envio opcional de id del dynaform para validar datos" --- .../src/ProcessMaker/BusinessModel/Cases.php | 135 ++---------------- .../src/ProcessMaker/Services/Api/Cases.php | 63 +------- 2 files changed, 17 insertions(+), 181 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index f34586f31..6d39a5039 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1424,11 +1424,12 @@ class Cases * @access public * @param string $app_uid, Uid for case * @param array $app_data, Data for case variables + * @param string $dyn_uid, Uid for dynaform * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia */ - public function setCaseVariables($app_uid, $app_data) + public function setCaseVariables($app_uid, $app_data, $dyn_uid = null) { Validator::isString($app_uid, '$app_uid'); Validator::appUid($app_uid, '$app_uid'); @@ -1436,7 +1437,18 @@ class Cases $case = new \Cases(); $fields = $case->loadCase($app_uid); - $data['APP_DATA'] = array_merge($fields['APP_DATA'], $app_data); + $_POST['form'] = $app_data; + + if ($dyn_uid) { + $oDynaform = \DynaformPeer::retrieveByPK($dyn_uid); + + if ($oDynaform->getDynVersion() < 2) { + $oForm = new \Form ( $fields['PRO_UID'] . "/" . $dyn_uid, PATH_DYNAFORM ); + $oForm->validatePost(); + } + } + + $data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']); $case->updateCase($app_uid, $data); } @@ -1905,123 +1917,4 @@ class Cases throw $e; } } - - protected static $excludeFields = array( - "dataFields" => array( - "SYS_LANG", "SYS_SKIN", "SYS_SYS", "APPLICATION", "PROCESS", - "TASK", "INDEX", "USER_LOGGED", "USR_USERNAME", "PIN"), - "dataFieldsPost" => array( - "APP_PARENT", "APP_STATUS", "PRO_UID", "APP_PROC_STATUS", "APP_PROC_CODE", - "APP_PARALLEL", "APP_INIT_USER", "APP_CUR_USER", "APP_CREATE_DATE", "APP_INIT_DATE", - "APP_FINISH_DATE", "APP_UPDATE_DATE", "APP_DATA", "APP_PIN", "APP_DESCRIPTION", - "STATUS", "TITLE", "DESCRIPTION", "CREATOR", "CREATE_DATE", "UPDATE_DATE") - ); - - public static function filterArrayKeys($data, $filter = array()) - { - $result = array(); - - foreach ($data as $key => $value) { - if (! in_array($key, $filter)) { - $result[$key] = $value; - } - } - - return $result; - } - - /** - * Get data - * - * @param string $applicationUid Unique id of Case - * - * return array Return an array with Data - */ - public function getCaseData($applicationUid) - { - try { - $aFieldsAssoc = array(); - - //Verify data - Validator::isString($applicationUid, '$app_uid'); - Validator::appUid($applicationUid, '$app_uid'); - - //Set variables - $case = new \Cases(); - $aFields = $case->loadCase($applicationUid); - - $aFields = $aFields['APP_DATA']; - - $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFields"]); - - foreach($aFields as $key => $value) { - $aFieldsAssoc[] = array ('name' => $key, 'value' => $value); - } - - //Return - return $aFieldsAssoc; - } catch (\Exception $e) { - throw $e; - } - } - - /** - * Get data non assoc - * - * @param string $applicationUid Unique id of Case - * - * return array Return an array with all Data - */ - public function getCaseDataNonAssoc($applicationUid) - { - try { - //Verify data - Validator::isString($applicationUid, '$app_uid'); - Validator::appUid($applicationUid, '$app_uid'); - - //Set variables - $case = new \Cases(); - $aFields = $case->loadCase($applicationUid); - - $aFields = $aFields['APP_DATA']; - - $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFields"]); - - //Return - return $aFields; - } catch (\Exception $e) { - throw $e; - } - } - - /** - * Post data - * - * @param string $applicationUid Unique id of Case - * @param array $data - * - * return array Return an array with all Data - */ - public function addCaseData($applicationUid, $data) - { - try { - Validator::isString($applicationUid, '$app_uid'); - Validator::appUid($applicationUid, '$app_uid'); - Validator::isArray($data, '$app_data'); - - $case = new \Cases(); - $aFields = $case->loadCase($applicationUid); - - $data['APP_DATA'] = array_merge($aFields['APP_DATA'], $data); - $case->updateCase($applicationUid, $data); - - $aFields = self::filterArrayKeys($aFields, self::$excludeFields["dataFieldsPost"]); - $aFields = array_change_key_case($aFields, CASE_LOWER); - //Return - return $aFields; - - } catch (\Exception $e) { - throw $e; - } - } } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index fc62b89b2..3cc9ba728 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -838,17 +838,18 @@ class Cases extends Api * * @param string $app_uid {@min 1}{@max 32} * @param array $request_data + * @param string $dyn_uid {@from path} * * @author Brayan Pereyra (Cochalo) * @copyright Colosa - Bolivia * * @url PUT /:app_uid/variable */ - public function doPutCaseVariables($app_uid, $request_data) + public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '') { try { $cases = new \ProcessMaker\BusinessModel\Cases(); - $cases->setCaseVariables($app_uid, $request_data); + $cases->setCaseVariables($app_uid, $request_data, $dyn_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } @@ -994,63 +995,5 @@ class Cases extends Api throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); } } - - /** - * @url GET /:app_uid/data/non-assoc - * - * @param string $app_uid {@min 32}{@max 32} - */ - public function doGetCaseDataNonAssoc($app_uid) - { - try { - $case = new \ProcessMaker\BusinessModel\Cases(); - $case->setFormatFieldNameInUppercase(false); - - $response = $case->getCaseDataNonAssoc($app_uid); - - return $response; - } catch (\Exception $e) { - throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); - } - } - - /** - * @url GET /:app_uid/data - * - * @param string $app_uid {@min 32}{@max 32} - */ - public function doGetCaseData($app_uid) - { - try { - $case = new \ProcessMaker\BusinessModel\Cases(); - $case->setFormatFieldNameInUppercase(false); - - $response = $case->getCaseData($app_uid); - - return $response; - } catch (\Exception $e) { - throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); - } - } - - /** - * @url POST /:app_uid/data - * - * @param string $app_uid {@min 32}{@max 32} - * @param array $variables {@from body} - * - */ - public function doPostCaseData($app_uid, $variables = null) - { - try { - $cases = new \ProcessMaker\BusinessModel\Cases(); - - $response = $cases->addCaseData($app_uid, $variables); - - return $response; - } catch (\Exception $e) { - throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); - } - } } From 6bad7433086be0c88f079617a2c7b7d1acd5b49c Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 9 Jan 2015 12:05:10 -0400 Subject: [PATCH 10/24] PM-1156 "Change text: Table Name (Auto Prefix "PMT")-report table" SOLVED --- workflow/engine/templates/pmTables/editReport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index 44b1f225f..fc88597d1 100755 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -967,7 +967,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { items.push({ id: 'REP_TAB_NAME', - fieldLabel: _("ID_TABLE_NAME") + ' ('+_("ID_AUTO_PREFIX") + ' "PMT")', + fieldLabel: _("ID_TABLE_NAME") + ' ('+_("ID_AUTO_PREFIX") + ' "PMT_")', xtype:'textfield', emptyText: _("ID_SET_A_TABLE_NAME"), width: 250, From e5a2bd3dd0d72816883baed38fdeeec03379c2b5 Mon Sep 17 00:00:00 2001 From: jennylee Date: Fri, 9 Jan 2015 12:26:26 -0400 Subject: [PATCH 11/24] PM-1175 Event Message no funciona. Se comenta el boton de la funcionalidad Event Message. --- workflow/engine/templates/designer/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 1bb60caac..c245247f9 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -132,10 +132,10 @@ -
  • +
  • From 000a010ae86ec058e019b476cdc27b20360c680a Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Thu, 8 Jan 2015 15:46:13 -0400 Subject: [PATCH 12/24] PM-1165 "Se modifica funcion doPutCaseVariables para el envio opcional de id del dynaform para validar datos. Se agrega funcion doPutExecuteTriggers, para ejecucion de triggers" --- .../src/ProcessMaker/BusinessModel/Cases.php | 34 ++++++++++++++++++- .../src/ProcessMaker/Services/Api/Cases.php | 20 +++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 6d39a5039..8c113377e 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1439,7 +1439,7 @@ class Cases $fields = $case->loadCase($app_uid); $_POST['form'] = $app_data; - if ($dyn_uid) { + if (!is_null($dyn_uid)) { $oDynaform = \DynaformPeer::retrieveByPK($dyn_uid); if ($oDynaform->getDynVersion() < 2) { @@ -1917,4 +1917,36 @@ class Cases throw $e; } } + + /** + * Put execute triggers + * + * @access public + * @param string $app_uid , Uid for case + * + * @copyright Colosa - Bolivia + */ + public function putExecuteTriggers($app_uid, $del_index = false) + { + Validator::isString($app_uid, '$app_uid'); + Validator::appUid($app_uid, '$app_uid'); + + if ($del_index === false) { + $del_index = \AppDelegation::getCurrentIndex($app_uid); + } + Validator::isInteger($del_index, '$del_index'); + + $oCase = new \Cases(); + $aField = $oCase->loadCase($app_uid, $del_index); + $tas_uid = $aField["TAS_UID"]; + + $task = new \Tasks(); + $arrayStep = $task->getStepsOfTask($tas_uid); + + foreach ($arrayStep as $step) { + $arrayField = $oCase->loadCase($app_uid); + $arrayField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $step["STEP_TYPE_OBJ"], $step["STEP_UID_OBJ"], "AFTER", $arrayField["APP_DATA"]); + $arrayField = $oCase->updateCase($app_uid, $arrayField); + } + } } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index 3cc9ba728..c9fa3d993 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -995,5 +995,25 @@ class Cases extends Api throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); } } + + /** + * Execute triggers + * + * @param string $app_uid {@min 1}{@max 32} + * @param string $del_index {@from body} + * + * @copyright Colosa - Bolivia + * + * @url PUT /:app_uid/execute-triggers + */ + public function doPutExecuteTriggers($app_uid, $del_index = false) + { + try { + $cases = new \ProcessMaker\BusinessModel\Cases(); + $cases->putExecuteTriggers($app_uid, $del_index); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } } From 6217efe4c020a3328ff4cb8a7f1302ca52642f8c Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 9 Jan 2015 17:07:49 -0400 Subject: [PATCH 13/24] Fix Notice: Undefined variable: sqlConditionLike.En Process variables --- workflow/engine/src/ProcessMaker/BusinessModel/Variable.php | 1 + 1 file changed, 1 insertion(+) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php b/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php index d253dd5ef..f73506687 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Variable.php @@ -610,6 +610,7 @@ class Variable $variableSql = ""; $sqlLimit = ""; $variableSqlLimit = ""; + $sqlConditionLike = ""; $criteria = new \Criteria("workflow"); From e9d274b7d7209974d8ce4bbc91a0122955ae179b Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 9 Jan 2015 11:48:36 -0400 Subject: [PATCH 14/24] PM-1165 "Se modifica funcion doPutCaseVariables, se envia dynaform id. Se agrega funcion doPutExecuteTriggers, para ejecucion de triggers" --- .../src/ProcessMaker/BusinessModel/Cases.php | 14 +++++++------- .../engine/src/ProcessMaker/Services/Api/Cases.php | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 8c113377e..30f3250e4 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1923,10 +1923,13 @@ class Cases * * @access public * @param string $app_uid , Uid for case + * @param bool|string $del_index , Index for case + * @param string $obj_type , Index for case + * @param string $obj_uid , Index for case * * @copyright Colosa - Bolivia */ - public function putExecuteTriggers($app_uid, $del_index = false) + public function putExecuteTriggers($app_uid, $del_index = false, $obj_type, $obj_uid) { Validator::isString($app_uid, '$app_uid'); Validator::appUid($app_uid, '$app_uid'); @@ -1942,11 +1945,8 @@ class Cases $task = new \Tasks(); $arrayStep = $task->getStepsOfTask($tas_uid); - - foreach ($arrayStep as $step) { - $arrayField = $oCase->loadCase($app_uid); - $arrayField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $step["STEP_TYPE_OBJ"], $step["STEP_UID_OBJ"], "AFTER", $arrayField["APP_DATA"]); - $arrayField = $oCase->updateCase($app_uid, $arrayField); - } + $arrayField = $oCase->loadCase($app_uid); + $aField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $obj_type, $obj_uid, "AFTER", $aField["APP_DATA"]); + $aField = $oCase->updateCase($app_uid, $aField); } } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index c9fa3d993..5e1f44720 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -1001,16 +1001,18 @@ class Cases extends Api * * @param string $app_uid {@min 1}{@max 32} * @param string $del_index {@from body} + * @param string $obj_type {@from body} + * @param string $obj_uid {@from body} * * @copyright Colosa - Bolivia * * @url PUT /:app_uid/execute-triggers */ - public function doPutExecuteTriggers($app_uid, $del_index = false) + public function doPutExecuteTriggers($app_uid, $del_index = false, $obj_type, $obj_uid) { try { $cases = new \ProcessMaker\BusinessModel\Cases(); - $cases->putExecuteTriggers($app_uid, $del_index); + $cases->putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid); } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } From bf99195495cb5dcdd8d4cbdc0a97c1a3e6f27a46 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 9 Jan 2015 15:28:20 -0400 Subject: [PATCH 15/24] PM-1165 "Se modifica funcion doPutCaseVariables, se envia dynaform id. Se agrega funcion doPutExecuteTriggers, para ejecucion de triggers" --- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 30f3250e4..701c4a397 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1929,14 +1929,10 @@ class Cases * * @copyright Colosa - Bolivia */ - public function putExecuteTriggers($app_uid, $del_index = false, $obj_type, $obj_uid) + public function putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid) { Validator::isString($app_uid, '$app_uid'); Validator::appUid($app_uid, '$app_uid'); - - if ($del_index === false) { - $del_index = \AppDelegation::getCurrentIndex($app_uid); - } Validator::isInteger($del_index, '$del_index'); $oCase = new \Cases(); @@ -1945,7 +1941,6 @@ class Cases $task = new \Tasks(); $arrayStep = $task->getStepsOfTask($tas_uid); - $arrayField = $oCase->loadCase($app_uid); $aField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $obj_type, $obj_uid, "AFTER", $aField["APP_DATA"]); $aField = $oCase->updateCase($app_uid, $aField); } From 0735d3ef339167f20bcffe2319401341e029575b Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 9 Jan 2015 15:33:23 -0400 Subject: [PATCH 16/24] PM-1165 "Se modifica funcion doPutCaseVariables, se envia dynaform id. Se agrega funcion doPutExecuteTriggers, para ejecucion de triggers" --- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 1 - 1 file changed, 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 701c4a397..67cdf1455 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1940,7 +1940,6 @@ class Cases $tas_uid = $aField["TAS_UID"]; $task = new \Tasks(); - $arrayStep = $task->getStepsOfTask($tas_uid); $aField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $obj_type, $obj_uid, "AFTER", $aField["APP_DATA"]); $aField = $oCase->updateCase($app_uid, $aField); } From 7807f3da17690d8dfb3c11296fc4118b8cd5cf4c Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 9 Jan 2015 16:31:28 -0400 Subject: [PATCH 17/24] PM-1165 "Se modifica funcion doPutCaseVariables, se envia dynaform id. Se agrega funcion doPutExecuteTriggers, para ejecucion de triggers" --- workflow/engine/src/ProcessMaker/Services/Api/Cases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index 5e1f44720..04f06b767 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -1008,7 +1008,7 @@ class Cases extends Api * * @url PUT /:app_uid/execute-triggers */ - public function doPutExecuteTriggers($app_uid, $del_index = false, $obj_type, $obj_uid) + public function doPutExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid) { try { $cases = new \ProcessMaker\BusinessModel\Cases(); From 730ca62524d0a8674b5776b5cf1f0e2ccd8f693b Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Fri, 9 Jan 2015 09:58:52 -0400 Subject: [PATCH 18/24] The oauth2 tests troubles were solved putting the right token generated and put the correct input data. --- ... => main_tests_authorization_code.feature} | 88 ++++++++++--------- .../main_tests_client_credentials.feature | 65 +++++++------- ....bak => main_tests_implicit_grant.feature} | 62 ++++++------- ...sources_owner_password_credentials.feature | 62 ++++++------- 4 files changed, 139 insertions(+), 138 deletions(-) rename features/backend/oauth/authorization_code/{main_tests_authorization_code.feature.bak => main_tests_authorization_code.feature} (75%) rename features/backend/oauth/authorization_code/{main_tests_implicit_grant.feature.bak => main_tests_implicit_grant.feature} (86%) diff --git a/features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak b/features/backend/oauth/authorization_code/main_tests_authorization_code.feature similarity index 75% rename from features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak rename to features/backend/oauth/authorization_code/main_tests_authorization_code.feature index 71a8b4e51..759367631 100644 --- a/features/backend/oauth/authorization_code/main_tests_authorization_code.feature.bak +++ b/features/backend/oauth/authorization_code/main_tests_authorization_code.feature @@ -1,10 +1,12 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Authorization Code -Requirements: - a workspace with open session and installed application + Requirements: + a workspace with open session and installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + # OAUTH /en/neoclassic/oauth2 + # In order to generate a new token create a new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET in order to generate a new token Given OAUTH register an application """ { @@ -15,15 +17,16 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET "applicationNumber":"" } """ - Examples: + 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 | - + | Create token normal | 1 | Behat1 | Behat1 desc | http://www.processmaker.com | http://michelangelo-be.colosa.net/sysmichelangelo/en/neoclassic/oauth2/grant | + | Create token normal | 2 | Behat2 | Behat2 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 + + # GET /api/1.0/{workspace}/project//output-documents + # 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 @@ -32,27 +35,28 @@ Scenario Outline: Get the Output Documents List both process And the type is "array" And the response has records And the "out_doc_title" property in row 0 equals "" - - Examples: + 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) + # GET /api/1.0/{workspace}/project//output-documents + # Endpoint para verificar el correcto funcionamiento del token generado en este script + 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 | + 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 + # POST /en/neoclassic/oauth2/access_token/expire + # Endpoint para hacer que expire los token creados en este script + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -60,30 +64,30 @@ Scenario Outline: Expire token created in this script """ 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: + 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 + + # GET /api/1.0/{workspace}/project//output-documents + # 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: + 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 + # POST /en/neoclassic/oauth2/refresh_token_ + # Grant type Refresh Token + Scenario Outline: Refresh token Given POST this data: """ { @@ -99,16 +103,16 @@ Scenario Outline: Refresh 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: + 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 + + # GET /api/1.0/{workspace}/project//output-documents + # 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 @@ -117,17 +121,16 @@ Scenario Outline: Get the Output Documents List both process And the type is "array" And the response has records And the "out_doc_title" property in row 0 equals "" - - Examples: + 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 + # DELETE /en/neoclassic/oauth2 + # 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" @@ -135,24 +138,23 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: - + 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 + + # GET /api/1.0/{workspace}/project//output-documents + # 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: + 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 | diff --git a/features/backend/oauth/authorization_code/main_tests_client_credentials.feature b/features/backend/oauth/authorization_code/main_tests_client_credentials.feature index 6456645d0..46964af1d 100644 --- a/features/backend/oauth/authorization_code/main_tests_client_credentials.feature +++ b/features/backend/oauth/authorization_code/main_tests_client_credentials.feature @@ -1,10 +1,10 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Client Credentials Grant -Requirements: - a workspace with installed application + Requirements: + a workspace with installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Given POST this data: """ { @@ -19,28 +19,27 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET 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: + + 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) + 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: + 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 + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -48,13 +47,13 @@ Scenario Outline: Expire token created in this script """ 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: + + Examples: | Description | application_number | | Expire token 1 | 1 | - -Scenario Outline: Expire token created in this script + + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -62,38 +61,38 @@ Scenario Outline: Expire token created in this script """ 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: + + 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 + 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: + + 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 + + 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: + + 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 + 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" @@ -101,31 +100,31 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: + Examples: | application_number | | 1 | | 2 | #Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + 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: + + 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 + + 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: + + 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/authorization_code/main_tests_implicit_grant.feature.bak b/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature similarity index 86% rename from features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak rename to features/backend/oauth/authorization_code/main_tests_implicit_grant.feature index bee8d9386..bbfe5cf94 100644 --- a/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature.bak +++ b/features/backend/oauth/authorization_code/main_tests_implicit_grant.feature @@ -1,10 +1,10 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Implicit Grant -Requirements: - a workspace with installed application + Requirements: + a workspace with installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create a new implicit token through CLIENT_ID and CLIENT_SECRET Given OAUTH request implicit grant """ { @@ -14,14 +14,14 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET "implicit_grant_number":"" } """ - Examples: + 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) + 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 @@ -29,13 +29,13 @@ Scenario Outline: Returns a list of the cases for the logged in user (Inbox) And the type is "array" And the response has 14 records - Examples: + 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 + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -43,13 +43,13 @@ Scenario Outline: Expire token created in this script """ 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: + + Examples: | Description | application_number | | Expire token 1 | 1 | - -Scenario Outline: Expire token created in this script + + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -57,38 +57,38 @@ Scenario Outline: Expire token created in this script """ 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: + + 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 + 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: + + 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 + + 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: + + 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 + 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" @@ -96,31 +96,31 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: + Examples: | application_number | | 1 | | 2 | #Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + 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: + + 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 + + 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: + + 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/authorization_code/main_tests_resources_owner_password_credentials.feature b/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature index e928cc608..e795d5da0 100644 --- a/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature +++ b/features/backend/oauth/authorization_code/main_tests_resources_owner_password_credentials.feature @@ -1,10 +1,10 @@ @ProcessMakerMichelangelo @RestAPI Feature: Generate token Grant type - Resources Owner Password Credential Grant -Requirements: - a workspace with installed application + Requirements: + a workspace with installed application -Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET + Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET Given POST this data: """ { @@ -26,14 +26,14 @@ Scenario Outline: Create new CLIENT_ID and CLIENT_SECRET And store "refresh_token" in session array as variable "refresh_token_" - Examples: + 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) + 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 @@ -41,14 +41,14 @@ Scenario Outline: Returns a list of the cases for the logged in user (Inbox) And the type is "array" And the response has records - Examples: + 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 + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -56,13 +56,13 @@ Scenario Outline: Expire token created in this script """ 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: + + Examples: | Description | application_number | | Expire token 1 | 1 | - -Scenario Outline: Expire token created in this script + + Scenario Outline: Expire token created in this script Given POST this data: """ { @@ -70,38 +70,38 @@ Scenario Outline: Expire token created in this script """ 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: + + 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 + 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: + + 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 + + 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: + + 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 + 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" @@ -109,31 +109,31 @@ Scenario Outline: Delete all tokens created previously in this script And the response charset is "UTF-8" And the type is "object" - Examples: + Examples: | application_number | | 1 | | 2 | #Endpoint para verificar que el token ya no existe -Scenario Outline: Get the Output Documents List both process + 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: + + 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 + + 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: + + 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 | From 260114178853e595f08c38764da547661cf523f2 Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Fri, 9 Jan 2015 10:20:42 -0400 Subject: [PATCH 19/24] Were removed the unnecessary comments --- .../main_tests_database_connections_mysql.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature b/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature index 0ff969058..43f926f73 100644 --- a/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature +++ b/features/backend/projects/database_connections/main_tests_database_connections_mysql.feature @@ -11,7 +11,7 @@ Feature: DataBase Connections Main Tests Mysql # GET /api/1.0/{workspace}/project//database-connections - # Get list DataBase| dbs_type | dbs_server | dbs_database_name | dbs_username | dbs_password | dbs_port | dbs_encode | dbs_description | Connections + # Get list DataBase Scenario Outline: Get the DataBase Connections List when there are exactly zero DataBase Connections Given I request "project//database-connections" Then the response status code should be 200 From 0f67aae686a0301d1e9983890ad75020054652cb Mon Sep 17 00:00:00 2001 From: m3ik0 Date: Fri, 9 Jan 2015 10:29:52 -0400 Subject: [PATCH 20/24] In order to fix the token generation were re ordered some fragments of code. --- features/bootstrap/RestContext.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/features/bootstrap/RestContext.php b/features/bootstrap/RestContext.php index 87c1d4f43..a6c597572 100644 --- a/features/bootstrap/RestContext.php +++ b/features/bootstrap/RestContext.php @@ -2162,13 +2162,11 @@ class RestContext extends BehatContext throw new Exception('Bad credentials'); } - //print ""; if (curl_error($ch)) { throw new Exception(curl_error($ch)); } - // Read the session saved in the cookie file if(!file_exists($cookie_file)){ @@ -2202,20 +2200,21 @@ class RestContext extends BehatContext } $parts = parse_url($newurl); - parse_str($parts['fragment'], $fragment); - //print_r($fragment); - // json_decode(json) - $response=json_decode($answer); - if (file_exists("session.data")) { $sessionData = json_decode(file_get_contents("session.data")); } else { $sessionData = new StdClass(); } + + //print_r($fragment); + // json_decode(json) + //$response=json_decode($answer); + parse_str($parts['fragment'], $fragment); foreach($fragment as $key => $varValue){ $sessionVarName=$key."_".$implicit_grant_number; $sessionData->$sessionVarName = $varValue; } + //print_r($sessionData); file_put_contents("session.data", json_encode($sessionData)); //print_r("\nRegister application:\n".$answer."\n$oauth_authorization_url?response_type=$response_type&client_id=$client_id&scope=$scope\n"); From 282303d8aca4783aec9c105b76c58a336540579f Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Sat, 10 Jan 2015 10:12:08 -0400 Subject: [PATCH 21/24] PM-1165 "Se agrega funcion doGetSteps, para obtener los pasos evaluados" --- .../src/ProcessMaker/BusinessModel/Cases.php | 29 ++++++++++++++++++- .../src/ProcessMaker/Services/Api/Cases.php | 23 ++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 67cdf1455..c53298cfc 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1923,7 +1923,7 @@ class Cases * * @access public * @param string $app_uid , Uid for case - * @param bool|string $del_index , Index for case + * @param string $del_index , Index for case * @param string $obj_type , Index for case * @param string $obj_uid , Index for case * @@ -1943,4 +1943,31 @@ class Cases $aField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $obj_type, $obj_uid, "AFTER", $aField["APP_DATA"]); $aField = $oCase->updateCase($app_uid, $aField); } + + /** + * Get Steps evaluate + * + * @access public + * @param string $app_uid, Uid for case + * @param int $del_index , Index for case + * @return array + * + * @copyright Colosa - Bolivia + */ + public function getSteps($app_uid, $del_index) + { + Validator::isString($app_uid, '$app_uid'); + Validator::appUid($app_uid, '$app_uid'); + Validator::isInteger($del_index, '$del_index'); + + $oCase = new \Cases(); + $aCaseField = $oCase->loadCase($app_uid, $del_index); + $tas_uid = $aCaseField["TAS_UID"]; + $pro_uid = $aCaseField["PRO_UID"]; + + $oApplication = new \Applications(); + $aField = $oApplication->getSteps($app_uid, $del_index, $tas_uid, $pro_uid); + + return $aField; + } } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index 04f06b767..2d16625b9 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -1000,7 +1000,7 @@ class Cases extends Api * Execute triggers * * @param string $app_uid {@min 1}{@max 32} - * @param string $del_index {@from body} + * @param int $del_index {@from body} * @param string $obj_type {@from body} * @param string $obj_uid {@from body} * @@ -1017,5 +1017,26 @@ class Cases extends Api throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } } + + /** + * @url GET /:app_uid/:del_index/steps + * + * @param string $app_uid {@min 32}{@max 32} + * @param int $del_index + * + */ + public function doGetSteps($app_uid, $del_index) + { + try { + $case = new \ProcessMaker\BusinessModel\Cases(); + $case->setFormatFieldNameInUppercase(false); + + $response = $case->getSteps($app_uid, $del_index); + + return $response; + } catch (\Exception $e) { + throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); + } + } } From 0bf53febece8d5ce63cdcce50786086038e1167d Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Sat, 10 Jan 2015 11:17:20 -0400 Subject: [PATCH 22/24] PM-1165 "Se agrega funcion doGetSteps, para obtener los pasos evaluados" --- .../engine/src/ProcessMaker/BusinessModel/Cases.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index c53298cfc..b00742145 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1968,6 +1968,15 @@ class Cases $oApplication = new \Applications(); $aField = $oApplication->getSteps($app_uid, $del_index, $tas_uid, $pro_uid); - return $aField; + foreach ($aField as $fields) { + if ($fields['type'] == 'DYNAFORM') { + $oDynaform = \DynaformPeer::retrieveByPK($fields['id']); + $dynaform_version = $oDynaform->getDynVersion(); + $aFieldConsolidate[] = array_merge($fields, array("version" => $dynaform_version)); + } else { + $aFieldConsolidate[] = $fields; + } + } + return $aFieldConsolidate; } } From 3d4c29e5105223ed821c85324a824c221df356a8 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Sat, 10 Jan 2015 11:20:08 -0400 Subject: [PATCH 23/24] PM-1165 "Fix value type for del_index" --- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index b00742145..7479acb11 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1923,7 +1923,7 @@ class Cases * * @access public * @param string $app_uid , Uid for case - * @param string $del_index , Index for case + * @param int $del_index , Index for case * @param string $obj_type , Index for case * @param string $obj_uid , Index for case * From 4ca3d127e46046b72d0d4f01a7c357f868636114 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Sat, 10 Jan 2015 12:05:27 -0400 Subject: [PATCH 24/24] PM-1165 "Se agrega funcion doGetSteps, para obtener los pasos evaluados" --- workflow/engine/classes/class.applications.php | 1 + .../engine/src/ProcessMaker/BusinessModel/Cases.php | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/workflow/engine/classes/class.applications.php b/workflow/engine/classes/class.applications.php index 446112987..4473db067 100755 --- a/workflow/engine/classes/class.applications.php +++ b/workflow/engine/classes/class.applications.php @@ -923,6 +923,7 @@ class Applications $stepItem['title'] = $oDocument->getDynTitle(); $stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=EDIT"; + $stepItem['version'] = $oDocument->getDynVersion(); break; case 'OUTPUT_DOCUMENT': $oDocument = OutputDocumentPeer::retrieveByPK( $caseStep->getStepUidObj() ); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 7479acb11..a042bc107 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -1968,15 +1968,6 @@ class Cases $oApplication = new \Applications(); $aField = $oApplication->getSteps($app_uid, $del_index, $tas_uid, $pro_uid); - foreach ($aField as $fields) { - if ($fields['type'] == 'DYNAFORM') { - $oDynaform = \DynaformPeer::retrieveByPK($fields['id']); - $dynaform_version = $oDynaform->getDynVersion(); - $aFieldConsolidate[] = array_merge($fields, array("version" => $dynaform_version)); - } else { - $aFieldConsolidate[] = $fields; - } - } - return $aFieldConsolidate; + return $aField; } }