コード例 #1
0
ファイル: Exporter.php プロジェクト: emildev35/processmaker
 /**
  * Builds Project Data Structure
  *
  * @return array
  */
 protected function buildData()
 {
     $data = array();
     $data["metadata"] = $this->getMetadata();
     $data["metadata"]["workspace"] = defined("SYS_SYS") ? SYS_SYS : "Unknown";
     $data["metadata"]["name"] = $this->getProjectName();
     $data["metadata"]["uid"] = $this->getProjectUid();
     $bpmnStruct["ACTIVITY"] = \BpmnActivity::getAll($this->prjUid);
     $bpmnStruct["ARTIFACT"] = \BpmnArtifact::getAll($this->prjUid);
     $bpmnStruct["BOUND"] = \BpmnBound::getAll($this->prjUid);
     $bpmnStruct["DATA"] = \BpmnData::getAll($this->prjUid);
     $bpmnStruct["DIAGRAM"] = \BpmnDiagram::getAll($this->prjUid);
     $bpmnStruct["DOCUMENTATION"] = array();
     $bpmnStruct["EVENT"] = \BpmnEvent::getAll($this->prjUid);
     $bpmnStruct["EXTENSION"] = array();
     $bpmnStruct["FLOW"] = \BpmnFlow::getAll($this->prjUid, null, null, "", CASE_UPPER, false);
     $bpmnStruct["GATEWAY"] = \BpmnGateway::getAll($this->prjUid);
     $bpmnStruct["LANE"] = \BpmnLane::getAll($this->prjUid);
     $bpmnStruct["LANESET"] = \BpmnLaneset::getAll($this->prjUid);
     $bpmnStruct["PARTICIPANT"] = \BpmnParticipant::getAll($this->prjUid);
     $bpmnStruct["PROCESS"] = \BpmnProcess::getAll($this->prjUid);
     $bpmnStruct["PROJECT"] = array(\BpmnProjectPeer::retrieveByPK($this->prjUid)->toArray());
     $workflow = new \ProcessMaker\Project\Workflow();
     list($workflowData, $workflowFile) = $workflow->getData($this->prjUid);
     $data["bpmn-definition"] = $bpmnStruct;
     $data["workflow-definition"] = $workflowData;
     $data["workflow-files"] = $workflowFile;
     return $data;
 }
コード例 #2
0
ファイル: Bpmn.php プロジェクト: emildev35/processmaker
 public function addProcess($data = array())
 {
     if (empty($this->diagram)) {
         throw new \Exception("Error: There is not an initialized diagram.");
     }
     // setting defaults
     $data['PRO_UID'] = array_key_exists('PRO_UID', $data) ? $data['PRO_UID'] : Common::generateUID();
     $data['PRO_NAME'] = array_key_exists('PRO_NAME', $data) ? $data['PRO_NAME'] : $this->diagram->getDiaName();
     $this->process = new Process();
     $this->process->fromArray($data, BasePeer::TYPE_FIELDNAME);
     $this->process->setPrjUid($this->project->getPrjUid());
     $this->process->setDiaUid($this->getDiagram("object")->getDiaUid());
     $this->process->save();
 }
コード例 #3
0
 /**
  * Method called to associate a BpmnDiagram object to this object
  * through the BpmnDiagram foreign key attribute
  *
  * @param      BpmnDiagram $l BpmnDiagram
  * @return     void
  * @throws     PropelException
  */
 public function addBpmnDiagram(BpmnDiagram $l)
 {
     $this->collBpmnDiagrams[] = $l;
     $l->setBpmnProject($this);
 }
コード例 #4
0
 /**
  * Declares an association between this object and a BpmnDiagram object.
  *
  * @param      BpmnDiagram $v
  * @return     void
  * @throws     PropelException
  */
 public function setBpmnDiagram($v)
 {
     if ($v === null) {
         $this->setDiaUid('');
     } else {
         $this->setDiaUid($v->getDiaUid());
     }
     $this->aBpmnDiagram = $v;
 }