Adicion de ARTIFACTS en PROJECTS
This commit is contained in:
@@ -67,6 +67,10 @@ class Bpmn extends Handler
|
||||
"gateway" => array("BOU_ELEMENT", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION", "BOU_SIZE_IDENTICAL", "BOU_UID",
|
||||
"DIA_UID", "ELEMENT_UID", "PRJ_UID", "PRO_UID"
|
||||
),
|
||||
"artifact" => array(
|
||||
"PRJ_UID", "PRO_UID", "BOU_ELEMENT", "BOU_ELEMENT_TYPE", "BOU_REL_POSITION",
|
||||
"BOU_SIZE_IDENTICAL", "DIA_UID", "BOU_UID", "ELEMENT_UID"
|
||||
),
|
||||
"flow" => array("PRJ_UID", "DIA_UID", "FLO_ELEMENT_DEST_PORT", "FLO_ELEMENT_ORIGIN_PORT")
|
||||
);
|
||||
|
||||
@@ -682,18 +686,83 @@ class Bpmn extends Handler
|
||||
|
||||
public function addArtifact($data)
|
||||
{
|
||||
// TODO: Implement update() method.
|
||||
// setting defaults
|
||||
$data['ART_UID'] = array_key_exists('ART_UID', $data) ? $data['ART_UID'] : Common::generateUID();
|
||||
try {
|
||||
self::log("Add Artifact with data: ", $data);
|
||||
$artifact = new Artifact();
|
||||
$artifact->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
$artifact->setPrjUid($this->getUid());
|
||||
$artifact->setProUid($this->getProcess("object")->getProUid());
|
||||
$artifact->save();
|
||||
self::log("Add Artifact Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $artifact->getArtUid();
|
||||
}
|
||||
|
||||
public function getArtifact($artUid)
|
||||
public function updateArtifact($artUid, $data)
|
||||
{
|
||||
// TODO: Implement update() method.
|
||||
try {
|
||||
self::log("Update Artifact: $artUid", "With data: ", $data);
|
||||
|
||||
$artifact = ArtifactPeer::retrieveByPk($artUid);
|
||||
|
||||
$artifact->fromArray($data);
|
||||
$artifact->save();
|
||||
|
||||
self::log("Update Artifact Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function getArtifacts()
|
||||
public function getArtifact($artUid, $retType = 'array')
|
||||
{
|
||||
// TODO: Implement update() method.
|
||||
return array();
|
||||
$artifact = ArtifactPeer::retrieveByPK($artUid);
|
||||
|
||||
if ($retType != "object" && ! empty($artifact)) {
|
||||
$artifact = $artifact->toArray();
|
||||
$artifact = self::filterArrayKeys($artifact, self::$excludeFields["artifact"]);
|
||||
}
|
||||
|
||||
return $artifact;
|
||||
}
|
||||
|
||||
public function getArtifacts($start = null, $limit = null, $filter = '', $changeCaseTo = CASE_UPPER)
|
||||
{
|
||||
if (is_array($start)) {
|
||||
extract($start);
|
||||
}
|
||||
|
||||
$filter = $changeCaseTo != CASE_UPPER ? array_map("strtolower", self::$excludeFields["artifact"]) : self::$excludeFields["artifact"];
|
||||
|
||||
return self::filterCollectionArrayKeys(
|
||||
Artifact::getAll($this->getUid(), $start, $limit, $filter, $changeCaseTo),
|
||||
$filter
|
||||
);
|
||||
}
|
||||
|
||||
public function removeArtifact($artUid)
|
||||
{
|
||||
try {
|
||||
self::log("Remove Artifact: $artUid");
|
||||
|
||||
$artifact = ArtifactPeer::retrieveByPK($artUid);
|
||||
$artifact->delete();
|
||||
|
||||
// remove related object (flows)
|
||||
Flow::removeAllRelated($artUid);
|
||||
|
||||
self::log("Remove Artifact Success!");
|
||||
} catch (\Exception $e) {
|
||||
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function addLane($data)
|
||||
|
||||
Reference in New Issue
Block a user