예제 #1
0
    public function addData($data)
    {
        // setting defaults
        $processUid = $this->getProcess("object")->getProUid();

        $data['DATA_UID'] = array_key_exists('DAT_UID', $data) ? $data['DAT_UID'] : Common::generateUID();
        $data["PRO_UID"] = $processUid;

        try {
            self::log("Add BpmnData with data: ", $data);
            $bpmnData = new \BpmnData();
            $bpmnData->fromArray($data, BasePeer::TYPE_FIELDNAME);
            $bpmnData->setPrjUid($this->getUid());
            $bpmnData->setProUid($this->getProcess("object")->getProUid());
            $bpmnData->save();
            self::log("Add BpmnData Success!");
        } catch (\Exception $e) {
            self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
            throw $e;
        }

        return $bpmnData->getDatUid();
    }