Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -478,4 +478,132 @@ Scenario: Returns a list of the cases for the logged in user (Paused)
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And the response has 12 records
|
||||
And the response has 12 records
|
||||
|
||||
|
||||
#Case Tasks
|
||||
|
||||
Scenario: case tasks of case 180
|
||||
Given I request "cases/235641998533b158ec1f951078648880/tasks"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And that "tas_uid" is set to "1655978655335cc3a8bb542099129747"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Task 1"
|
||||
And that "rou_next_task" is set to "9985264545335cc3bd0ad26061293336"
|
||||
And that "rou_condition" is set to ""
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "Administrator"
|
||||
And that "usr_firstname" is set to "Administrator"
|
||||
And that "usr_lastname" is set to ""
|
||||
And that "del_init_date" is set to "2014-04-01 15:37:51"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:37:50"
|
||||
And that "del_finish_date" is set to "2014-04-01 15:37:54"
|
||||
And that "duration" is set to "0 Hours 0 Minutes 3 Seconds"
|
||||
And that "color" is set to "#006633"
|
||||
And that "tas_uid" is set to "9985264545335cc3bd0ad26061293336"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Task 2"
|
||||
And that "rou_next_task" is set to "-1"
|
||||
And that "rou_condition" is set to ""
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "Administrator"
|
||||
And that "usr_firstname" is set to "Administrator"
|
||||
And that "usr_lastname" is set to ""
|
||||
And that "del_init_date" is set to "2014-04-02 22:57:10"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:37:54"
|
||||
And that "del_finish_date" is set to "Not finished"
|
||||
And that "duration" is set to "Not finished"
|
||||
And that "color" is set to "#FF0000"
|
||||
|
||||
Scenario: case tasks of case 145, case on unassigned list
|
||||
Given I request "cases/940289753533b0d265a3885025822950/tasks"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "array"
|
||||
And that "tas_uid" is set to "30657958950ec8d5c50aef0095926988"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Cyclical"
|
||||
And that "rou_type" is set to ""
|
||||
And that "color" is set to "#939598"
|
||||
And that "tas_uid" is set to "57516479450ec8d5f696207052804906"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Manual"
|
||||
And that "rou_type" is set to ""
|
||||
And that "color" is set to "#939598"
|
||||
|
||||
And that "tas_uid" is set to "70190429650ec8d77e3e6e1056691766"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Last"
|
||||
And that "rou_type" is set to ""
|
||||
And that "color" is set to "#939598"
|
||||
|
||||
And that "tas_uid" is set to "86489868150ec8d68a1a9e7010589518"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Init"
|
||||
And that "rou_type" is set to ""
|
||||
And that "color" is set to "#939598"
|
||||
And that "tas_uid" is set to "89648437550ec8d593c2159010276089"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Reports to"
|
||||
And that "rou_type" is set to "4"
|
||||
And that "rou_next_task" is set to "94757080050ec8d6e2b93a0015133851"
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "Administrator"
|
||||
And that "usr_firstname" is set to "Administrator"
|
||||
And that "usr_lastname" is set to ""
|
||||
And that "del_init_date" is set to "2014-04-01 15:01:58"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:01:58"
|
||||
And that "del_finish_date" is set to "2014-04-01 15:02:17"
|
||||
And that "duration" is set to "0 Hours 0 Minutes 19 Seconds"
|
||||
And that "rou_next_task" is set to "30657958950ec8d5c50aef0095926988"
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "Administrator"
|
||||
And that "usr_firstname" is set to "Administrator"
|
||||
And that "usr_lastname" is set to ""
|
||||
And that "del_init_date" is set to "2014-04-01 15:01:58"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:01:58"
|
||||
And that "del_finish_date" is set to "2014-04-01 15:02:17"
|
||||
And that "duration" is set to "0 Hours 0 Minutes 19 Seconds"
|
||||
And that "rou_next_task" is set to "57516479450ec8d5f696207052804906"
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "Administrator"
|
||||
And that "usr_firstname" is set to "Administrator"
|
||||
And that "usr_lastname" is set to ""
|
||||
And that "del_init_date" is set to "2014-04-01 15:01:58"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:01:58"
|
||||
And that "del_finish_date" is set to "2014-04-01 15:02:17"
|
||||
And that "duration" is set to "0 Hours 0 Minutes 19 Seconds"
|
||||
And that "rou_next_task" is set to "86489868150ec8d68a1a9e7010589518"
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "Administrator"
|
||||
And that "usr_firstname" is set to "Administrator"
|
||||
And that "usr_lastname" is set to ""
|
||||
And that "del_init_date" is set to "2014-04-01 15:01:58"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:01:58"
|
||||
And that "del_finish_date" is set to "2014-04-01 15:02:17"
|
||||
And that "duration" is set to "0 Hours 0 Minutes 19 Seconds"
|
||||
And that "color" is set to "#006633"
|
||||
And that "tas_uid" is set to "94757080050ec8d6e2b93a0015133851"
|
||||
And that "tas_type" is set to "NORMAL"
|
||||
And that "tas_title" is set to "Self Service"
|
||||
And that "rou_type" is set to "5"
|
||||
And that "rou_next_task" is set to "70190429650ec8d77e3e6e1056691766"
|
||||
And that "rou_condition" is set to ""
|
||||
And that "rou_to_last_user" is set to "FALSE"
|
||||
And that "rou_optional" is set to "FALSE"
|
||||
And that "usr_uid" is set to "None"
|
||||
And that "usr_firstname" is set to "null"
|
||||
And that "usr_lastname" is set to "null"
|
||||
And that "del_init_date" is set to "Case not started yet"
|
||||
And that "del_task_due_date" is set to "2014-04-02 15:02:17"
|
||||
And that "del_finish_date" is set to "Not finished"
|
||||
And that "duration" is set to "Not finished"
|
||||
And that "color" is set to "#FF0000"
|
||||
@@ -6,76 +6,73 @@ Background:
|
||||
|
||||
|
||||
Scenario Outline: Create a new case (Negative Test)
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"pro_uid": "<pro_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"variables": [{"name": "admin", "amount":"1030"}]
|
||||
}
|
||||
"""
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"pro_uid": "<pro_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"variables": [{"name": "admin", "amount":"1030"}]
|
||||
}
|
||||
"""
|
||||
And I request "cases"
|
||||
Then the response status code should be <error_code>
|
||||
And the response status message should have the following text "<error_message>"
|
||||
|
||||
|
||||
|
||||
Examples:
|
||||
| Description | pro_uid | tas_uid | error_code | error_message |
|
||||
| Create new case with pro_uid wrong | 99209594750ec1111111927000421575 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
|
||||
| Create new case with tas_uid wrong | 46279907250ec73b9b25a78031279680 | 99371337811111111111116024620271 | 400 | tas_uid |
|
||||
| Create new case with tas_uid wrong | 46279907250ec73b9b25a78031279680 | 99371337811111111111116024620271 | 400 | tas_uid |
|
||||
| Create new case without pro_uid | | 52838134750ec7dd0989fc0015625952 | 400 | pro_uid |
|
||||
| Create new case without tas_uid | 34579467750ec8d55e8b115057818502 | | 400 | tas_uid |
|
||||
| Create new case without tas_uid | 34579467750ec8d55e8b115057818502 | | 400 | tas_uid |
|
||||
| Create new case whith pro_uid and tas_uid wrong | 8245849601111111181ecc7039804404 | 5690001111111118e4a9243080698854 | 400 | pro_uid |
|
||||
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Create a new case Impersonate (Negative Test)
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"pro_uid": "<pro_uid>",
|
||||
"usr_uid": "<usr_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"variables": [{"name": "pruebaQA", "amount":"10400"}]
|
||||
}
|
||||
"""
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"pro_uid": "<pro_uid>",
|
||||
"usr_uid": "<usr_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"variables": [{"name": "pruebaQA", "amount":"10400"}]
|
||||
}
|
||||
"""
|
||||
And I request "cases/impersonate"
|
||||
Then the response status code should be <error_code>
|
||||
Then the response status code should be <error_code>
|
||||
And the response status message should have the following text "<error_message>"
|
||||
|
||||
Examples:
|
||||
| Description | pro_uid | usr_uid | tas_uid | error_code | error_message |
|
||||
| Create new case with process "Derivation rules - sequential" invalid pro_uid | 99201111111111111138927000421575 | 51049032352d56710347233042615067 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
|
||||
| Create new case with process "Derivation rules - evaluation" invalid tas_uid | 99209594750ec27ea338927000421575 | 44811996752d567110634a1013636964 | 68707211111111111111111111712556 | 400 | tas_uid |
|
||||
| Create new case with process "Derivation rules - Parallel" usr_uid | 99209594750ec27ea338927000421575 | 24166331111111111111115035621101 | 68707275350ec281ada1c95068712556 | 400 | usr_uid |
|
||||
| Create new case with process "Derivation rules - without pro_uid | | 86677227852d5671f40ba25017213081 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
|
||||
| Create new case with process "Derivation rules - selection" tas_uid | 99209594750ec27ea338927000421575 | 62625000752d5672d6661e6072881167 | | 400 | tas_uid |
|
||||
| Description | pro_uid | usr_uid | tas_uid | error_code | error_message |
|
||||
| Create new case with process "Derivation rules - sequential" invalid pro_uid | 99201111111111111138927000421575 | 51049032352d56710347233042615067 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
|
||||
| Create new case with process "Derivation rules - evaluation" invalid tas_uid | 99209594750ec27ea338927000421575 | 44811996752d567110634a1013636964 | 68707211111111111111111111712556 | 400 | tas_uid |
|
||||
| Create new case with process "Derivation rules - Parallel" usr_uid | 99209594750ec27ea338927000421575 | 24166331111111111111115035621101 | 68707275350ec281ada1c95068712556 | 400 | usr_uid |
|
||||
| Create new case with process "Derivation rules - without pro_uid | | 86677227852d5671f40ba25017213081 | 68707275350ec281ada1c95068712556 | 400 | pro_uid |
|
||||
| Create new case with process "Derivation rules - selection" tas_uid | 99209594750ec27ea338927000421575 | 62625000752d5672d6661e6072881167 | | 400 | tas_uid |
|
||||
|
||||
|
||||
Scenario Outline: Create a case, derivate and cancel. then try do pause or route
|
||||
#Create case
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"pro_uid": "<pro_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"variables": [{"name": "admin", "amount":"1030"}]
|
||||
}
|
||||
"""
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"pro_uid": "<pro_uid>",
|
||||
"tas_uid": "<tas_uid>",
|
||||
"variables": [{"name": "admin", "amount":"1030"}]
|
||||
}
|
||||
"""
|
||||
And I request "cases"
|
||||
Then the response status code should be 200
|
||||
And store "app_uid" in session array as variable "app_uid_<case_number>"
|
||||
|
||||
#Send some variables
|
||||
And PUT this data:
|
||||
"""
|
||||
{
|
||||
"continue": "yes",
|
||||
"tasks": "Cyclical"
|
||||
And PUT this data:
|
||||
"""
|
||||
{
|
||||
"continue": "yes",
|
||||
"tasks": "Cyclical"
|
||||
|
||||
}
|
||||
"""
|
||||
}
|
||||
"""
|
||||
And I request "cases/app_uid/variable" with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
|
||||
Then the response status code should be 200
|
||||
And the content type is "application/json"
|
||||
@@ -83,7 +80,7 @@ Scenario Outline: Create a case, derivate and cancel. then try do pause or route
|
||||
And the type is "object"
|
||||
|
||||
#Cancel case
|
||||
And PUT this data:
|
||||
And PUT this data:
|
||||
"""
|
||||
{
|
||||
|
||||
@@ -96,36 +93,37 @@ Scenario Outline: Create a case, derivate and cancel. then try do pause or route
|
||||
And the type is "object"
|
||||
|
||||
#Route case: it should not allow
|
||||
And PUT this data:
|
||||
"""
|
||||
{
|
||||
"case_uid": "<case_number>",
|
||||
"del_index": "1"
|
||||
}
|
||||
"""
|
||||
And PUT this data:
|
||||
"""
|
||||
{
|
||||
"case_uid": "<case_number>",
|
||||
"del_index": "1"
|
||||
}
|
||||
"""
|
||||
And I request "cases/app_uid/route-case" with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "<error_message_route>"
|
||||
|
||||
#Pause case
|
||||
And PUT this data:
|
||||
And PUT this data:
|
||||
"""
|
||||
{
|
||||
"unpaused_date": "2016-12-12"
|
||||
}
|
||||
"""
|
||||
{
|
||||
"unpaused_date": "2016-12-12"
|
||||
}
|
||||
"""
|
||||
And I request "cases/app_uid/pause" with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "<error_message_pause>"
|
||||
And I request "cases/app_uid/pause" with the key "app_uid" stored in session array as variable "app_uid_<case_number>"
|
||||
Then the response status code should be 400
|
||||
And the response status message should have the following text "<error_message_pause>"
|
||||
|
||||
Examples:
|
||||
| Description | case_number | pro_uid | tas_uid | error_message_route | error_message_pause |
|
||||
| Create new case with process "Derivation rules - sequential" | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | This case delegation is already closed | This case delegation is already closed |
|
||||
Examples:
|
||||
|
||||
| Description | case_number | pro_uid | tas_uid | error_message_route | error_message_pause |
|
||||
| Create new case with process "Derivation rules - sequential" | 1 | 99209594750ec27ea338927000421575 | 68707275350ec281ada1c95068712556 | This case delegation is already closed | canceled |
|
||||
|
||||
|
||||
#Delete case
|
||||
|
||||
Scenario Outline: Delete a case created previously in this script
|
||||
Scenario Outline: Delete a case created previously in this script
|
||||
Given that I want to delete a resource with the key "app_uid" stored in session array as variable "app_uid_<app_uid_number>"
|
||||
And I request "cases"
|
||||
And the content type is "application/json"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -108,26 +108,43 @@ class ProjectUser
|
||||
throw (new \Exception( 'This id for prj_uid: '. $sProcessUID .' does not correspond to a registered process'));
|
||||
}
|
||||
$aUsers = array();
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$usersIds = array();
|
||||
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->setDistinct();
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addJoin(\TaskUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->addJoin(\TaskUserPeer::TAS_UID, \TaskPeer::TAS_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->addSelectColumn(\TaskUserPeer::USR_UID);
|
||||
$oCriteria->addJoin(\TaskPeer::TAS_UID, \TaskUserPeer::TAS_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\TaskPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, 1);
|
||||
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
|
||||
$oCriteria->addGroupByColumn(\TaskUserPeer::USR_UID);
|
||||
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
if (!in_array($aRow['USR_UID'], $usersIds)) {
|
||||
$usersIds[] = $aRow['USR_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\GroupUserPeer::USR_UID);
|
||||
$oCriteria->addJoin(\TaskPeer::TAS_UID, \TaskUserPeer::TAS_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->addJoin(\TaskUserPeer::TAS_UID, \GroupUserPeer::GRP_UID, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\TaskPeer::PRO_UID, $sProcessUID);
|
||||
$oCriteria->add(\TaskUserPeer::TU_TYPE, 1);
|
||||
$oCriteria->add(\TaskUserPeer::TU_RELATION, 2);
|
||||
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
if (!in_array($aRow['USR_UID'], $usersIds)) {
|
||||
$usersIds[] = $aRow['USR_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach($usersIds as $value) {
|
||||
\G::LoadClass( 'case' );
|
||||
$oCase = new \Cases();
|
||||
$startTasks = $oCase->getStartCases( $aRow['USR_UID'] );
|
||||
$startTasks = $oCase->getStartCases( $value );
|
||||
foreach ($startTasks as $task) {
|
||||
if ((isset( $task['pro_uid'] )) && ($task['pro_uid'] == $sProcessUID) ) {
|
||||
$taskValue = explode( '(', $task['value'] );
|
||||
|
||||
@@ -668,6 +668,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$diagram = isset($projectData["diagrams"]) && isset($projectData["diagrams"][0]) ? $projectData["diagrams"][0] : array();
|
||||
$result = array();
|
||||
|
||||
$projectData['prj_uid'] = $prjUid;
|
||||
$bwp = BpmnWorkflow::load($prjUid);
|
||||
$projectRecord = array_change_key_case($projectData, CASE_UPPER);
|
||||
$bwp->update($projectRecord);
|
||||
@@ -799,7 +800,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$bwp->removeGateway($gatewayData["GAT_UID"]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Diagram's Events Handling
|
||||
*/
|
||||
|
||||
@@ -63,6 +63,9 @@ class Project extends Api
|
||||
public function post($prj_name, $request_data)
|
||||
{
|
||||
try {
|
||||
if (!isset($request_data['prj_author'])) {
|
||||
$request_data['prj_author'] = $this->getUserId();
|
||||
}
|
||||
return Adapter\BpmnWorkflow::createFromStruct($request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user