Merge remote branch 'upstream/master'
This commit is contained in:
@@ -66,8 +66,9 @@ Scenario Outline: Create new pmtable
|
||||
|
||||
Examples:
|
||||
|
||||
| test_description | pmt_uid_number | pmt_tab_name | pmt_tab_dsc |
|
||||
| Create pmtable with fields defined | 1 | PMT_Test_QA | pmt table created with script |
|
||||
| test_description | pmt_uid_number | pmt_tab_name | pmt_tab_dsc |
|
||||
| Create pmtable with fields defined | 1 | PMT_Test_QA | pmt table created with script |
|
||||
| Create pmtable for test data | 2 | PMT_DAT_QA | pmt para realizar el testeo del borrado del data |
|
||||
|
||||
|
||||
Scenario Outline: Create a new Data of pm table.
|
||||
@@ -88,6 +89,42 @@ Scenario Outline: Create a new Data of pm table.
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
| 2 |
|
||||
|
||||
|
||||
Scenario Outline: Update a a data of pm table
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"CAMPO1" : "valor1",
|
||||
"CAMPO2" : "updatevalor2"
|
||||
}
|
||||
"""
|
||||
And that I want to update a "PM Table"
|
||||
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
|
||||
|
||||
Scenario Outline: Get data of the PMTABLE
|
||||
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
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 that "CAMPO1" is set to "valor1"
|
||||
And that "CAMPO2" is set to "updatevalor2"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
|
||||
|
||||
Scenario Outline: Update a pm table of a project
|
||||
@@ -136,49 +173,63 @@ Examples:
|
||||
| 1 |
|
||||
|
||||
|
||||
Scenario Outline: Update a a data of pm table
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"CAMPO1" : "valor1",
|
||||
"CAMPO2" : "updatevalor2"
|
||||
}
|
||||
"""
|
||||
And that I want to update a "PM Table"
|
||||
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
|
||||
|
||||
Scenario Outline: Get data of the PMTABLE
|
||||
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
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 that "CAMPO1" is set to "valor1"
|
||||
And that "CAMPO2" is set to "updatevalor2"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
|
||||
Scenario: Get the PMTABLE List when there are exactly ONE pmtables in this workspace
|
||||
Given I request "pmtable"
|
||||
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 3 records
|
||||
|
||||
|
||||
#Test delete of Data
|
||||
|
||||
Scenario Outline: Update a pm table of a project
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"rep_tab_dsc" : "descripcion de la tabla",
|
||||
"fields" : [
|
||||
{
|
||||
"fld_key" : 1,
|
||||
"fld_name" : "UPDATECAMPO",
|
||||
"fld_label" : "UPDATECAMPO",
|
||||
"fld_type" : "VARCHAR",
|
||||
"fld_size" : 200
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 2 |
|
||||
|
||||
|
||||
Scenario Outline: Get a single the PMTABLE after update
|
||||
Given that I want to get a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable"
|
||||
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 response has 0 records
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 2 |
|
||||
|
||||
|
||||
#Delete PM Tables
|
||||
|
||||
Scenario Outline: Delete a pm table of a pmtable
|
||||
Given that I want to delete a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable"
|
||||
@@ -191,20 +242,7 @@ Scenario Outline: Delete a pm table of a pmtable
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
|
||||
|
||||
Scenario Outline: Delete a data of a pmtable
|
||||
Given that I want to delete a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable/<pmt_uid>/data/CAMPO1/valor1"
|
||||
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:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
| 2 |
|
||||
|
||||
|
||||
Scenario: Get the PMTABLE List when there are exactly ONE pmtables in this workspace
|
||||
|
||||
@@ -117,9 +117,9 @@ Scenario Outline: Create a new Data of pm table.
|
||||
Given POST this data:
|
||||
"""
|
||||
{
|
||||
"UNO" : "<pmt_uid_number>",
|
||||
"CAMPO1" : "QA",
|
||||
"CAMPO2" : "<CAMPO2>"
|
||||
"UNO" : "QA11",
|
||||
"DOS" : "QA22",
|
||||
"TRES" : "QA33"
|
||||
}
|
||||
"""
|
||||
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
@@ -130,14 +130,54 @@ Scenario Outline: Create a new Data of pm table.
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number | CAMPO2 |
|
||||
| 1 | DEV1 |
|
||||
| 2 | DEV2 |
|
||||
| 3 | DEV3 |
|
||||
| 4 | DEV4 |
|
||||
| 5 | DEV5 |
|
||||
| 6 | DEV6 |
|
||||
| 7 | DEV7 |
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
| 2 |
|
||||
| 3 |
|
||||
| 4 |
|
||||
| 5 |
|
||||
| 6 |
|
||||
| 7 |
|
||||
|
||||
|
||||
Scenario Outline: Update a a data of pm table
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"UNO" : "UPDATE QA11",
|
||||
"DOS" : "UPDATE QA22",
|
||||
"TRES" : "UPDATE QA33"
|
||||
}
|
||||
"""
|
||||
And that I want to update "PM Table"
|
||||
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
| 4 |
|
||||
| 6 |
|
||||
|
||||
|
||||
Scenario Outline: Get data of the PMTABLE
|
||||
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
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 that "CAMPO1" is set to "QA"
|
||||
And that "CAMPO2" is set to "CAMPO2"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number | CAMPO2 |
|
||||
| 1 | UPDATE QA11 |
|
||||
| 4 | UPDATE QA22 |
|
||||
| 6 | UPDATE QA33 |
|
||||
|
||||
|
||||
Scenario Outline: Update a pm table of a project
|
||||
@@ -189,55 +229,80 @@ Scenario Outline: Get a single the PMTABLE after update
|
||||
| 6 | UPDATESEIS | UPDATESEIS | VARCHAR |
|
||||
|
||||
|
||||
|
||||
Scenario Outline: Update a a data of pm table
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"UNO" : "<pmt_uid_number>",
|
||||
"CAMPO1" : "QA",
|
||||
"CAMPO2" : "<CAMPO2>"
|
||||
}
|
||||
"""
|
||||
And that I want to update "PM Table"
|
||||
And I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number | CAMPO2 |
|
||||
| 1 | UPDATEQA2 |
|
||||
| 4 | UPDATEQA4 |
|
||||
| 6 | UPDATEQA6 |
|
||||
|
||||
|
||||
Scenario Outline: Get data of the PMTABLE
|
||||
Given I request "pmtable/pmt_uid/data" with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
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 that "CAMPO1" is set to "QA"
|
||||
And that "CAMPO2" is set to "CAMPO2"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number | CAMPO2 |
|
||||
| 1 | UPDATEQA2 |
|
||||
| 4 | UPDATEQA4 |
|
||||
| 6 | UPDATEQA6 |
|
||||
|
||||
|
||||
Scenario: Get the PMTABLE List when there are exactly two pmtables in this workspace
|
||||
Given I request "pmtable"
|
||||
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 8 records
|
||||
|
||||
#Test Delete of data
|
||||
|
||||
Scenario Outline: Update a pm table of a project
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"rep_tab_dsc" : "descripcion de la tabla",
|
||||
"fields" : [
|
||||
{
|
||||
"fld_key" : 1,
|
||||
"fld_name" : "<fld_name>",
|
||||
"fld_label" : "<fld_label>",
|
||||
"fld_type" : "<fld_type>",
|
||||
"fld_size" : 200
|
||||
}
|
||||
]
|
||||
}
|
||||
"""
|
||||
And that I want to update a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable"
|
||||
And the content type is "application/json"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
|
||||
Examples:
|
||||
|
||||
| Description | pmt_uid_number | fld_name | fld_label | fld_type |
|
||||
| Update a pmtable 1 | 4 | UPDATEUNO | UPDATEUNO | VARCHAR |
|
||||
| Update a pmtable 3 | 5 | UPDATETRES | UPDATETRES | VARCHAR |
|
||||
| Update a pmtable 6 | 7 | UPDATESEIS | UPDATESEIS | VARCHAR |
|
||||
|
||||
|
||||
Scenario Outline: Get a single the PMTABLE after update
|
||||
Given that I want to get a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable"
|
||||
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 that "fld_name" is set to "<fld_name>"
|
||||
And that "fld_label" is set to "<fld_label>"
|
||||
And that "fld_type" is set to "<fld_type>"
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number | fld_name | fld_label | fld_type |
|
||||
| 4 | UPDATEUNO | UPDATEUNO | VARCHAR |
|
||||
| 5 | UPDATETRES | UPDATETRES | VARCHAR |
|
||||
| 7 | UPDATESEIS | UPDATESEIS | VARCHAR |
|
||||
|
||||
|
||||
Scenario Outline: Get a single the PMTABLE after update
|
||||
Given that I want to get a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
And I request "pmtable"
|
||||
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 response has 0 records
|
||||
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 4 |
|
||||
| 5 |
|
||||
| 7 |
|
||||
|
||||
Scenario Outline: Delete a pm table of a pmtable
|
||||
Given that I want to delete a resource with the key "pmt_uid" stored in session array as variable "pmt_uid_<pmt_uid_number>"
|
||||
@@ -270,7 +335,7 @@ Scenario Outline: Delete a data of a pmtable
|
||||
Examples:
|
||||
|
||||
| pmt_uid_number |
|
||||
| 1 |
|
||||
| 2 |
|
||||
|
||||
|
||||
Scenario: Get the PMTABLE List when there are exactly ONE pmtables in this workspace
|
||||
|
||||
@@ -238,7 +238,6 @@ Scenario Outline: Route a case to the next task in the process
|
||||
Given PUT this data:
|
||||
"""
|
||||
{
|
||||
"case_uid": "<case_number>",
|
||||
"del_index": "1"
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -207,7 +207,6 @@ Scenario Outline: Create new Projects (Negative Tests)
|
||||
|
||||
| Description | prj_name | prj_description | act_name | act_type | evn_name | evn_marker | error_code | error_message |
|
||||
| Field required prj_name | | Prueba | Task # 1 | TASK | End # 1 | EMPTY | 400 | prj_name |
|
||||
| Field required prj_description | Test negative project 1 | | Task # 1 | TASK | End # 1 | EMPTY | 400 | prj_description |
|
||||
| Field required act_name | Test negative project 2 | Prueba 1 | | TASK | End # 1 | EMPTY | 400 | act_name |
|
||||
| Field required act_type | Test negative project 3 | Prueba 2 | Task # 1 | | End # 1 | EMPTY | 400 | act_type |
|
||||
| Field required evn_name | Test negative project 4 | Prueba 3 | Task # 1 | TASK | | EMPTY | 400 | evn_name |
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Export Process Main Tests
|
||||
Requirements:
|
||||
a workspace with the project 1455892245368ebeb11c1a5001393784 ("Process Complete BPMN") already loaded
|
||||
there are many activities, steps, triggers, pmtables, asignee, events, etc. in the process
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: Get for Export Project
|
||||
Given I request "project/1455892245368ebeb11c1a5001393784/export"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
@ProcessMakerMichelangelo @RestAPI
|
||||
Feature: Import Process Main Tests
|
||||
Requirements:
|
||||
a workspace without the project 1455892245368ebeb11c1a5001393784 ("Process Complete BPMN") already loaded
|
||||
there are many activities, steps, triggers, pmtables, asignee, events, etc. in the process
|
||||
|
||||
Background:
|
||||
Given that I have a valid access_token
|
||||
|
||||
|
||||
Scenario: Get for Export Project
|
||||
Given I request "project/1455892245368ebeb11c1a5001393784/export"
|
||||
Then the response status code should be 200
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "array"
|
||||
|
||||
|
||||
Scenario Outline: Import a process
|
||||
Given POST upload a project file "<project_file>" to "project/import?option=<import_option>"
|
||||
Then the response status code should be 201
|
||||
And the response charset is "UTF-8"
|
||||
And the content type is "application/json"
|
||||
And the type is "object"
|
||||
|
||||
|
||||
Examples:
|
||||
| project_file | import_option |
|
||||
| /home/wendy/processFiles/process1.pmx | create |
|
||||
@@ -1526,6 +1526,21 @@ class RestContext extends BehatContext
|
||||
$this->iRequest($url);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^POST upload a project file "([^"]*)" to "([^"]*)"$/
|
||||
*/
|
||||
public function postUploadAProjectFile($file, $url, PyStringNode $string)
|
||||
{
|
||||
$postFields = json_decode($string);
|
||||
$postFields->project_file ='@'.$file;
|
||||
|
||||
$this->_restObjectMethod = 'post';
|
||||
$this->_restObject = $postFields;
|
||||
$this->iRequest($url);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
|
||||
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
|
||||
if(sizeof($output) == 3) {
|
||||
if(sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
|
||||
define("COLUMNS", $output[2][0]);
|
||||
} else {
|
||||
define("COLUMNS", 80);
|
||||
|
||||
@@ -352,7 +352,9 @@ class WebEntry
|
||||
|
||||
switch ($webEntryMethod) {
|
||||
case "WS":
|
||||
$user = new \Users();
|
||||
require_once(PATH_RBAC . "model" . PATH_SEP . "RbacUsers.php");
|
||||
|
||||
$user = new \RbacUsers();
|
||||
|
||||
$arrayUserData = $user->load($arrayWebEntryData["USR_UID"]);
|
||||
|
||||
@@ -398,7 +400,7 @@ class WebEntry
|
||||
$template->assign("dynaformUid", $dynaFormUid);
|
||||
$template->assign("taskUid", $taskUid);
|
||||
$template->assign("wsUser", $usrUsername);
|
||||
$template->assign("wsPass", "md5:" . md5($usrPassword));
|
||||
$template->assign("wsPass", "md5:" . $usrPassword);
|
||||
$template->assign("wsRoundRobin", $wsRoundRobin);
|
||||
|
||||
if ($webEntryInputDocumentAccess == 0) {
|
||||
|
||||
@@ -462,7 +462,10 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$condition = array_key_exists('FLO_CONDITION', $gatewayFlow) ? $gatewayFlow["FLO_CONDITION"] : '';
|
||||
|
||||
if ($gatewayFlow['FLO_ELEMENT_DEST_TYPE'] == 'bpmnEvent') {
|
||||
$this->wp->addRoute($activity["ACT_UID"], -1, $routeType, $condition);
|
||||
$event = \BpmnEventPeer::retrieveByPK($gatewayFlow['FLO_ELEMENT_DEST']);
|
||||
if ($event->getEvnType() == "END") {
|
||||
$this->wp->addRoute($activity["ACT_UID"], -1, $routeType, $condition);
|
||||
}
|
||||
} else {
|
||||
$this->wp->addRoute($activity["ACT_UID"], $gatewayFlow['FLO_ELEMENT_DEST'], $routeType, $condition);
|
||||
}
|
||||
@@ -490,6 +493,34 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
public static function createFromStruct(array $projectData, $generateUid = true)
|
||||
{
|
||||
$projectData["prj_name"] = trim($projectData["prj_name"]);
|
||||
if ($projectData["prj_name"] == '') {
|
||||
throw new \Exception("`prj_name` is required but it is empty.");
|
||||
}
|
||||
if (\Process::existsByProTitle($projectData["prj_name"])) {
|
||||
throw new \Exception("Project with name: {$projectData["prj_name"]}, already exists.");
|
||||
}
|
||||
$activities = $projectData['diagrams']['0']['activities'];
|
||||
foreach($activities as $value) {
|
||||
if (empty($value['act_name'])) {
|
||||
throw new \Exception("For activity: {$value['act_uid']} `act_name` is required but missing.");
|
||||
}
|
||||
if (empty($value['act_type'])) {
|
||||
throw new \Exception("For activity: {$value['act_uid']} `act_type` is required but missing.");
|
||||
}
|
||||
}
|
||||
$events = $projectData['diagrams']['0']['events'];
|
||||
foreach($events as $value) {
|
||||
if (empty($value['evn_name'])) {
|
||||
throw new \Exception("For event: {$value['evn_uid']} `evn_name` is required but missing.");
|
||||
}
|
||||
if (empty($value['evn_type'])) {
|
||||
throw new \Exception("For event: {$value['evn_uid']} `evn_type` is required but missing.");
|
||||
}
|
||||
if (empty($value['evn_marker'])) {
|
||||
throw new \Exception("For event: {$value['evn_uid']} `evn_marker` is required but missing.");
|
||||
}
|
||||
}
|
||||
$bwp = new self;
|
||||
$result = array();
|
||||
$data = array();
|
||||
|
||||
@@ -309,7 +309,10 @@ class Bpmn extends Handler
|
||||
}
|
||||
|
||||
// setting defaults
|
||||
$data['ACT_UID'] = array_key_exists('ACT_UID', $data) ? $data['ACT_UID'] : Common::generateUID();;
|
||||
$processUid = $process->getProUid();
|
||||
|
||||
$data["ACT_UID"] = (array_key_exists("ACT_UID", $data))? $data["ACT_UID"] : Common::generateUID();
|
||||
$data["PRO_UID"] = $processUid;
|
||||
|
||||
try {
|
||||
self::log("Add Activity with data: ", $data);
|
||||
@@ -317,7 +320,7 @@ class Bpmn extends Handler
|
||||
$activity = new Activity();
|
||||
$activity->fromArray($data);
|
||||
$activity->setPrjUid($this->getUid());
|
||||
$activity->setProUid($process->getProUid());
|
||||
$activity->setProUid($processUid);
|
||||
$activity->save();
|
||||
|
||||
self::log("Add Activity Success!");
|
||||
@@ -395,7 +398,10 @@ class Bpmn extends Handler
|
||||
public function addEvent($data)
|
||||
{
|
||||
// setting defaults
|
||||
$processUid = $this->getProcess("object")->getProUid();
|
||||
|
||||
$data['EVN_UID'] = array_key_exists('EVN_UID', $data) ? $data['EVN_UID'] : Common::generateUID();
|
||||
$data["PRO_UID"] = $processUid;
|
||||
|
||||
try {
|
||||
self::log("Add Event with data: ", $data);
|
||||
@@ -403,7 +409,7 @@ class Bpmn extends Handler
|
||||
$event = new Event();
|
||||
$event->fromArray($data);
|
||||
$event->setPrjUid($this->project->getPrjUid());
|
||||
$event->setProUid($this->getProcess("object")->getProUid());
|
||||
$event->setProUid($processUid);
|
||||
$event->save();
|
||||
|
||||
self::log("Add Event Success!");
|
||||
@@ -485,14 +491,17 @@ class Bpmn extends Handler
|
||||
public function addGateway($data)
|
||||
{
|
||||
// setting defaults
|
||||
$processUid = $this->getProcess("object")->getProUid();
|
||||
|
||||
$data['GAT_UID'] = array_key_exists('GAT_UID', $data) ? $data['GAT_UID'] : Common::generateUID();
|
||||
$data["PRO_UID"] = $processUid;
|
||||
|
||||
try {
|
||||
self::log("Add Gateway with data: ", $data);
|
||||
$gateway = new Gateway();
|
||||
$gateway->fromArray($data);
|
||||
$gateway->setPrjUid($this->getUid());
|
||||
$gateway->setProUid($this->getProcess("object")->getProUid());
|
||||
$gateway->setProUid($processUid);
|
||||
$gateway->save();
|
||||
self::log("Add Gateway Success!");
|
||||
} catch (\Exception $e) {
|
||||
@@ -826,4 +835,5 @@ class Bpmn extends Handler
|
||||
$status = $value ? "DISABLED" : "ACTIVE";
|
||||
$this->update(array("PRJ_STATUS" => $status));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,18 @@ class Project extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Project
|
||||
*
|
||||
* @param string $prj_name
|
||||
* @param array $request_data
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST
|
||||
* @status 201
|
||||
*/
|
||||
public function post($request_data)
|
||||
public function post($prj_name, $request_data)
|
||||
{
|
||||
try {
|
||||
return Adapter\BpmnWorkflow::createFromStruct($request_data);
|
||||
|
||||
Reference in New Issue
Block a user