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

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-01-09 17:21:02 -04:00
16 changed files with 1476 additions and 530 deletions

View File

@@ -1,5 +1,18 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Testing assignee
Feature: Project Properties Assignee Resources
Background:
Given that I have a valid acess_token
Scenario: Get a list of available users and groups to be assigned to an activity
Given that I have a valid access_token
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/available-assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
Scenario: List assignees of an activity
Given that I have a valid access_token
And I request "project/14414793652a5d718b65590036026581/activity/13508932952a5d718ef56f6044945775/assignee"
@@ -13,18 +26,7 @@ Feature: Testing assignee
And the "aas_username" property in row 0 equals "admin"
And the "aas_type" property in row 0 equals "user"
Scenario: Get a list of available users and groups to be assigned to an activity
Given that I have a valid access_token
And I request "project/14414793652a5d718b65590036026581/activity/13508932952a5d718ef56f6044945775/available-assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the "aas_uid" property in row 0 equals "1283376915224e7e5ccbfa0059627023"
And the "aas_name" property in row 0 equals "Juana"
And the "aas_lastname" property in row 0 equals "De Arco"
And the "aas_username" property in row 0 equals "juana"
And the "aas_type" property in row 0 equals "user"
Scenario: Get a single user or group of an activity
Given that I have a valid access_token
@@ -39,18 +41,7 @@ Feature: Testing assignee
And the "aas_username" property equals "admin"
And the "aas_type" property equals "user"
Scenario: Assign a user or group to an activity
Given that I have a valid access_token
And POST this data:
"""
{
"ass_uid": "42713393551f2a8aae1fde2096962777",
"ass_type": "group"
}
"""
And I request "project/14414793652a5d718b65590036026581/activity/13508932952a5d718ef56f6044945775/assignee"
Then the response status code should be 201
# And store "aas_uid" in session array
# Scenario: Unassign a user or group to an activity
# Given that I have a valid access_token

View File

@@ -0,0 +1,203 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Process supervisor Resources
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisors
Scenario: Get a List of process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisors"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/{pu_uid}
Scenario: Get a specific process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/70662784652cef0878516f7085532841"
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"
#GET /api/1.0/{workspace}/project/{prj_uid}/available-process-supervisors
Scenario: Get a List of available process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/available-process-supervisors"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
#GET /api/1.0/{workspace}/project/{prj_uid}/available-process-supervisors
Scenario: Get a List of available groups process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/available-process-supervisors?obj_type=group"
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"
#GET /api/1.0/{workspace}/project/{prj_uid}/available-process-supervisors
Scenario: Get a List of available users process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/available-process-supervisors?obj_type=user"
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"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaforms
Scenario: Get a List of dynaforms process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaforms"
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"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaform/{pu_uid}
Scenario: Get a specific process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform/78069721352ceef1fd61878075214306"
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"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/available-dynaforms
Scenario: Get a List of available dynaforms process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/available-dynaforms"
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"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-documents
Scenario: Get a List of input-documents process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/input-documents"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/available-input-documents
Scenario: Get a List of input-documents process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/available-input-documents"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
#GET /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-document/{pu_uid}
Scenario: Get a specific process supervisor of a project
Given that I have a valid access_token
And I request "project/85794888452ceeef3675164057928956/process-supervisor/input-document/37709187452ceef4f601dd3045365506"
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"
#POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor
Scenario: Assign a group process supervisor of a project
Given that I have a valid access_token
And POST this data:
"""
{
"pu_type": "GROUP_SUPERVISOR",
"usr_uid": "46138556052cda43a051110007756836"
}
"""
And I request "project/85794888452ceeef3675164057928956/process-supervisor"
Then the response status code should be 201
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "object"
And store "pu_uid" in session array as variable "pug_uid"
#POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor
Scenario: Assign a user process supervisor of a project
Given that I have a valid access_token
And POST this data:
"""
{
"pu_type": "SUPERVISOR",
"usr_uid": "00000000000000000000000000000001"
}
"""
And I request "project/85794888452ceeef3675164057928956/process-supervisor"
Then the response status code should be 201
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "object"
And store "pu_uid" in session array as variable "puu_uid"
#POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaform
Scenario: Assign a dynaform process supervisor of a project
Given that I have a valid access_token
And POST this data:
"""
{
"dyn_uid": "78212661352ceef2dc4e987081647602"
}
"""
And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform"
Then the response status code should be 201
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "object"
And store "pud_uid" in session array as variable "pud_uid"
#POST /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-document
Scenario: Assign a dynaform process supervisor of a project
Given that I have a valid access_token
And POST this data:
"""
{
"inp_doc_uid": "25205290452ceef570741c3067266323"
}
"""
And I request "project/85794888452ceeef3675164057928956/process-supervisor/input-document"
Then the response status code should be 201
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "object"
And store "pui_uid" in session array as variable "pui_uid"
#DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor
Scenario: Delete a user process supervisor of a project
Given that I have a valid access_token
And that I want to delete a resource with the key "pug_uid" stored in session array
And I request "project/85794888452ceeef3675164057928956/process-supervisor"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
#DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor
Scenario: Delete a user process supervisor of a project
Given that I have a valid access_token
And that I want to delete a resource with the key "puu_uid" stored in session array
And I request "project/85794888452ceeef3675164057928956/process-supervisor"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
#DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/dynaform
Scenario: Delete a dynaform process supervisor of a project
Given that I have a valid access_token
And that I want to delete a resource with the key "pud_uid" stored in session array
And I request "project/85794888452ceeef3675164057928956/process-supervisor/dynaform"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"
#DELETE /api/1.0/{workspace}/project/{prj_uid}/process-supervisor/input-document
Scenario: Delete a input-document process supervisor of a project
Given that I have a valid access_token
And that I want to delete a resource with the key "pui_uid" stored in session array
And I request "project/85794888452ceeef3675164057928956/process-supervisor/input-document"
And the content type is "application/json"
Then the response status code should be 200
And the response charset is "UTF-8"

View File

@@ -1,21 +1,122 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Project Properties - Ad hoc Assignee Resources
Feature: Project Properties - Assignee Resources
Background:
Given that I have a valid access_token
Scenario: List AdHoc assignees of an activity
Given this scenario is not implemented yet
Scenario: Get a list of available AdHoc users and groups to be assigned to an activity
Given this scenario is not implemented yet
Scenario: Get a single AdHoc user or group of an activity
Given this scenario is not implemented yet
Scenario: Assign an AdHoc user or group to an activity
Given this scenario is not implemented yet
Scenario: Remove an AdHoc assignee from an activity
Given this scenario is not implemented yet
Scenario: Get a list of available users and groups to be assigned to an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-available-assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 79 records
And the "aas_uid" property in row 0 equals "35762872152cda4323207c6035916735"
And the "aas_type" property in row 0 equals "group"
Scenario: Get a list of available users and groups to be assigned to an activity with filter
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-available-assignee?filter=departa&start=0&limit=50"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 3 records
And the "aas_uid" property in row 0 equals "90268877852b7b4b9f134b1096735994"
And the "aas_type" property in row 0 equals "group"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "84643774552cda42dabb732033709262",
"ass_type": "user"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
Then the response status code should be 201
And the type is "object"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "95888918452cda41a2b5d11013819411",
"ass_type": "user"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
Then the response status code should be 201
And the type is "object"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "16698718252cda431814024050455569",
"ass_type": "group"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
Then the response status code should be 201
And the type is "object"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "90706007452cda42ed1c326093152317",
"ass_type": "group"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/68911670852a22d93c22c06005808422/adhoc-assignee"
Then the response status code should be 201
And the type is "object"
Scenario: List assignees of an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 7 records
And the "aas_uid" property in row 0 equals "10732248352cda434c43997043577116"
And the "aas_type" property in row 0 equals "group"
Scenario: List assignees of an activity with filter
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee?filter=emi"
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 record
And the "aas_uid" property in row 0 equals "84643774552cda42dabb732033709262"
And the "aas_type" property in row 0 equals "user"
Scenario: Get a single user or group of an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee/95888918452cda41a2b5d11013819411"
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 "aas_uid" property equals "95888918452cda41a2b5d11013819411"
And the "aas_name" property equals "Mike"
And the "aas_lastname" property equals "Balisi"
And the "aas_username" property equals "mike"
And the "aas_type" property equals "user"
Scenario: Remove assignee from an activity
Given that I want to delete a resource with the key "aas_uid" stored in session array
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee/91968412052cda4097270a3085279286"
Then the response status code should be 200
Scenario: List assignees of an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/adhoc-assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 6 records
Scenario: List assignees of an activity
Given I request "project/4224292655297723eb98691001100052/activity/12345/adhoc-assignee"
Then the response status code should be 400

View File

@@ -4,18 +4,123 @@ Feature: Project Properties - Assignee Resources
Background:
Given that I have a valid access_token
Scenario: List assignees of an activity
Given this scenario is not implemented yet
Scenario: Get a list of available users and groups to be assigned to an activity
Given this scenario is not implemented yet
Scenario: Get a single user or group of an activity
Given this scenario is not implemented yet
Scenario: Assign a user or group to an activity
Given this scenario is not implemented yet
Scenario: Remove assignee from an activity
Given this scenario is not implemented yet
Scenario: Get a list of available users and groups to be assigned to an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/available-assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 79 records
And the "aas_uid" property in row 0 equals "35762872152cda4323207c6035916735"
And the "aas_type" property in row 0 equals "group"
Scenario: Get a list of available users and groups to be assigned to an activity with filter
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/available-assignee?filter=departa&start=0&limit=50"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 3 records
And the "aas_uid" property in row 0 equals "90268877852b7b4b9f134b1096735994"
And the "aas_type" property in row 0 equals "group"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "66386662252cda3f9a63226052377198",
"ass_type": "user"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
Then the response status code should be 201
And the type is "object"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "69191356252cda41acde328048794164",
"ass_type": "user"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
Then the response status code should be 201
And the type is "object"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "35762872152cda4323207c6035916735",
"ass_type": "group"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
Then the response status code should be 201
And the type is "object"
Scenario: Assign a user or group to an activity
Given POST this data:
"""
{
"ass_uid": "90706007452cda42ed1c326093152317",
"ass_type": "group"
}
"""
And I request "project/4224292655297723eb98691001100052/activity/68911670852a22d93c22c06005808422/assignee"
Then the response status code should be 201
And the type is "object"
Scenario: List assignees of an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 7 records
And the "aas_uid" property in row 0 equals "35762872152cda4323207c6035916735"
And the "aas_type" property in row 0 equals "group"
Scenario: List assignees of an activity with filter
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee?filter=oli"
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 record
And the "aas_uid" property in row 0 equals "69191356252cda41acde328048794164"
And the "aas_type" property in row 0 equals "user"
Scenario: Get a single user or group of an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee/69191356252cda41acde328048794164"
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 "aas_uid" property equals "69191356252cda41acde328048794164"
And the "aas_name" property equals "Olivia"
And the "aas_lastname" property equals "Austin"
And the "aas_username" property equals "olivia"
And the "aas_type" property equals "user"
Scenario: Remove assignee from an activity
Given that I want to delete a resource with the key "aas_uid" stored in session array
And I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee/69191356252cda41acde328048794164"
Then the response status code should be 200
Scenario: List assignees of an activity
Given I request "project/4224292655297723eb98691001100052/activity/65496814252977243d57684076211485/assignee"
Then the response status code should be 200
And the response charset is "UTF-8"
And the content type is "application/json"
And the type is "array"
And the response has 6 records
Scenario: List assignees of an activity
Given I request "project/4224292655297723eb98691001100052/activity/12345/assignee"
Then the response status code should be 400

View File

@@ -1,13 +0,0 @@
@ProcessMakerMichelangelo @RestAPI
Feature: Projects End Point.
Lists available projects/processes for an specific workspace
Scenario: Get a list of projects
Given that I have a valid access_token
And I request "projects"
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"

View File

@@ -1092,6 +1092,21 @@ class RestContext extends BehatContext
{
throw new PendingException();
}
/**
* @Then /^the response has (\d+) records$/
* @Then /^the response has (\d+) record$/
*/
public function theResponseHasRecords($quantityOfRecords)
{
$data = $this->_data;
if (!is_array($data)) {
throw new Exception("the Response data is not an array!\n\n" );
}
$currentRecordsCount=count($data);
if($currentRecordsCount!=$quantityOfRecords){
throw new Exception('Records quantity not match ' . $quantityOfRecords . ' (actual: ' . $currentRecordsCount . ")\n\n");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -465,9 +465,11 @@ class Step
public function getTriggers($stepUid)
{
try {
//Get data
$arrayTrigger = array();
$trigger = new \BusinessModel\Trigger();
$bmTrigger = new \BusinessModel\Trigger();
$bmStepTrigger = new \BusinessModel\Step\Trigger();
$arrayDataUid = $this->getDataUids($stepUid);
@@ -508,8 +510,9 @@ class Step
$stepTrigger->orderPosition($stepUid, $taskUid, $type);
//Criteria
$criteria = $trigger->getTriggerCriteria();
$criteria = $bmTrigger->getTriggerCriteria();
$criteria->addSelectColumn(\StepTriggerPeer::ST_TYPE);
$criteria->addSelectColumn(\StepTriggerPeer::ST_CONDITION);
$criteria->addSelectColumn(\StepTriggerPeer::ST_POSITION);
$criteria->addJoin(\StepTriggerPeer::TRI_UID, \TriggersPeer::TRI_UID, \Criteria::LEFT_JOIN);
@@ -524,14 +527,7 @@ class Step
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayTrigger[] = array(
"tri_uid" => $row["TRI_UID"],
"tri_title" => $row["TRI_TITLE"],
"tri_description" => $row["TRI_DESCRIPTION"],
"st_type" => $triggerType,
"st_condition" => $row["ST_CONDITION"],
"st_position" => (int)($row["ST_POSITION"])
);
$arrayTrigger[] = $bmStepTrigger->getTriggerDataFromRecord($row);
}
}

View File

@@ -206,5 +206,78 @@ class Trigger
throw $e;
}
}
/**
* Get data of a Trigger from a record
*
* @param array $record Record
*
* return array Return an array with data of a Trigger
*/
public function getTriggerDataFromRecord($record)
{
try {
return array(
"tri_uid" => $record["TRI_UID"],
"tri_title" => $record["TRI_TITLE"],
"tri_description" => $record["TRI_DESCRIPTION"],
"st_type" => $record["ST_TYPE"],
"st_condition" => $record["ST_CONDITION"],
"st_position" => (int)($record["ST_POSITION"])
);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get data of a Trigger
*
* @param string $stepUid Unique id of Step
* @param string $type Type (BEFORE, AFTER)
* @param string $triggerUid Unique id of Trigger
*
* return array Return an array with data of a Trigger
*/
public function getTrigger($stepUid, $type, $triggerUid)
{
try {
$step = new \BusinessModel\Step();
$arrayDataUid = $step->getDataUids($stepUid);
$taskUid = $arrayDataUid["TAS_UID"];
//Verify data
if (!$this->existsRecord($stepUid, $type, $triggerUid)) {
throw (new \Exception(str_replace(array("{0}", "{1}"), array($stepUid . ", " . $type . ", " . $triggerUid, "STEP_TRIGGER"), "The record \"{0}\", doesn't exist in table {1}")));
}
//Get data
$trigger = new \BusinessModel\Trigger();
$criteria = $trigger->getTriggerCriteria();
$criteria->addSelectColumn(\StepTriggerPeer::ST_TYPE);
$criteria->addSelectColumn(\StepTriggerPeer::ST_CONDITION);
$criteria->addSelectColumn(\StepTriggerPeer::ST_POSITION);
$criteria->addJoin(\StepTriggerPeer::TRI_UID, \TriggersPeer::TRI_UID, \Criteria::LEFT_JOIN);
$criteria->add(\TriggersPeer::TRI_UID, $triggerUid, \Criteria::EQUAL);
$criteria->add(\StepTriggerPeer::STEP_UID, $stepUid, \Criteria::EQUAL);
$criteria->add(\StepTriggerPeer::TAS_UID, $taskUid, \Criteria::EQUAL);
$criteria->add(\StepTriggerPeer::ST_TYPE, $type, \Criteria::EQUAL);
$rsCriteria = \StepTriggerPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
return $this->getTriggerDataFromRecord($row);
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -576,8 +576,8 @@ class Task
/**
* Return a assignee list of an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $filter
* @param int $start
* @param int $limit
@@ -680,8 +680,8 @@ class Task
/**
* Return the available users and users groups to assigned to an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $filter
* @param int $start
* @param int $limit
@@ -720,7 +720,7 @@ class Task
$groups = new \Groupwf();
$result = $groups->getAllGroup($start, $limit, $filter);
foreach ($result['rows'] as $results) {
if (in_array($results['GRP_UID'], $aUIDS1)) {
if (! in_array($results['GRP_UID'], $aUIDS1)) {
$c++;
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS MEMBERS_NUMBER');
@@ -777,9 +777,9 @@ class Task
/**
* Return a single user or group assigned to an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sAssigneeUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
*
* return array
*
@@ -877,9 +877,9 @@ class Task
/**
* Assign a user or group to an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sAssigneeUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
* @param string $assType {@choice user,group}
*
* return array
@@ -943,9 +943,9 @@ class Task
/**
* Remove a assignee of an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sAssigneeUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
*
* @access public
*/
@@ -978,8 +978,8 @@ class Task
/**
* Return a adhoc assignee list of an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
*
* return array
*
@@ -1027,14 +1027,14 @@ class Task
$oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$aUsers[] = array('aas_uid' => $results['GRP_UID'],
'aas_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] .
$aUsers[] = array('ada_uid' => $results['GRP_UID'],
'ada_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] .
' (' . $aRow2['MEMBERS_NUMBER'] . ' ' .
((int) $aRow2['MEMBERS_NUMBER'] == 1 ? \G::LoadTranslation('ID_USER') : \G::LoadTranslation('ID_USERS')).
')' . '' : $aRow['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE']),
'aas_lastname' => "",
'aas_username' => "",
'aas_type' => "group" );
'ada_lastname' => "",
'ada_username' => "",
'ada_type' => "group" );
}
}
$oCriteria = new \Criteria('workflow');
@@ -1063,11 +1063,11 @@ class Task
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aUsers[] = array('aas_uid' => $aRow['USR_UID'],
'aas_name' => $aRow['USR_FIRSTNAME'],
'aas_lastname' => $aRow['USR_LASTNAME'],
'aas_username' => $aRow['USR_USERNAME'],
'aas_type' => "user" );
$aUsers[] = array('ada_uid' => $aRow['USR_UID'],
'ada_name' => $aRow['USR_FIRSTNAME'],
'ada_lastname' => $aRow['USR_LASTNAME'],
'ada_username' => $aRow['USR_USERNAME'],
'ada_type' => "user" );
$oDataset->next();
}
return $aUsers;
@@ -1079,8 +1079,8 @@ class Task
/**
* Return the available adhoc users and users groups to assigned to an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
*
* return array
*
@@ -1116,7 +1116,7 @@ class Task
$groups = new \Groupwf();
$result = $groups->getAllGroup($start, $limit, $filter);
foreach ($result['rows'] as $results) {
if (in_array($results['GRP_UID'], $aUIDS1)) {
if (! in_array($results['GRP_UID'], $aUIDS1)) {
$c++;
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS MEMBERS_NUMBER');
@@ -1125,14 +1125,14 @@ class Task
$oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$aUsers[] = array('aas_uid' => $results['GRP_UID'],
'aas_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] .
$aUsers[] = array('ada_uid' => $results['GRP_UID'],
'ada_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] .
' (' . $aRow2['MEMBERS_NUMBER'] . ' ' .
((int) $aRow2['MEMBERS_NUMBER'] == 1 ? \G::LoadTranslation('ID_USER') : \G::LoadTranslation('ID_USERS')).
')' . '' : $aRow['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE']),
'aas_lastname' => "",
'aas_username' => "",
'aas_type' => "group" );
'ada_lastname' => "",
'ada_username' => "",
'ada_type' => "group" );
}
}
$sDelimiter = \DBAdapter::getStringDelimiter();
@@ -1157,11 +1157,11 @@ class Task
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aUsers[] = array('aas_uid' => $aRow['USR_UID'],
'aas_name' => $aRow['USR_FIRSTNAME'],
'aas_lastname' => $aRow['USR_LASTNAME'],
'aas_username' => $aRow['USR_USERNAME'],
'aas_type' => "user" );
$aUsers[] = array('ada_uid' => $aRow['USR_UID'],
'ada_name' => $aRow['USR_FIRSTNAME'],
'ada_lastname' => $aRow['USR_LASTNAME'],
'ada_username' => $aRow['USR_USERNAME'],
'ada_type' => "user" );
$oDataset->next();
}
return $aUsers;
@@ -1173,9 +1173,9 @@ class Task
/**
* Return a single Adhoc user or group assigned to an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sAssigneeUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
*
* return array
*
@@ -1225,14 +1225,14 @@ class Task
$oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$aUsers[] = array('aas_uid' => $results['GRP_UID'],
'aas_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] .
$aUsers[] = array('ada_uid' => $results['GRP_UID'],
'ada_name' => (!isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] .
' (' . $aRow2['MEMBERS_NUMBER'] . ' ' .
((int) $aRow2['MEMBERS_NUMBER'] == 1 ? \G::LoadTranslation('ID_USER') : \G::LoadTranslation('ID_USERS')).
')' . '' : $aRow['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE']),
'aas_lastname' => "",
'aas_username' => "",
'aas_type' => "group" );
'ada_lastname' => "",
'ada_username' => "",
'ada_type' => "group" );
}
}
$oCriteria = new \Criteria('workflow');
@@ -1253,11 +1253,11 @@ class Task
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aUsers = array('aas_uid' => $aRow['USR_UID'],
'aas_name' => $aRow['USR_FIRSTNAME'],
'aas_lastname' => $aRow['USR_LASTNAME'],
'aas_username' => $aRow['USR_USERNAME'],
'aas_type' => "user" );
$aUsers = array('ada_uid' => $aRow['USR_UID'],
'ada_name' => $aRow['USR_FIRSTNAME'],
'ada_lastname' => $aRow['USR_LASTNAME'],
'ada_username' => $aRow['USR_USERNAME'],
'ada_type' => "user" );
$oDataset->next();
}
if (empty($aUsers)) {
@@ -1273,10 +1273,10 @@ class Task
/**
* Assign a Adhoc user or group to an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sAssigneeUID
* @param string $assType
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
* @param string $assType {@choice user,group}
*
* return array
*
@@ -1339,9 +1339,9 @@ class Task
/**
* Remove a Adhoc assignee of an activity
*
* @param string $sProcessUID
* @param string $sTaskUID
* @param string $sAssigneeUID
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
*
* @access public
*/
@@ -1362,7 +1362,7 @@ class Task
}
$oTaskUser = \TaskUserPeer::retrieveByPK($sTaskUID, $sAssigneeUID, $iType, $iRelation);
if (! is_null( $oTaskUser )) {
OutputDocumentsTaskUserPeer::doDelete($oCriteria);
\TaskUserPeer::doDelete($oCriteria);
} else {
throw (new \Exception( 'This row does not exist!' ));
}

View File

@@ -43,43 +43,6 @@ class Trigger
}
}
/**
* Get data of a Trigger
*
* @param string $triggerUid Unique id of Trigger
*
* return array
*/
public function getTrigger($triggerUid)
{
try {
//Criteria
$criteria = $this->getTriggerCriteria();
$criteria->add(\TriggersPeer::TRI_UID, $triggerUid, \Criteria::EQUAL);
$rsCriteria = \TriggersPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
$arrayTrigger = array(
"tri_uid" => $row["TRI_UID"],
"tri_title" => $row["TRI_TITLE"],
"tri_description" => $row["TRI_DESCRIPTION"],
"tri_type" => $row["TRI_TYPE"],
"tri_webbot" => $row["TRI_WEBBOT"],
"tri_param" => $row["TRI_PARAM"]
);
return $arrayTrigger;
} catch (\Exception $e) {
throw $e;
}
}
/**
* List of Triggers in process
* @var string $sProcessUID. Uid for Process

View File

@@ -204,16 +204,16 @@ class Assignee extends Api
*
* @param string $prjUid
* @param string $actUid
* @param string $ass_uid
* @param string $ass_type {@choice user,group}
* @param string $ada_uid
* @param string $ada_type {@choice user,group}
*
* @status 201
*/
public function doPostActivityAdhocAssignee($prjUid, $actUid, $ass_uid, $ass_type)
public function doPostActivityAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type)
{
try {
$task = new \BusinessModel\Task();
$arrayData = $task->addTaskAdhocAssignee($prjUid, $actUid, $ass_uid, $ass_type);
$arrayData = $task->addTaskAdhocAssignee($prjUid, $actUid, $ada_uid, $ada_type);
} catch (\Exception $e) {
//response
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
@@ -222,18 +222,18 @@ class Assignee extends Api
}
/**
* @url DELETE /:prjUid/activity/:actUid/adhoc-assignee/:assUid
* @url DELETE /:prjUid/activity/:actUid/adhoc-assignee/:adaUid
*
* @param string $prjUid
* @param string $actUid
* @param string $assUid
* @param string $adaUid
*
*/
public function doDeleteActivityAdhocAssignee($prjUid, $actUid, $assUid)
public function doDeleteActivityAdhocAssignee($prjUid, $actUid, $adaUid)
{
try {
$task = new \BusinessModel\Task();
$arrayData = $task->removeTaskAdhocAssignee($prjUid, $actUid, $assUid);
$arrayData = $task->removeTaskAdhocAssignee($prjUid, $actUid, $adaUid);
} catch (\Exception $e) {
//response
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());

View File

@@ -12,14 +12,20 @@ use \Luracast\Restler\RestException;
class Trigger extends Api
{
/**
* @url GET /:projectUid/activity/:activityUid/step/:stepUid/trigger/:triggerUid
* @url GET /:projectUid/activity/:activityUid/step/:stepUid/trigger/:triggerUid/:type
*
* @param string $triggerUid
* @param string $stepUid
* @param string $activityUid
* @param string $projectUid
* @param string $type {@from body}{@choice before,after}
*/
public function doGetActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid)
public function doGetActivityStepTrigger($triggerUid, $stepUid, $activityUid, $projectUid, $type)
{
try {
$trigger = new \BusinessModel\Trigger();
$stepTrigger = new \BusinessModel\Step\Trigger();
$response = $trigger->getTrigger($triggerUid);
$response = $stepTrigger->getTrigger($stepUid, strtoupper($type), $triggerUid);
return $response;
} catch (\Exception $e) {

View File

@@ -15,7 +15,7 @@ class Test3 extends Api
/**
* @status 201
*/
function post()
function post2()
{
return array('success' => true);
}