PM-939 "Support for Message-Event (Running case & Message-Event CRON)"
- Se a implementado el Running case
- Se a implementado el Message-Event CRON:
Para ejecutar el Message-Event CRON, ejecute el siguiente comando:
/path/to/processmaker/workflow/engine/bin$ php -f messageeventcron.php +wMyWorkspace
Nota.- Para el correcto funcionamiento del proceso y de esta nueva funcionalidad
se debera crear el proceso nuevamente (esta nueva funcionalidad
no funcionara con procesos BPMN antiguos a la fecha de este commit)
This commit is contained in:
@@ -1970,4 +1970,130 @@ class Cases
|
||||
|
||||
return $aField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw Message-Events for the Case
|
||||
*
|
||||
* @param string $elementOriginUid Unique id of Element Origin (unique id of Task)
|
||||
* @param string $elementDestUid Unique id of Element Dest (unique id of Task)
|
||||
* @param array $arrayApplicationData Case data
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function throwMessageEventBetweenElementOriginAndElementDest($elementOriginUid, $elementDestUid, array $arrayApplicationData)
|
||||
{
|
||||
try {
|
||||
//Element origin and dest
|
||||
$messageEventTaskRelation = new \ProcessMaker\BusinessModel\MessageEventTaskRelation();
|
||||
|
||||
$arrayElement = array(
|
||||
"elementOrigin" => array("uid" => $elementOriginUid, "type" => "bpmnActivity"),
|
||||
"elementDest" => array("uid" => $elementDestUid, "type" => "bpmnActivity")
|
||||
);
|
||||
|
||||
foreach ($arrayElement as $key => $value) {
|
||||
$arrayMessageEventTaskRelationData = $messageEventTaskRelation->getMessageEventTaskRelationWhere(
|
||||
array(
|
||||
\MessageEventTaskRelationPeer::PRJ_UID => $arrayApplicationData["PRO_UID"],
|
||||
\MessageEventTaskRelationPeer::TAS_UID => $arrayElement[$key]["uid"]
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
if (!is_null($arrayMessageEventTaskRelationData)) {
|
||||
$arrayElement[$key]["uid"] = $arrayMessageEventTaskRelationData["EVN_UID"];
|
||||
$arrayElement[$key]["type"] = "bpmnEvent";
|
||||
}
|
||||
}
|
||||
|
||||
$elementOriginUid = $arrayElement["elementOrigin"]["uid"];
|
||||
$elementOriginType = $arrayElement["elementOrigin"]["type"];
|
||||
$elementDestUid = $arrayElement["elementDest"]["uid"];
|
||||
$elementDestType = $arrayElement["elementDest"]["type"];
|
||||
|
||||
//Get Message-Events of throw type
|
||||
$bpmn = new \ProcessMaker\Project\Bpmn();
|
||||
|
||||
$arrayEvent = $bpmn->getMessageEventsOfThrowTypeBetweenElementOriginAndElementDest(
|
||||
$elementOriginUid,
|
||||
$elementOriginType,
|
||||
$elementDestUid,
|
||||
$elementDestType
|
||||
);
|
||||
|
||||
//Throw Message-Events
|
||||
$messageApplication = new \ProcessMaker\BusinessModel\MessageApplication();
|
||||
|
||||
foreach ($arrayEvent as $value) {
|
||||
//Message-Application throw
|
||||
$result = $messageApplication->create($arrayApplicationData["APP_UID"], $arrayApplicationData["PRO_UID"], $value[0], $arrayApplicationData);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Catch Message-Events for the Cases
|
||||
*
|
||||
* @param bool $frontEnd Flag to represent progress bar
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function catchMessageEvent($frontEnd = false)
|
||||
{
|
||||
try {
|
||||
\G::LoadClass("wsBase");
|
||||
|
||||
//Set variables
|
||||
$ws = new \wsBase();
|
||||
|
||||
//Get data
|
||||
$messageApplication = new \ProcessMaker\BusinessModel\MessageApplication();
|
||||
|
||||
$arrayMessageApplicationUnread = $messageApplication->getMessageApplications(array("messageApplicationStatus" => "UNREAD"));
|
||||
|
||||
foreach ($arrayMessageApplicationUnread["data"] as $value) {
|
||||
$arrayMessageApplicationData = $value;
|
||||
|
||||
$processUid = $arrayMessageApplicationData["PRJ_UID"];
|
||||
$taskUid = $arrayMessageApplicationData["TAS_UID"];
|
||||
|
||||
$messageApplicationUid = $arrayMessageApplicationData["MSGAPP_UID"];
|
||||
$messageApplicationCorrelation = $arrayMessageApplicationData["MSGAPP_CORRELATION"];
|
||||
|
||||
$messageEventDefinitionUserUid = $arrayMessageApplicationData["MSGED_USR_UID"];
|
||||
$messageEventDefinitionVariables = $arrayMessageApplicationData["MSGED_VARIABLES"];
|
||||
$messageEventDefinitionCorrelation = $arrayMessageApplicationData["MSGED_CORRELATION"];
|
||||
|
||||
switch ($arrayMessageApplicationData["EVN_TYPE"]) {
|
||||
case "START":
|
||||
if ($messageApplicationCorrelation == $messageEventDefinitionCorrelation &&
|
||||
$messageEventDefinitionUserUid != ""
|
||||
) {
|
||||
//Start and derivate new Case
|
||||
//$result = $ws->newCase($processUid, $messageEventDefinitionUserUid, $taskUid, array("NAME1" => "value1"));
|
||||
$result = $ws->newCase($processUid, $messageEventDefinitionUserUid, $taskUid, array());
|
||||
|
||||
$arrayResult = json_decode(json_encode($result), true);
|
||||
|
||||
if ($arrayResult["status_code"] == 0) {
|
||||
$applicationUid = $arrayResult["caseId"];
|
||||
|
||||
$result = $ws->derivateCase($messageEventDefinitionUserUid, $applicationUid, 1);
|
||||
|
||||
//Message-Application catch
|
||||
$result = $messageApplication->update($messageApplicationUid, array("MSGAPP_STATUS" => "READ"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "INTERMEDIATE":
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
class MessageApplication
|
||||
{
|
||||
private $arrayFieldNameForException = array(
|
||||
"start" => "START",
|
||||
"limit" => "LIMIT"
|
||||
);
|
||||
|
||||
/**
|
||||
* Verify if exists the Message-Application
|
||||
*
|
||||
* @param string $messageApplicationUid Unique id of Message-Application
|
||||
*
|
||||
* return bool Return true if exists the Message-Application, false otherwise
|
||||
*/
|
||||
public function exists($messageApplicationUid)
|
||||
{
|
||||
try {
|
||||
$obj = \MessageApplicationPeer::retrieveByPK($messageApplicationUid);
|
||||
|
||||
return (!is_null($obj))? true : false;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Message-Application for the Case
|
||||
*
|
||||
* @param string $applicationUid Unique id of Case
|
||||
* @param string $projectUid Unique id of Project
|
||||
* @param string $eventUidThrow Unique id of Event (throw)
|
||||
* @param array $arrayApplicationData Case data
|
||||
*
|
||||
* return bool Return true if been created, false otherwise
|
||||
*/
|
||||
public function create($applicationUid, $projectUid, $eventUidThrow, array $arrayApplicationData)
|
||||
{
|
||||
try {
|
||||
$flagCreate = true;
|
||||
|
||||
//Set data
|
||||
//Message-Event-Relation - Get unique id of Event (catch)
|
||||
$messageEventRelation = new \ProcessMaker\BusinessModel\MessageEventRelation();
|
||||
|
||||
$arrayMessageEventRelationData = $messageEventRelation->getMessageEventRelationWhere(
|
||||
array(
|
||||
\MessageEventRelationPeer::PRJ_UID => $projectUid,
|
||||
\MessageEventRelationPeer::EVN_UID_THROW => $eventUidThrow
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
if (!is_null($arrayMessageEventRelationData)) {
|
||||
$eventUidCatch = $arrayMessageEventRelationData["EVN_UID_CATCH"];
|
||||
} else {
|
||||
$flagCreate = false;
|
||||
}
|
||||
|
||||
//Message-Application - Get data ($eventUidThrow)
|
||||
$messageEventDefinition = new \ProcessMaker\BusinessModel\MessageEventDefinition();
|
||||
|
||||
if ($messageEventDefinition->existsEvent($projectUid, $eventUidThrow)) {
|
||||
$arrayMessageEventDefinitionData = $messageEventDefinition->getMessageEventDefinitionByEvent($projectUid, $eventUidThrow, true);
|
||||
|
||||
$arrayMessageApplicationVariables = $arrayMessageEventDefinitionData["MSGED_VARIABLES"];
|
||||
$messageApplicationCorrelation = \G::replaceDataField($arrayMessageEventDefinitionData["MSGED_CORRELATION"], $arrayApplicationData["APP_DATA"]);
|
||||
|
||||
foreach ($arrayMessageApplicationVariables as $key => $value) {
|
||||
$arrayMessageApplicationVariables[$key] = \G::replaceDataField($value, $arrayApplicationData["APP_DATA"]);
|
||||
}
|
||||
} else {
|
||||
$flagCreate = false;
|
||||
}
|
||||
|
||||
if (!$flagCreate) {
|
||||
//Return
|
||||
return false;
|
||||
}
|
||||
|
||||
//Create
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
|
||||
try {
|
||||
$messageApplication = new \MessageApplication();
|
||||
|
||||
$messageApplicationUid = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
$messageApplication->setMsgappUid($messageApplicationUid);
|
||||
$messageApplication->setAppUid($applicationUid);
|
||||
$messageApplication->setPrjUid($projectUid);
|
||||
$messageApplication->setEvnUidThrow($eventUidThrow);
|
||||
$messageApplication->setEvnUidCatch($eventUidCatch);
|
||||
$messageApplication->setMsgappVariables(serialize($arrayMessageApplicationVariables));
|
||||
$messageApplication->setMsgappCorrelation($messageApplicationCorrelation);
|
||||
$messageApplication->setMsgappThrowDate("now");
|
||||
|
||||
if ($messageApplication->validate()) {
|
||||
$cnn->begin();
|
||||
|
||||
$result = $messageApplication->save();
|
||||
|
||||
$cnn->commit();
|
||||
|
||||
//Return
|
||||
return true;
|
||||
} else {
|
||||
$msg = "";
|
||||
|
||||
foreach ($messageApplication->getValidationFailures() as $validationFailure) {
|
||||
$msg = $msg . (($msg != "")? "\n" : "") . $validationFailure->getMessage();
|
||||
}
|
||||
|
||||
throw new \Exception(\G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . (($msg != "")? "\n" . $msg : ""));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$cnn->rollback();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Message-Application
|
||||
*
|
||||
* @param string $messageApplicationUid Unique id of Message-Application
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return bool Return true if been updated, false otherwise
|
||||
*/
|
||||
public function update($messageApplicationUid, array $arrayData)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
if (!$this->exists($messageApplicationUid)) {
|
||||
//Return
|
||||
return false;
|
||||
}
|
||||
|
||||
//Update
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
|
||||
try {
|
||||
$messageApplication = \MessageApplicationPeer::retrieveByPK($messageApplicationUid);
|
||||
|
||||
$messageApplication->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$messageApplication->setMsgappCatchDate("now");
|
||||
|
||||
if ($messageApplication->validate()) {
|
||||
$cnn->begin();
|
||||
|
||||
$result = $messageApplication->save();
|
||||
|
||||
$cnn->commit();
|
||||
|
||||
//Return
|
||||
return true;
|
||||
} else {
|
||||
$msg = "";
|
||||
|
||||
foreach ($messageApplication->getValidationFailures() as $validationFailure) {
|
||||
$msg = $msg . (($msg != "")? "\n" : "") . $validationFailure->getMessage();
|
||||
}
|
||||
|
||||
throw new \Exception(\G::LoadTranslation("ID_REGISTRY_CANNOT_BE_UPDATED") . (($msg != "")? "\n" . $msg : ""));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$cnn->rollback();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get criteria for Message-Application
|
||||
*
|
||||
* return object
|
||||
*/
|
||||
public function getMessageApplicationCriteria()
|
||||
{
|
||||
try {
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::MSGAPP_UID);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::APP_UID);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::PRJ_UID);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::EVN_UID_THROW);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::EVN_UID_CATCH);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::MSGAPP_VARIABLES);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::MSGAPP_CORRELATION);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::MSGAPP_THROW_DATE);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::MSGAPP_CATCH_DATE);
|
||||
$criteria->addSelectColumn(\MessageApplicationPeer::MSGAPP_STATUS);
|
||||
|
||||
return $criteria;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Message-Applications
|
||||
*
|
||||
* @param array $arrayFilterData Data of the filters
|
||||
* @param string $sortField Field name to sort
|
||||
* @param string $sortDir Direction of sorting (ASC, DESC)
|
||||
* @param int $start Start
|
||||
* @param int $limit Limit
|
||||
*
|
||||
* return array Return an array with all Message-Applications
|
||||
*/
|
||||
public function getMessageApplications($arrayFilterData = null, $sortField = null, $sortDir = null, $start = null, $limit = null)
|
||||
{
|
||||
try {
|
||||
$arrayMessageApplication = array();
|
||||
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
|
||||
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);
|
||||
|
||||
//Get data
|
||||
if (!is_null($limit) && $limit . "" == "0") {
|
||||
return $arrayMessageApplication;
|
||||
}
|
||||
|
||||
//SQL
|
||||
$criteria = $this->getMessageApplicationCriteria();
|
||||
|
||||
$criteria->addSelectColumn(\BpmnEventPeer::EVN_UID);
|
||||
$criteria->addSelectColumn(\BpmnEventPeer::EVN_TYPE);
|
||||
$criteria->addSelectColumn(\BpmnEventPeer::EVN_MARKER);
|
||||
$criteria->addSelectColumn(\MessageEventDefinitionPeer::MSGED_USR_UID);
|
||||
$criteria->addSelectColumn(\MessageEventDefinitionPeer::MSGED_VARIABLES);
|
||||
$criteria->addSelectColumn(\MessageEventDefinitionPeer::MSGED_CORRELATION);
|
||||
$criteria->addSelectColumn(\MessageEventTaskRelationPeer::TAS_UID);
|
||||
|
||||
$arrayEventType = array("START", "INTERMEDIATE");
|
||||
$arrayEventMarker = array("MESSAGECATCH");
|
||||
|
||||
$criteria->addJoin(\MessageApplicationPeer::EVN_UID_CATCH, \BpmnEventPeer::EVN_UID, \Criteria::INNER_JOIN);
|
||||
$criteria->add(\BpmnEventPeer::EVN_TYPE, $arrayEventType, \Criteria::IN);
|
||||
$criteria->add(\BpmnEventPeer::EVN_MARKER, $arrayEventMarker, \Criteria::IN);
|
||||
|
||||
$criteria->addJoin(\MessageApplicationPeer::EVN_UID_CATCH, \MessageEventDefinitionPeer::EVN_UID, \Criteria::INNER_JOIN);
|
||||
|
||||
$criteria->addJoin(\MessageApplicationPeer::EVN_UID_CATCH, \MessageEventTaskRelationPeer::EVN_UID, \Criteria::INNER_JOIN);
|
||||
|
||||
if (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData["messageApplicationStatus"]) && trim($arrayFilterData["messageApplicationStatus"]) != "") {
|
||||
$criteria->add(\MessageApplicationPeer::MSGAPP_STATUS, $arrayFilterData["messageApplicationStatus"], \Criteria::EQUAL);
|
||||
}
|
||||
|
||||
//Number records total
|
||||
$criteriaCount = clone $criteria;
|
||||
|
||||
$criteriaCount->clearSelectColumns();
|
||||
$criteriaCount->addSelectColumn("COUNT(" . \MessageApplicationPeer::MSGAPP_UID . ") AS NUM_REC");
|
||||
|
||||
$rsCriteriaCount = \MessageApplicationPeer::doSelectRS($criteriaCount);
|
||||
$rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rsCriteriaCount->next();
|
||||
$row = $rsCriteriaCount->getRow();
|
||||
|
||||
$numRecTotal = $row["NUM_REC"];
|
||||
|
||||
//SQL
|
||||
if (!is_null($sortField) && trim($sortField) != "") {
|
||||
$sortField = strtoupper($sortField);
|
||||
|
||||
if (in_array($sortField, array("MSGAPP_THROW_DATE", "MSGAPP_CATCH_DATE", "MSGAPP_STATUS"))) {
|
||||
$sortField = \MessageApplicationPeer::TABLE_NAME . "." . $sortField;
|
||||
} else {
|
||||
$sortField = \MessageApplicationPeer::MSGAPP_THROW_DATE;
|
||||
}
|
||||
} else {
|
||||
$sortField = \MessageApplicationPeer::MSGAPP_THROW_DATE;
|
||||
}
|
||||
|
||||
if (!is_null($sortDir) && trim($sortDir) != "" && strtoupper($sortDir) == "DESC") {
|
||||
$criteria->addDescendingOrderByColumn($sortField);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sortField);
|
||||
}
|
||||
|
||||
if (!is_null($start)) {
|
||||
$criteria->setOffset((int)($start));
|
||||
}
|
||||
|
||||
if (!is_null($limit)) {
|
||||
$criteria->setLimit((int)($limit));
|
||||
}
|
||||
|
||||
$rsCriteria = \MessageApplicationPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
$row["MSGAPP_VARIABLES"] = unserialize($row["MSGAPP_VARIABLES"]);
|
||||
$row["MSGED_VARIABLES"] = unserialize($row["MSGED_VARIABLES"]);
|
||||
|
||||
$arrayMessageApplication[] = $row;
|
||||
}
|
||||
|
||||
//Return
|
||||
return array(
|
||||
"total" => $numRecTotal,
|
||||
"start" => (int)((!is_null($start))? $start : 0),
|
||||
"limit" => (int)((!is_null($limit))? $limit : 0),
|
||||
"filter" => (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData["messageApplicationStatus"]))? $arrayFilterData["messageApplicationStatus"] : "",
|
||||
"data" => $arrayMessageApplication
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,9 +220,7 @@ class MessageEventDefinition
|
||||
}
|
||||
|
||||
if (isset($arrayData["MSGT_UID"]) && $arrayData["MSGT_UID"] . "" != "") {
|
||||
if (!$messageType->exists($arrayData["MSGT_UID"])) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_MESSAGE_TYPE_NOT_EXIST", array($this->arrayFieldNameForException["messageTypeUid"], $arrayData["MSGT_UID"])));
|
||||
}
|
||||
$messageType->throwExceptionIfNotExistsMessageType($arrayData["MSGT_UID"], $this->arrayFieldNameForException["messageTypeUid"]);
|
||||
}
|
||||
|
||||
$flagCheckData = false;
|
||||
@@ -335,7 +333,7 @@ class MessageEventDefinition
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($arrayData["EVN_UID"]);
|
||||
|
||||
//Event - START-MESSAGE-EVENT
|
||||
if (is_null($bpmnEvent) && $bpmnEvent->getEvnType() == "START" && $bpmnEvent->getEvnMarker() == "MESSAGECATCH") {
|
||||
if (!is_null($bpmnEvent) && $bpmnEvent->getEvnType() == "START" && $bpmnEvent->getEvnMarker() == "MESSAGECATCH") {
|
||||
//Message-Event-Task-Relation - Get Task
|
||||
$messageEventTaskRelation = new \ProcessMaker\BusinessModel\MessageEventTaskRelation();
|
||||
|
||||
@@ -438,7 +436,7 @@ class MessageEventDefinition
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($arrayMessageEventDefinitionData["EVN_UID"]);
|
||||
|
||||
//Event - START-MESSAGE-EVENT
|
||||
if (is_null($bpmnEvent) && $bpmnEvent->getEvnType() == "START" && $bpmnEvent->getEvnMarker() == "MESSAGECATCH") {
|
||||
if (!is_null($bpmnEvent) && $bpmnEvent->getEvnType() == "START" && $bpmnEvent->getEvnMarker() == "MESSAGECATCH") {
|
||||
//Message-Event-Task-Relation - Get Task
|
||||
$messageEventTaskRelation = new \ProcessMaker\BusinessModel\MessageEventTaskRelation();
|
||||
|
||||
|
||||
@@ -322,7 +322,11 @@ class MessageEventRelation
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
foreach ($arrayCondition as $key => $value) {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
if (is_array($value)) {
|
||||
$criteria->add($key, $value[0], $value[1]);
|
||||
} else {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = \MessageEventRelationPeer::doDelete($criteria);
|
||||
@@ -404,5 +408,44 @@ class MessageEventRelation
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of a Message-Event-Relation
|
||||
*
|
||||
* @param array $arrayCondition Conditions
|
||||
* @param bool $flagGetRecord Value that set the getting
|
||||
*
|
||||
* return array Return an array with data of a Message-Event-Relation, otherwise null
|
||||
*/
|
||||
public function getMessageEventRelationWhere(array $arrayCondition, $flagGetRecord = false)
|
||||
{
|
||||
try {
|
||||
//Get data
|
||||
$criteria = $this->getMessageEventRelationCriteria();
|
||||
|
||||
foreach ($arrayCondition as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$criteria->add($key, $value[0], $value[1]);
|
||||
} else {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
$rsCriteria = \MessageEventRelationPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
//Return
|
||||
return (!$flagGetRecord)? $this->getMessageEventRelationDataFromRecord($row) : $row;
|
||||
} else {
|
||||
//Return
|
||||
return null;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,11 @@ class MessageEventTaskRelation
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
foreach ($arrayCondition as $key => $value) {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
if (is_array($value)) {
|
||||
$criteria->add($key, $value[0], $value[1]);
|
||||
} else {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = \MessageEventTaskRelationPeer::doDelete($criteria);
|
||||
@@ -320,7 +324,7 @@ class MessageEventTaskRelation
|
||||
* @param array $arrayCondition Conditions
|
||||
* @param bool $flagGetRecord Value that set the getting
|
||||
*
|
||||
* return array Return an array with data of a Message-Event-Task-Relation
|
||||
* return array Return an array with data of a Message-Event-Task-Relation, otherwise null
|
||||
*/
|
||||
public function getMessageEventTaskRelationWhere(array $arrayCondition, $flagGetRecord = false)
|
||||
{
|
||||
@@ -329,7 +333,11 @@ class MessageEventTaskRelation
|
||||
$criteria = $this->getMessageEventTaskRelationCriteria();
|
||||
|
||||
foreach ($arrayCondition as $key => $value) {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
if (is_array($value)) {
|
||||
$criteria->add($key, $value[0], $value[1]);
|
||||
} else {
|
||||
$criteria->add($key, $value, \Criteria::EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
$rsCriteria = \MessageEventTaskRelationPeer::doSelectRS($criteria);
|
||||
|
||||
Reference in New Issue
Block a user