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:
@@ -24,10 +24,10 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
private $arrayTaskAttribute = array(
|
||||
"gateway-to-gateway" => array("type" => "GATEWAYTOGATEWAY", "prefix" => "gtg-"),
|
||||
"start-message-event" => array("type" => "START-MESSAGE-EVENT", "prefix" => "sme-"),
|
||||
"end-message-event" => array("type" => "END-MESSAGE-EVENT", "prefix" => "eme-"),
|
||||
"intermediate-start-message-event" => array("type" => "INTERMEDIATE-START-MESSAGE-EVENT", "prefix" => "isme-"),
|
||||
"intermediate-end-message-event" => array("type" => "INTERMEDIATE-END-MESSAGE-EVENT", "prefix" => "ieme-")
|
||||
"start-message-event" => array("type" => "START-MESSAGE-EVENT", "prefix" => "sme-"),
|
||||
"intermediate-throw-message-event" => array("type" => "INTERMEDIATE-THROW-MESSAGE-EVENT", "prefix" => "itme-"),
|
||||
"intermediate-catch-message-event" => array("type" => "INTERMEDIATE-CATCH-MESSAGE-EVENT", "prefix" => "icme-")
|
||||
);
|
||||
|
||||
private $arrayMessageEventTaskRelation = array();
|
||||
@@ -599,9 +599,9 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
));
|
||||
|
||||
if ($elementType == "bpmnEvent" &&
|
||||
in_array($key, array("start-message-event", "end-message-event", "intermediate-start-message-event"))
|
||||
in_array($key, array("end-message-event", "start-message-event", "intermediate-catch-message-event"))
|
||||
) {
|
||||
if ($key == "intermediate-start-message-event") {
|
||||
if ($key == "intermediate-catch-message-event") {
|
||||
//Task - User
|
||||
//Assign to admin
|
||||
$task = new \Tasks();
|
||||
@@ -681,6 +681,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
//Flows
|
||||
$arrayFlow = \BpmnFlow::findAllBy(array(
|
||||
\BpmnFlowPeer::FLO_TYPE => array("MESSAGE", \Criteria::NOT_EQUAL),
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN => $gatewayUid,
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnGateway"
|
||||
));
|
||||
@@ -770,21 +771,26 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
if (!is_null($arrayEventData) &&
|
||||
in_array($arrayEventData["EVN_TYPE"], $arrayEventType) && in_array($arrayEventData["EVN_MARKER"], $arrayEventMarker)
|
||||
) {
|
||||
//Event - INTERMEDIATE-START-MESSAGE-EVENT
|
||||
//Event - INTERMEDIATE-CATCH-MESSAGE-EVENT
|
||||
if ($arrayEventData["EVN_TYPE"] == "INTERMEDIATE" && $arrayEventData["EVN_MARKER"] == "MESSAGECATCH") {
|
||||
$taskUid = $this->createTaskByElement(
|
||||
$eventUid,
|
||||
"bpmnEvent",
|
||||
"intermediate-start-message-event"
|
||||
"intermediate-catch-message-event"
|
||||
);
|
||||
|
||||
$result = $this->wp->addRoute($activityUid, $taskUid, $routeType, $routeCondition, $routeDefault);
|
||||
|
||||
$activityUid = $taskUid;
|
||||
|
||||
$routeType = "SEQUENTIAL";
|
||||
$routeCondition = "";
|
||||
$routeDefault = 0;
|
||||
}
|
||||
|
||||
//Flows
|
||||
$arrayFlow = \BpmnFlow::findAllBy(array(
|
||||
\BpmnFlowPeer::FLO_TYPE => array("MESSAGE", \Criteria::NOT_EQUAL),
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN => $eventUid,
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnEvent"
|
||||
));
|
||||
@@ -795,7 +801,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
switch ($arrayFlowData["FLO_ELEMENT_DEST_TYPE"]) {
|
||||
case "bpmnActivity":
|
||||
//Event ----> Activity
|
||||
$result = $this->wp->addRoute($activityUid, $arrayFlowData["FLO_ELEMENT_DEST"], "SEQUENTIAL");
|
||||
$result = $this->wp->addRoute($activityUid, $arrayFlowData["FLO_ELEMENT_DEST"], $routeType, $routeCondition, $routeDefault);
|
||||
break;
|
||||
case "bpmnGateway":
|
||||
//Event ----> Gateway
|
||||
@@ -814,7 +820,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//$event->getEvnMarker(): EMPTY or MESSAGETHROW
|
||||
switch ($event->getEvnMarker()) {
|
||||
case "EMPTY":
|
||||
$result = $this->wp->addRoute($activityUid, -1, "SEQUENTIAL");
|
||||
$result = $this->wp->addRoute($activityUid, -1, $routeType, $routeCondition, $routeDefault);
|
||||
break;
|
||||
case "MESSAGETHROW":
|
||||
$taskUid = $this->createTaskByElement(
|
||||
@@ -823,13 +829,13 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
"end-message-event"
|
||||
);
|
||||
|
||||
$result = $this->wp->addRoute($activityUid, $taskUid, "SEQUENTIAL");
|
||||
$result = $this->wp->addRoute($activityUid, $taskUid, $routeType, $routeCondition, $routeDefault);
|
||||
$result = $this->wp->addRoute($taskUid, -1, "SEQUENTIAL");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "INTERMEDIATE":
|
||||
$this->mapBpmnEventToWorkflowRoutes($activityUid, $arrayFlowData["FLO_ELEMENT_DEST"]);
|
||||
$this->mapBpmnEventToWorkflowRoutes($activityUid, $arrayFlowData["FLO_ELEMENT_DEST"], $routeType, $routeCondition, $routeDefault);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -865,6 +871,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
//Flows
|
||||
$arrayFlow = \BpmnFlow::findAllBy(array(
|
||||
\BpmnFlowPeer::FLO_TYPE => array("MESSAGE", \Criteria::NOT_EQUAL),
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN => $activity["ACT_UID"],
|
||||
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnActivity"
|
||||
));
|
||||
@@ -926,9 +933,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
foreach ($this->getEvents() as $value) {
|
||||
$event = $value;
|
||||
|
||||
if (!isset($this->arrayMessageEventTaskRelation[$event["EVN_UID"]]) &&
|
||||
in_array($event["EVN_TYPE"], $arrayEventType) && in_array($event["EVN_MARKER"], $arrayEventMarker)
|
||||
) {
|
||||
if (in_array($event["EVN_TYPE"], $arrayEventType) && in_array($event["EVN_MARKER"], $arrayEventMarker)) {
|
||||
switch ($event["EVN_TYPE"]) {
|
||||
case "START":
|
||||
$taskUid = $this->createTaskByElement(
|
||||
@@ -1737,13 +1742,14 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
public function createMessageEventRelationByBpmnFlow(\BpmnFlow $bpmnFlow)
|
||||
{
|
||||
try {
|
||||
$messageEventRelation = new \ProcessMaker\BusinessModel\MessageEventRelation();
|
||||
|
||||
$messageEventRelationUid = "";
|
||||
|
||||
if ($bpmnFlow->getFloType() == "MESSAGE" &&
|
||||
$bpmnFlow->getFloElementOriginType() == "bpmnEvent" && $bpmnFlow->getFloElementDestType() == "bpmnEvent"
|
||||
$bpmnFlow->getFloElementOriginType() == "bpmnEvent" && $bpmnFlow->getFloElementDestType() == "bpmnEvent" &&
|
||||
!$messageEventRelation->existsEventRelation($bpmnFlow->getPrjUid(), $bpmnFlow->getFloElementOrigin(), $bpmnFlow->getFloElementDest())
|
||||
) {
|
||||
$messageEventRelation = new \ProcessMaker\BusinessModel\MessageEventRelation();
|
||||
|
||||
$arrayResult = $messageEventRelation->create(
|
||||
$bpmnFlow->getPrjUid(),
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user