private function loadProcesses() { $dbProcesses = Ezer_PropelStepPeer::retrieveActiveProcesses(); foreach ($dbProcesses as $dbProcess) { $process = new Ezer_DbBusinessProcess($dbProcess); $this->processes[$process->getId()] = $process; } }
/** * The returned array will contain objects of the default type or * objects that inherit from the default. * * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function populateObjects(PDOStatement $stmt) { $typePosition = Ezer_PropelStepPeer::translateFieldName(Ezer_PropelStepPeer::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM); $results = array(); // populate the object(s) while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $key = Ezer_PropelStepPeer::getPrimaryKeyHashFromRow($row, 0); if (null !== ($obj = Ezer_PropelStepPeer::getInstanceFromPool($key))) { // We no longer rehydrate the object, since this can cause data loss. // See http://propel.phpdb.org/trac/ticket/509 // $obj->hydrate($row, 0, true); // rehydrate $results[] = $obj; } else { $type = $row[$typePosition]; $obj = self::newStep($type); $obj->hydrate($row); $results[] = $obj; Ezer_PropelStepPeer::addInstanceToPool($obj, $key); } // if key exists } $stmt->closeCursor(); return $results; }
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('Complex Async Set'); // insert case $variables = array('title' => 'New Title', 'counter' => array('title' => 'Original Title', 'counts' => array(array('start' => 6, 'stop' => 10), array('start' => 9, 'stop' => 12)))); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('Foreach Parallel'); // insert case $variables = array('message' => 'Hi there', 'users' => array('Tan-Tan', 'Johnathan', 'Uri')); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('Else If'); // insert case $variables = array('condition' => 5, 'expression' => 'false', 'beginMessage' => 'Hi Tan-Tan', 'endMessage' => 'Bye Tan-Tan', 'ifMessage' => 'Condition is TRUE', 'elseMessage' => 'All condition are FALSE', 'elseIfMessage1' => 'Else 1 condition is TRUE', 'elseIfMessage2' => 'Else 2 condition is TRUE'); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('Foreach Serial'); // insert case $variables = array('message' => 'Hi there', 'users' => array('Tan-Tan', 'Johnathan', 'Uri')); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(Ezer_PropelStepPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(Ezer_PropelStepPeer::DATABASE_NAME); $criteria->add(Ezer_PropelStepPeer::ID, $pks, Criteria::IN); $objs = Ezer_PropelStepPeer::doSelect($criteria, $con); } return $objs; }
/** * @param Ezer_PropelStepFilter $filter * @param Ezer_PropelPager $pager * @return array<stdClass> steps */ public function listAction(Ezer_PropelStepFilter $filter = null, Ezer_PropelPager $pager = null) { $objects = $filter->execute($pager); $columns = Ezer_PropelStepPeer::getFieldNames(BasePeer::TYPE_STUDLYPHPNAME); return $this->toArray($objects, $columns); }
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('HelloWorld'); // insert case $variables = array('hello' => 'Hi Tan-Tan', 'bye' => 'Goodbye Johnathan'); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
/** * This function performs the validation work for complex object models. * * In addition to checking the current object, all related objects will * also be validated. If all pass then <code>true</code> is returned; otherwise * an aggreagated array of ValidationFailed objects will be returned. * * @param array $columns Array of column names to validate. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise. */ protected function doValidate($columns = null) { if (!$this->alreadyInValidation) { $this->alreadyInValidation = true; $retval = null; $failureMap = array(); if (($retval = Ezer_PropelStepPeer::doValidate($this, $columns)) !== true) { $failureMap = array_merge($failureMap, $retval); } $this->alreadyInValidation = false; } return !empty($failureMap) ? $failureMap : true; }
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('Flow'); // insert case $variables = array('count' => 5, 'left1' => 'Left1', 'left2' => 'Left2', 'right1' => 'Right1', 'right2' => 'Right2', 'before' => 'Before', 'after' => 'After'); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
<?php error_reporting(E_ALL); require_once 'bootstrap.php'; $config = Ezer_Config::createFromPath('config.xml'); Propel::setConfiguration($config->database->toArray()); Propel::initialize(); // find process $process = Ezer_PropelStepPeer::retrieveProcessByName('Complex Count'); // insert case $variables = array('title' => 'New Title', 'counter' => array('title' => 'Original Title', 'counts' => array(array('start' => 6, 'stop' => 10), array('start' => 9, 'stop' => 12)))); $case = new Ezer_PropelCase(); $case->setProcessId($process->getId()); $case->setPriority(1); $case->setStatus(Ezer_IntStep::STEP_STATUS_ACTIVE); $case->setVariables($variables); $case->save();
public function listAction() { $objects = Ezer_PropelStepPeer::retrieveActiveProcesses(); $columns = Ezer_PropelStepPeer::getFieldNames(BasePeer::TYPE_STUDLYPHPNAME); return $this->toArray($objects, $columns); }
/** * @return array<Ezer_IntStep> */ public function getSteps() { return Ezer_PropelStepPeer::retrieveChildSteps($this->getId(), $this->getType()); }