Fix Funcionalidad de lanes y lanesets para project
This commit is contained in:
@@ -40,13 +40,18 @@ class BpmnActivity extends BaseBpmnActivity
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
if (isset($this->getLnsUid)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
if ($this->bound->getBouElement()) {
|
||||
$lane = BpmnLanePeer::retrieveByPK($this->bound->getBouElement());
|
||||
$laneset = BpmnLanesetPeer::retrieveByPK($this->bound->getBouElement());
|
||||
if (is_object($lane)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
} elseif (is_object($laneset)) {
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
}
|
||||
} else {
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,18 @@ class BpmnArtifact extends BaseBpmnArtifact
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
if (isset($this->getLnsUid)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
if ($this->bound->getBouElement()) {
|
||||
$lane = BpmnLanePeer::retrieveByPK($this->bound->getBouElement());
|
||||
$laneset = BpmnLanesetPeer::retrieveByPK($this->bound->getBouElement());
|
||||
if (is_object($lane)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
} elseif (is_object($laneset)) {
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
}
|
||||
} else {
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,18 @@ class BpmnData extends BaseBpmnData
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
if (isset($this->getLnsUid)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
if ($this->bound->getBouElement()) {
|
||||
$lane = BpmnLanePeer::retrieveByPK($this->bound->getBouElement());
|
||||
$laneset = BpmnLanesetPeer::retrieveByPK($this->bound->getBouElement());
|
||||
if (is_object($lane)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
} elseif (is_object($laneset)) {
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
}
|
||||
} else {
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,18 @@ class BpmnEvent extends BaseBpmnEvent
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
if (isset($this->getLnsUid)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
if ($this->bound->getBouElement()) {
|
||||
$lane = BpmnLanePeer::retrieveByPK($this->bound->getBouElement());
|
||||
$laneset = BpmnLanesetPeer::retrieveByPK($this->bound->getBouElement());
|
||||
if (is_object($lane)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
} elseif (is_object($laneset)) {
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
}
|
||||
} else {
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,18 @@ class BpmnGateway extends BaseBpmnGateway
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
if (isset($this->getLnsUid)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
if ($this->bound->getBouElement()) {
|
||||
$lane = BpmnLanePeer::retrieveByPK($this->bound->getBouElement());
|
||||
$laneset = BpmnLanesetPeer::retrieveByPK($this->bound->getBouElement());
|
||||
if (is_object($lane)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
} elseif (is_object($laneset)) {
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
}
|
||||
} else {
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class BpmnLane extends BaseBpmnLane {
|
||||
$rsCriteria->next();
|
||||
$row = $rsCriteria->getRow();
|
||||
$this->bound->setDiaUid($row["DIA_UID"]);
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,13 +40,18 @@ class BpmnParticipant extends BaseBpmnParticipant
|
||||
|
||||
if (is_object($process)) {
|
||||
$this->bound->setDiaUid($process->getDiaUid());
|
||||
if (isset($this->getLnsUid)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
$this->bound->setBouElement($this->getLnsUid());
|
||||
if ($this->bound->getBouElement()) {
|
||||
$lane = BpmnLanePeer::retrieveByPK($this->bound->getBouElement());
|
||||
$laneset = BpmnLanesetPeer::retrieveByPK($this->bound->getBouElement());
|
||||
if (is_object($lane)) {
|
||||
$this->bound->setBouContainer('bpmnLane');
|
||||
} elseif (is_object($laneset)) {
|
||||
$this->bound->setBouContainer('bpmnPool');
|
||||
}
|
||||
} else {
|
||||
$this->bound->setBouContainer('bpmnDiagram');
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
$this->bound->setBouElement($process->getDiaUid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -671,8 +671,6 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$diagram["lanes"] = $bwp->getLanes($configList);
|
||||
$diagram["data"] = $bwp->getDataCollection($configList);
|
||||
$diagram["participants"] = $bwp->getParticipants($configList);
|
||||
$diagram["lanesets"] = $bwp->getLanesets($configList);
|
||||
$diagram["lanes"] = $bwp->getLanes($configList);
|
||||
$project["diagrams"][] = $diagram;
|
||||
}
|
||||
|
||||
@@ -728,7 +726,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$diagram["events"] = isset($diagram["events"])? $diagram["events"]: array();
|
||||
$diagram["data"] = isset($diagram["data"])? $diagram["data"]: array();
|
||||
$diagram["participants"] = isset($diagram["participants"])? $diagram["participants"]: array();
|
||||
$diagram["lanesets"] = isset($diagram["lanesets"])? $diagram["lanesets"]: array();
|
||||
$diagram["laneset"] = isset($diagram["laneset"])? $diagram["laneset"]: array();
|
||||
$diagram["lanes"] = isset($diagram["lanes"])? $diagram["lanes"]: array();
|
||||
$result = array();
|
||||
|
||||
@@ -1062,7 +1060,7 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
$bwp->addLaneset($lanesetData);
|
||||
} elseif (! $bwp->isEquals($dataObject, $lanesetData)) {
|
||||
$bwp->updateLanseset($lanesetData["LNS_UID"], $lanesetData);
|
||||
$bwp->updateLaneset($lanesetData["LNS_UID"], $lanesetData);
|
||||
} else {
|
||||
Util\Logger::log("Update Laneset ({$lanesetData["LNS_UID"]}) Skipped - No changes required");
|
||||
}
|
||||
@@ -1107,12 +1105,12 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
$bwp->addLane($laneData);
|
||||
} elseif (! $bwp->isEquals($dataObject, $laneData)) {
|
||||
$bwp->updateLanse($laneData["LAN_UID"], $laneData);
|
||||
$bwp->updateLane($laneData["LAN_UID"], $laneData);
|
||||
} else {
|
||||
Util\Logger::log("Update Lane ({$laneData["LAN_UID"]}) Skipped - No changes required");
|
||||
}
|
||||
|
||||
$diagram["lane"][$i] = $laneData;
|
||||
$diagram["lanes"][$i] = $laneData;
|
||||
$whiteList[] = $laneData["LAN_UID"];
|
||||
}
|
||||
|
||||
|
||||
@@ -1083,6 +1083,22 @@ class Bpmn extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
public function updateLane($lanUid, $data)
|
||||
{
|
||||
try {
|
||||
self::log("Update Lane: $lanUid", "With data: ", $data);
|
||||
$lane = LanePeer::retrieveByPk($lanUid);
|
||||
|
||||
$lane->fromArray($data);
|
||||
$lane->save();
|
||||
|
||||
self::log("Update Lane Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function addLaneset($data)
|
||||
{
|
||||
// setting defaults
|
||||
@@ -1148,6 +1164,23 @@ class Bpmn extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
public function updateLaneset($lnsUid, $data)
|
||||
{
|
||||
try {
|
||||
self::log("Update Laneset: $lnsUid", "With data: ", $data);
|
||||
|
||||
$laneset = LanesetPeer::retrieveByPk($lnsUid);
|
||||
|
||||
$laneset->fromArray($data);
|
||||
$laneset->save();
|
||||
|
||||
self::log("Update Laneset Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function isModified($element, $uid, $newData)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
Reference in New Issue
Block a user