Merge remote-tracking branch 'upstream/3.1' into FBI-790

This commit is contained in:
alex_santos
2016-08-19 09:29:44 -04:00
9 changed files with 38 additions and 39 deletions

View File

@@ -4129,7 +4129,7 @@ class Processes
try {
$result = $scriptTask->create($processUid, $record);
} catch (Exception $e) {
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, SYS_SYS, 'processImporter.log');
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, SYS_SYS, 'processmaker.log');
}
}
} catch (Exception $e) {

View File

@@ -475,7 +475,7 @@ class EmailEvent
\PMFSendMessage($appUID, $configEmailData['MESS_ACCOUNT'], $emailTo, '', '', $subject,
$contentFile['prf_filename'], array(), array(), true, 0, $configEmailData);
} else {
\Bootstrap::registerMonolog('EmailEventMailError', 200, \G::LoadTranslation('ID_EMAIL_EVENT_CONFIGURATION_EMAIL', array($eventUid, $prj_uid)), ['eventUid' => $eventUid, 'prj_uid' => $prj_uid], SYS_SYS, 'emailEvent.log');
\Bootstrap::registerMonolog('EmailEventMailError', 200, \G::LoadTranslation('ID_EMAIL_EVENT_CONFIGURATION_EMAIL', array($eventUid, $prj_uid)), ['eventUid' => $eventUid, 'prj_uid' => $prj_uid], SYS_SYS, 'processmaker.log');
}
}
}
@@ -530,4 +530,3 @@ class EmailEvent
}
}
}

View File

@@ -303,7 +303,7 @@ class Light
$response['caseNumber'] = $aData['CASE_NUMBER'];
//Log
\Bootstrap::registerMonolog('create-case', 200, "Create case", ['application_uid' => $aData['APPLICATION'], 'usr_uid' => $userId], SYS_SYS, 'mobileLogs.log');
\Bootstrap::registerMonolog('MobileCreateCase', 200, "Create case", ['application_uid' => $aData['APPLICATION'], 'usr_uid' => $userId], SYS_SYS, 'processmaker.log');
} catch (Exception $e) {
$response['status'] = 'failure';
$response['message'] = $e->getMessage();
@@ -539,7 +539,7 @@ class Light
}
//Log
\Bootstrap::registerMonolog('route-case', 200, 'Route case', ['application_uid' => $applicationUid, 'usr_uid' => $userUid], SYS_SYS, 'mobileLogs.log');
\Bootstrap::registerMonolog('MobileRouteCase', 200, 'Route case', ['application_uid' => $applicationUid, 'usr_uid' => $userUid], SYS_SYS, 'processmaker.log');
} catch (\Exception $e) {
throw $e;
}
@@ -1343,4 +1343,3 @@ class Light
}
}

View File

@@ -661,10 +661,9 @@ class MessageApplication
,'inpDocUid'=> $inpDocUid
,'url' => $url
);
\Bootstrap::registerMonolog('MessageEventCron', $level, $message, $aContext, SYS_SYS, 'messageevent.log');
\Bootstrap::registerMonolog('MessageEventCron', $level, $message, $aContext, SYS_SYS, 'processmaker.log');
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -1211,7 +1211,7 @@ class TimerEvent
,'inpDocUid'=> $inpDocUid
,'url' => $url
);
\Bootstrap::registerMonolog('TimerEventCron', $level, $message, $aContext, SYS_SYS, 'timerevent.log');
\Bootstrap::registerMonolog('TimerEventCron', $level, $message, $aContext, SYS_SYS, 'processmaker.log');
} catch (\Exception $e) {
throw $e;
}
@@ -1733,4 +1733,3 @@ class TimerEvent
}
}
}

View File

@@ -685,9 +685,13 @@ class WebEntryEvent
}
//Route
if (isset($arrayData["ACT_UID"]) && $arrayData["ACT_UID"] != $arrayWebEntryEventData["ACT_UID"]) {
//Delete
$result = $task->deleteAllRoutesOfTask($arrayWebEntryEventData["PRJ_UID"], $arrayWebEntryEventData["WEE_WE_TAS_UID"], true);
if (array_key_exists('ACT_UID', $arrayData)) {
if ($arrayData['ACT_UID'] != $arrayWebEntryEventData['ACT_UID']) {
//Delete
$result = $task->deleteAllRoutesOfTask(
$arrayWebEntryEventData['PRJ_UID'], $arrayWebEntryEventData['WEE_WE_TAS_UID'], true
);
}
//Add
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
@@ -1001,4 +1005,3 @@ class WebEntryEvent
}
}
}

View File

@@ -351,7 +351,7 @@ class BpmnWorkflow extends Project\Bpmn
//$this->updateEventStartObjects($data["FLO_ELEMENT_ORIGIN"], $data["FLO_ELEMENT_DEST"]);
//WebEntry-Event - Update
$this->updateWebEntryEventByEvent($data["FLO_ELEMENT_ORIGIN"], array("ACT_UID" => $data["FLO_ELEMENT_DEST"]));
$this->__updateWebEntryEventByEvent($data['FLO_ELEMENT_ORIGIN'], ['ACT_UID' => $data['FLO_ELEMENT_DEST']]);
break;
case "bpmnEvent":
$messageEventRelationUid = $this->createMessageEventRelationByBpmnFlow(\BpmnFlowPeer::retrieveByPK($floUid));
@@ -401,7 +401,7 @@ class BpmnWorkflow extends Project\Bpmn
//$this->updateEventStartObjects($flowCurrent->getFloElementOrigin(), $flowCurrent->getFloElementDest());
//WebEntry-Event - Update
$this->updateWebEntryEventByEvent($flowCurrent->getFloElementOrigin(), array("ACT_UID" => $flowCurrent->getFloElementDest()));
$this->__updateWebEntryEventByEvent($flowCurrent->getFloElementOrigin(), ['ACT_UID' => $flowCurrent->getFloElementDest()]);
}
}
@@ -487,11 +487,9 @@ class BpmnWorkflow extends Project\Bpmn
$event = \BpmnEventPeer::retrieveByPK($flow->getFloElementOrigin());
if (!is_null($event) && $event->getEvnType() == "START" && $event->getEvnMarker() == "EMPTY") {
$activity = \BpmnActivityPeer::retrieveByPK($flow->getFloElementDest());
//Remove as start Task
if (!is_null($activity)) {
$this->wp->setStartTask($activity->getActUid(), false);
if (!is_null(\BpmnActivityPeer::retrieveByPK($flow->getFloElementDest()))) {
$this->wp->setStartTask($flow->getFloElementDest(), false);
}
}
}
@@ -500,7 +498,7 @@ class BpmnWorkflow extends Project\Bpmn
//WebEntry-Event - Update
if (is_null($bpmnFlow)) {
$this->updateWebEntryEventByEvent($flow->getFloElementOrigin(), array("WEE_STATUS" => "DISABLED"));
$this->__updateWebEntryEventByEvent($flow->getFloElementOrigin(), ['WEE_STATUS' => 'DISABLED']);
}
} elseif ($flow->getFloElementOriginType() == "bpmnActivity" &&
$flow->getFloElementDestType() == "bpmnEvent") {
@@ -509,11 +507,9 @@ class BpmnWorkflow extends Project\Bpmn
$event = \BpmnEventPeer::retrieveByPK($flow->getFloElementDest());
if (!is_null($event) && $event->getEvnType() == "END" && $event->getEvnMarker() == "EMPTY") {
$activity = \BpmnActivityPeer::retrieveByPK($flow->getFloElementOrigin());
//Remove as end Task
if (! is_null($activity)) {
$this->wp->setEndTask($activity->getActUid(), false);
if (!is_null(\BpmnActivityPeer::retrieveByPK($flow->getFloElementOrigin()))) {
$this->wp->setEndTask($flow->getFloElementOrigin(), false);
}
}
} else {
@@ -549,7 +545,7 @@ class BpmnWorkflow extends Project\Bpmn
// TODO Complete for other routes, activity->activity, activity->gateway and viceversa
}
public function updateEventActivityDefinition(\BpmnEvent $bpmnEvent, $flagStartTask)
private function __updateEventActivityDefinition(\BpmnEvent $bpmnEvent, $flagStartTask)
{
try {
if ($bpmnEvent->getEvnType() == "START") {
@@ -568,9 +564,10 @@ class BpmnWorkflow extends Project\Bpmn
//Setting as start Task
//or
//Remove as start Task
$bwp = new self;
if ($bwp->getActivity($arrayFlowData["FLO_ELEMENT_DEST"])) {
$this->wp->setStartTask($arrayFlowData["FLO_ELEMENT_DEST"], $flagStartTask);
if (!is_null(\BpmnActivityPeer::retrieveByPK($arrayFlowData['FLO_ELEMENT_DEST']))) {
$this->wp->setStartTask($arrayFlowData['FLO_ELEMENT_DEST'], $flagStartTask);
$this->__updateWebEntryEventByEvent($bpmnEvent->getEvnUid());
}
break;
}
@@ -673,7 +670,7 @@ class BpmnWorkflow extends Project\Bpmn
if ((isset($arrayEventData["EVN_TYPE"]) && $arrayEventData["EVN_TYPE"] != $bpmnEvent->getEvnType()) ||
(isset($arrayEventData["EVN_MARKER"]) && $arrayEventData["EVN_MARKER"] != $bpmnEvent->getEvnMarker())
) {
$this->updateEventActivityDefinition($bpmnEvent, false);
$this->__updateEventActivityDefinition($bpmnEvent, false);
$this->removeEventDefinition($bpmnEvent);
}
@@ -688,7 +685,7 @@ class BpmnWorkflow extends Project\Bpmn
try {
$bpmnEvent = \BpmnEventPeer::retrieveByPK($eventUid);
$this->updateEventActivityDefinition($bpmnEvent, false);
$this->__updateEventActivityDefinition($bpmnEvent, false);
$this->removeEventDefinition($bpmnEvent);
parent::removeEvent($eventUid);
@@ -1167,7 +1164,7 @@ class BpmnWorkflow extends Project\Bpmn
$this->mapBpmnEventToWorkflowRoutes($taskUid, $event["EVN_UID"]);
break;
case "EMPTY":
$this->updateEventActivityDefinition(\BpmnEventPeer::retrieveByPK($event["EVN_UID"]), true);
$this->__updateEventActivityDefinition(\BpmnEventPeer::retrieveByPK($event['EVN_UID']), true);
break;
}
break;
@@ -1973,7 +1970,7 @@ class BpmnWorkflow extends Project\Bpmn
$this->wp->setDisabled($value);
}
public function updateWebEntryEventByEvent($eventUid, array $arrayData)
private function __updateWebEntryEventByEvent($eventUid, array $arrayData = null)
{
try {
$bpmnEvent = \BpmnEventPeer::retrieveByPK($eventUid);
@@ -1987,7 +1984,11 @@ class BpmnWorkflow extends Project\Bpmn
$bpmn = \ProcessMaker\Project\Bpmn::load($bpmnEvent->getPrjUid());
$bpmnProject = $bpmn->getProject("object");
$arrayResult = $webEntryEvent->update($arrayWebEntryEventData["WEE_UID"], $bpmnProject->getPrjAuthor(), $arrayData);
$arrayResult = $webEntryEvent->update(
$arrayWebEntryEventData['WEE_UID'],
$bpmnProject->getPrjAuthor(),
(!is_null($arrayData))? $arrayData : $arrayWebEntryEventData
);
}
}
} catch (\Exception $e) {