ProcessMaker-MA "Case Tracker (fixes)"
- Se han modificado el tipo de dato para las variables "routing_history" y "message_history" (bool => int), se ha cambiado el codigo necesario - Se ha modificado el archivo "basic_sequence_case_tracker.feature" para que acepte este cambio
This commit is contained in:
@@ -21,8 +21,8 @@ Feature: Case Tracker
|
||||
"""
|
||||
{
|
||||
"map_type": "NONE",
|
||||
"routing_history": true,
|
||||
"message_history": false
|
||||
"routing_history": 1,
|
||||
"message_history": 0
|
||||
}
|
||||
"""
|
||||
And I request "project/50259961452d82bf57f4f62051572528/case-tracker/property"
|
||||
@@ -40,8 +40,8 @@ Feature: Case Tracker
|
||||
And the response charset is "UTF-8"
|
||||
And the type is "object"
|
||||
And that "map_type" is set to "NONE"
|
||||
And that "routing_history" is set to "true"
|
||||
And that "message_history" is set to "false"
|
||||
And that "routing_history" is set to "1"
|
||||
And that "message_history" is set to "0"
|
||||
|
||||
#CASE TRACKER OBJECT
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ class CaseTracker
|
||||
}
|
||||
|
||||
if (isset($arrayDataIni["routing_history"])) {
|
||||
$arrayData["CT_DERIVATION_HISTORY"] = ($arrayDataIni["routing_history"])? 1 : 0;
|
||||
$arrayData["CT_DERIVATION_HISTORY"] = (int)($arrayDataIni["routing_history"]);
|
||||
}
|
||||
|
||||
if (isset($arrayDataIni["message_history"])) {
|
||||
$arrayData["CT_MESSAGE_HISTORY"] = ($arrayDataIni["message_history"])? 1 : 0;
|
||||
$arrayData["CT_MESSAGE_HISTORY"] = (int)($arrayDataIni["message_history"]);
|
||||
}
|
||||
|
||||
$result = $caseTracker->update($arrayData);
|
||||
@@ -97,8 +97,8 @@ class CaseTracker
|
||||
|
||||
return array(
|
||||
"map_type" => $arrayCaseTracker["CT_MAP_TYPE"],
|
||||
"routing_history" => ($arrayCaseTracker["CT_DERIVATION_HISTORY"] == 1)? true : false,
|
||||
"message_history" => ($arrayCaseTracker["CT_MESSAGE_HISTORY"] == 1)? true : false
|
||||
"routing_history" => (int)($arrayCaseTracker["CT_DERIVATION_HISTORY"]),
|
||||
"message_history" => (int)($arrayCaseTracker["CT_MESSAGE_HISTORY"])
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
|
||||
@@ -74,11 +74,11 @@ class CaseTrackerObject
|
||||
}
|
||||
|
||||
if (!isset($arrayData["CTO_TYPE_OBJ"])) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array("CTO_TYPE_OBJ"), "The \"{0}\" attribute is not defined")));
|
||||
throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_TYPE_OBJ")), "The \"{0}\" attribute is not defined")));
|
||||
}
|
||||
|
||||
if (!isset($arrayData["CTO_UID_OBJ"])) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array("CTO_UID_OBJ"), "The \"{0}\" attribute is not defined")));
|
||||
throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_UID_OBJ")), "The \"{0}\" attribute is not defined")));
|
||||
}
|
||||
|
||||
$step = new \BusinessModel\Step();
|
||||
@@ -151,11 +151,11 @@ class CaseTrackerObject
|
||||
}
|
||||
|
||||
if (isset($arrayData["CTO_TYPE_OBJ"]) && !isset($arrayData["CTO_UID_OBJ"])) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array("CTO_UID_OBJ"), "The \"{0}\" attribute is not defined")));
|
||||
throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_UID_OBJ")), "The \"{0}\" attribute is not defined")));
|
||||
}
|
||||
|
||||
if (!isset($arrayData["CTO_TYPE_OBJ"]) && isset($arrayData["CTO_UID_OBJ"])) {
|
||||
throw (new \Exception(str_replace(array("{0}"), array("CTO_TYPE_OBJ"), "The \"{0}\" attribute is not defined")));
|
||||
throw (new \Exception(str_replace(array("{0}"), array(strtolower("CTO_TYPE_OBJ")), "The \"{0}\" attribute is not defined")));
|
||||
}
|
||||
|
||||
if (isset($arrayData["CTO_TYPE_OBJ"]) && isset($arrayData["CTO_UID_OBJ"])) {
|
||||
|
||||
@@ -12,16 +12,16 @@ use \Luracast\Restler\RestException;
|
||||
class CaseTracker extends Api
|
||||
{
|
||||
/**
|
||||
* @url GET /:projectUid/case-tracker/property
|
||||
* @url GET /:prj_uid/case-tracker/property
|
||||
*
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetCaseTrackerProperty($projectUid)
|
||||
public function doGetCaseTrackerProperty($prj_uid)
|
||||
{
|
||||
try {
|
||||
$caseTracker = new \BusinessModel\CaseTracker();
|
||||
|
||||
$response = $caseTracker->getCaseTracker($projectUid);
|
||||
$response = $caseTracker->getCaseTracker($prj_uid);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
@@ -30,41 +30,41 @@ class CaseTracker extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url PUT /:projectUid/case-tracker/property
|
||||
* @url PUT /:prj_uid/case-tracker/property
|
||||
*
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $map_type {@from body}{@choice NONE,PROCESSMAP,STAGES}
|
||||
* @param bool $routing_history {@from body}
|
||||
* @param bool $message_history {@from body}
|
||||
* @param int $routing_history {@from body}{@choice 0,1}
|
||||
* @param int $message_history {@from body}{@choice 0,1}
|
||||
*/
|
||||
public function doPutCaseTracker(
|
||||
$projectUid,
|
||||
$prj_uid,
|
||||
$request_data,
|
||||
$map_type = "NONE",
|
||||
$routing_history = false,
|
||||
$message_history = false
|
||||
$routing_history = 0,
|
||||
$message_history = 0
|
||||
) {
|
||||
try {
|
||||
$caseTracker = new \BusinessModel\CaseTracker();
|
||||
|
||||
$arrayData = $caseTracker->update($projectUid, $request_data);
|
||||
$arrayData = $caseTracker->update($prj_uid, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:projectUid/case-tracker/objects
|
||||
* @url GET /:prj_uid/case-tracker/objects
|
||||
*
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetCaseTrackerObjects($projectUid)
|
||||
public function doGetCaseTrackerObjects($prj_uid)
|
||||
{
|
||||
try {
|
||||
$caseTracker = new \BusinessModel\CaseTracker();
|
||||
|
||||
$response = $caseTracker->getCaseTrackerObjects($projectUid);
|
||||
$response = $caseTracker->getCaseTrackerObjects($prj_uid);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
@@ -73,16 +73,16 @@ class CaseTracker extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:projectUid/case-tracker/available-objects
|
||||
* @url GET /:prj_uid/case-tracker/available-objects
|
||||
*
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetCaseTrackerAvailableObjects($projectUid)
|
||||
public function doGetCaseTrackerAvailableObjects($prj_uid)
|
||||
{
|
||||
try {
|
||||
$caseTracker = new \BusinessModel\CaseTracker();
|
||||
|
||||
$response = $caseTracker->getAvailableCaseTrackerObjects($projectUid);
|
||||
$response = $caseTracker->getAvailableCaseTrackerObjects($prj_uid);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -12,17 +12,17 @@ use \Luracast\Restler\RestException;
|
||||
class CaseTrackerObject extends Api
|
||||
{
|
||||
/**
|
||||
* @url GET /:projectUid/case-tracker/object/:caseTrackerObjectUid
|
||||
* @url GET /:prj_uid/case-tracker/object/:cto_uid
|
||||
*
|
||||
* @param string $caseTrackerObjectUid {@min 32}{@max 32}
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $cto_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetCaseTrackerObject($caseTrackerObjectUid, $projectUid)
|
||||
public function doGetCaseTrackerObject($cto_uid, $prj_uid)
|
||||
{
|
||||
try {
|
||||
$caseTrackerObject = new \BusinessModel\CaseTrackerObject();
|
||||
|
||||
$response = $caseTrackerObject->getCaseTrackerObject($caseTrackerObjectUid);
|
||||
$response = $caseTrackerObject->getCaseTrackerObject($cto_uid);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
@@ -31,19 +31,19 @@ class CaseTrackerObject extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url POST /:projectUid/case-tracker/object
|
||||
* @url POST /:prj_uid/case-tracker/object
|
||||
*
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $cto_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT}{@required true}
|
||||
* @param string $cto_uid_obj {@from body}{@min 32}{@max 32}{@required true}
|
||||
* @param string $cto_condition
|
||||
* @param string $cto_condition {@from body}
|
||||
* @param int $cto_position {@from body}{@min 1}
|
||||
*
|
||||
* @status 201
|
||||
*/
|
||||
public function doPostCaseTrackerObject(
|
||||
$projectUid,
|
||||
$prj_uid,
|
||||
$request_data,
|
||||
$cto_type_obj = "DYNAFORM",
|
||||
$cto_uid_obj = "00000000000000000000000000000000",
|
||||
@@ -53,7 +53,7 @@ class CaseTrackerObject extends Api
|
||||
try {
|
||||
$caseTrackerObject = new \BusinessModel\CaseTrackerObject();
|
||||
|
||||
$arrayData = $caseTrackerObject->create($projectUid, $request_data);
|
||||
$arrayData = $caseTrackerObject->create($prj_uid, $request_data);
|
||||
|
||||
$response = $arrayData;
|
||||
|
||||
@@ -64,19 +64,19 @@ class CaseTrackerObject extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* @url PUT /:projectUid/case-tracker/object/:caseTrackerObjectUid
|
||||
* @url PUT /:prj_uid/case-tracker/object/:cto_uid
|
||||
*
|
||||
* @param string $caseTrackerObjectUid {@min 32}{@max 32}
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $cto_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $cto_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT}
|
||||
* @param string $cto_uid_obj {@from body}{@min 32}{@max 32}
|
||||
* @param string $cto_condition
|
||||
* @param string $cto_condition {@from body}
|
||||
* @param int $cto_position {@from body}{@min 1}
|
||||
*/
|
||||
public function doPutCaseTrackerObject(
|
||||
$caseTrackerObjectUid,
|
||||
$projectUid,
|
||||
$cto_uid,
|
||||
$prj_uid,
|
||||
$request_data,
|
||||
$cto_type_obj = "DYNAFORM",
|
||||
$cto_uid_obj = "00000000000000000000000000000000",
|
||||
@@ -86,24 +86,24 @@ class CaseTrackerObject extends Api
|
||||
try {
|
||||
$caseTrackerObject = new \BusinessModel\CaseTrackerObject();
|
||||
|
||||
$arrayData = $caseTrackerObject->update($caseTrackerObjectUid, $request_data);
|
||||
$arrayData = $caseTrackerObject->update($cto_uid, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url DELETE /:projectUid/case-tracker/object/:caseTrackerObjectUid
|
||||
* @url DELETE /:prj_uid/case-tracker/object/:cto_uid
|
||||
*
|
||||
* @param string $caseTrackerObjectUid {@min 32}{@max 32}
|
||||
* @param string $projectUid {@min 32}{@max 32}
|
||||
* @param string $cto_uid {@min 32}{@max 32}
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doDeleteCaseTrackerObject($caseTrackerObjectUid, $projectUid)
|
||||
public function doDeleteCaseTrackerObject($cto_uid, $prj_uid)
|
||||
{
|
||||
try {
|
||||
$caseTrackerObject = new \BusinessModel\CaseTrackerObject();
|
||||
|
||||
$caseTrackerObject->delete($caseTrackerObjectUid);
|
||||
$caseTrackerObject->delete($cto_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user