PM-939 "Support for Message-Event(Export, Import y Delete)"
> Se han implementado los metodos para: Export, Import y Delete (delete Process) de este nuevo "Objeto", asi tambien se ha agregado validaciones en el listados en el casesList.
This commit is contained in:
@@ -8,7 +8,7 @@ class MessageEventDefinition
|
||||
|
||||
"PRJ_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "projectUid"),
|
||||
"EVN_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "eventUid"),
|
||||
"MSGT_UID" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "messageTypeUid"),
|
||||
"MSGT_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "messageTypeUid"),
|
||||
"MSGED_USR_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "messageEventDefinitionUserUid"),
|
||||
"MSGED_VARIABLES" => array("type" => "array", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "messageEventDefinitionVariables"),
|
||||
"MSGED_CORRELATION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "messageEventDefinitionCorrelation")
|
||||
@@ -259,7 +259,7 @@ class MessageEventDefinition
|
||||
*
|
||||
* return array Return data of the new Message-Event-Definition created
|
||||
*/
|
||||
public function create($projectUid, array $arrayData)
|
||||
public function create($projectUid, array $arrayData, $flagValidateArrayData = true)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
@@ -278,7 +278,9 @@ class MessageEventDefinition
|
||||
//Verify data
|
||||
$process->throwExceptionIfNotExistsProcess($projectUid, $this->arrayFieldNameForException["projectUid"]);
|
||||
|
||||
$this->throwExceptionIfDataIsInvalid("", $projectUid, $arrayData);
|
||||
if ($flagValidateArrayData) {
|
||||
$this->throwExceptionIfDataIsInvalid("", $projectUid, $arrayData);
|
||||
}
|
||||
|
||||
//Create
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
@@ -295,6 +297,21 @@ class MessageEventDefinition
|
||||
$arrayData["MSGED_VARIABLES"] = array();
|
||||
}
|
||||
|
||||
if (isset($arrayData["MSGED_USR_UID"]) && $arrayData["MSGED_USR_UID"] != "") {
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\UsersPeer::USR_UID);
|
||||
$criteria->add(\UsersPeer::USR_UID, $arrayData["MSGED_USR_UID"], \Criteria::EQUAL);
|
||||
|
||||
//QUERY
|
||||
$rsCriteria = \UsersPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
$arrayData["MSGED_USR_UID"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
$messageEventDefinitionUid = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
$messageEventDefinition->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
@@ -314,7 +331,7 @@ class MessageEventDefinition
|
||||
$cnn->commit();
|
||||
|
||||
//Task - User
|
||||
if (isset($arrayData["MSGED_USR_UID"])) {
|
||||
if (isset($arrayData["MSGED_USR_UID"]) && $arrayData["MSGED_USR_UID"] != "") {
|
||||
$bpmnEvent = \BpmnEventPeer::retrieveByPK($arrayData["EVN_UID"]);
|
||||
|
||||
//Event - START-MESSAGE-EVENT
|
||||
|
||||
Reference in New Issue
Block a user