public function addEvent($data) { // setting defaults $processUid = $this->getProcess("object")->getProUid(); $data['EVN_UID'] = array_key_exists('EVN_UID', $data) ? $data['EVN_UID'] : Common::generateUID(); $data["PRO_UID"] = $processUid; try { self::log("Add Event with data: ", $data); $event = new Event(); $event->fromArray($data); $event->setPrjUid($this->project->getPrjUid()); $event->setProUid($processUid); $event->save(); self::log("Add Event Success!"); return $event->getEvnUid(); } catch (\Exception $e) { self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString()); throw $e; } }
/** * Declares an association between this object and a BpmnProject object. * * @param BpmnProject $v * @return void * @throws PropelException */ public function setBpmnProject($v) { if ($v === null) { $this->setPrjUid(NULL); } else { $this->setPrjUid($v->getPrjUid()); } $this->aBpmnProject = $v; }
* You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. */ $response = new StdClass(); $outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP; try { if(empty($_GET)){ $proUid = Bootstrap::json_decode( $_POST['data']); $_GET["pro_uid"] = $proUid->pro_uid; } if (\BpmnProject::exists($_GET["pro_uid"])) { $exporter = new ProcessMaker\Exporter\XmlExporter($_GET["pro_uid"]); $getProjectName = $exporter->truncateName($exporter->getProjectName(),false); $version = ProcessMaker\Util\Common::getLastVersion($outputDir . $getProjectName . "-*.pmx") + 1; $outputFilename = sprintf("%s-%s.%s", str_replace(" ","_",$getProjectName), $version, "pmx"); $outputFilename = $exporter->saveExport($outputDir.$outputFilename); } else { $oProcess = new Processes(); $proFields = $oProcess->serializeProcess($_GET["pro_uid"]); $result = $oProcess->saveSerializedProcess($proFields); $outputFilename = $result["FILENAME"]; rename($outputDir . $outputFilename . "tpm", $outputDir . $outputFilename); } $response->file_hash = base64_encode($outputFilename);