BPMN Project Import chages to import alll workflow properties data

This commit is contained in:
Erik Amaru Ortiz
2014-03-27 19:11:11 -04:00
parent edaf69ec0e
commit 00fd862056
8 changed files with 187 additions and 34 deletions

View File

@@ -111,9 +111,21 @@ class Bpmn extends Handler
self::log("Create Project Success!");
}
public function update()
public function update($data)
{
if (array_key_exists("PRJ_CREATE_DATE", $data) && empty($data["PRJ_CREATE_DATE"])) {
unset($data["PRJ_UPDATE_DATE"]);
}
if (array_key_exists("PRJ_UPDATE_DATE", $data)) {
unset($data["PRJ_UPDATE_DATE"]);
}
$this->project->fromArray($data, BasePeer::TYPE_FIELDNAME);
$this->project->setPrjUpdateDate(date("Y-m-d H:i:s"));
$this->project->save();
$this->updateDiagram(array("DIA_NAME" => $data["PRJ_NAME"]));
}
public function remove()
@@ -209,6 +221,19 @@ class Bpmn extends Handler
$this->diagram->save();
}
public function updateDiagram($data)
{
if (empty($this->project)) {
throw new \Exception("Error: There is not an initialized project.");
}
if (! is_object($this->diagram)) {
$this->getDiagram();
}
$this->diagram->fromArray($data, BasePeer::TYPE_FIELDNAME);
$this->diagram->save();
}
public function getDiagram($retType = "array")
{
if (empty($this->diagram)) {