Files
luos/workflow/engine/classes/model/Process.php

988 lines
37 KiB
PHP
Raw Normal View History

2010-12-02 23:34:41 +00:00
<?php
class Process extends BaseProcess
{
/**
* This value goes in the content table
*
* @var string
*/
protected $pro_title_content = '';
2013-12-17 11:14:36 -04:00
public $dir = 'ASC';
public $sort = 'PRO_TITLE';
/**
* Get the [Pro_title] column value.
*
* @return string
*/
2017-12-04 13:25:35 +00:00
public function getProTitleContent()
{
if ($this->getProUid() == '') {
2017-12-04 13:25:35 +00:00
throw (new Exception("Error in getProTitle, the PRO_UID can't be blank"));
}
2017-12-04 13:25:35 +00:00
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->pro_title_content = Content::load('PRO_TITLE', '', $this->getProUid(), $lang);
return $this->pro_title_content;
}
/**
* Set the [Pro_title] column value.
*
* @param string $v new value
* @return void
*/
2017-12-04 13:25:35 +00:00
public function setProTitleContent($v)
{
if ($this->getProUid() == '') {
2017-12-04 13:25:35 +00:00
throw (new Exception("Error in setProTitle, the PRO_UID can't be blank" . print_r(debug_backtrace(), 1)));
}
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
2017-12-04 13:25:35 +00:00
if ($v !== null && ! is_string($v)) {
$v = (string) $v;
}
2017-04-06 10:04:29 -04:00
if (in_array(ProcessPeer::PRO_TITLE, $this->modifiedColumns) || $v === '') {
$this->pro_title_content = $v;
2017-12-04 13:25:35 +00:00
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
2010-12-02 23:34:41 +00:00
2017-12-04 13:25:35 +00:00
$res = Content::addContent('PRO_TITLE', '', $this->getProUid(), $lang, $this->pro_title_content);
}
} // set()
2010-12-02 23:34:41 +00:00
/**
* This value goes in the content table
*
* @var string
*/
protected $pro_description_content = '';
2010-12-02 23:34:41 +00:00
/**
* Get the [Pro_description] column value.
*
* @return string
*/
2017-12-04 13:25:35 +00:00
public function getProDescriptionContent()
{
if ($this->getProUid() == '') {
2017-12-04 13:25:35 +00:00
throw (new Exception("Error in getProDescription, the PRO_UID can't be blank"));
}
2017-12-04 13:25:35 +00:00
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->pro_description_content = Content::load('PRO_DESCRIPTION', '', $this->getProUid(), $lang);
return $this->pro_description_content;
}
/**
* Set the [Pro_description] column value.
*
* @param string $v new value
* @return void
*/
2017-12-04 13:25:35 +00:00
public function setProDescriptionContent($v)
{
if ($this->getProUid() == '') {
2017-12-04 13:25:35 +00:00
throw (new Exception("Error in setProDescription, the PRO_UID can't be blank"));
}
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
2017-12-04 13:25:35 +00:00
if ($v !== null && ! is_string($v)) {
$v = (string) $v;
}
2010-12-02 23:34:41 +00:00
2017-04-06 10:04:29 -04:00
if (in_array(ProcessPeer::PRO_DESCRIPTION, $this->modifiedColumns) || $v === '') {
$this->pro_description_content = $v;
2017-12-04 13:25:35 +00:00
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
2010-12-02 23:34:41 +00:00
2017-12-04 13:25:35 +00:00
$res = Content::addContent('PRO_DESCRIPTION', '', $this->getProUid(), $lang, $this->pro_description_content);
}
} // set()
2010-12-02 23:34:41 +00:00
/**
* Creates the Process
*
* @param array $aData Fields with :
* $aData['PRO_UID'] the process id
* $aData['USR_UID'] the userid
* $aData['PRO_CATEGORY'] the id category
* @return string
*/
2010-12-02 23:34:41 +00:00
2017-12-04 13:25:35 +00:00
public function create($aData, $generateUid = true)
{
2017-12-04 13:25:35 +00:00
if (! isset($aData['USR_UID'])) {
throw (new PropelException('The process cannot be created. The USR_UID is empty.'));
}
2017-12-04 13:25:35 +00:00
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
try {
2013-12-17 11:14:36 -04:00
if ($generateUid) {
do {
$sNewProUid = G::generateUniqueID();
2017-12-04 13:25:35 +00:00
} while ($this->processExists($sNewProUid));
2013-12-17 11:14:36 -04:00
} else {
$sNewProUid = $aData['PRO_UID'];
if (!empty($aData['PRO_ID'])) {
$this->setProId($aData['PRO_ID']);
}
2013-12-17 11:14:36 -04:00
}
2017-12-04 13:25:35 +00:00
$this->setProUid($sNewProUid);
$this->setProTitle((isset($aData['PRO_TITLE'])) ? $aData['PRO_TITLE'] : 'Default Process Title');
$this->setProDescription((isset($aData['PRO_DESCRIPTION'])) ? $aData['PRO_DESCRIPTION'] : 'Default Process Description');
2017-12-04 13:25:35 +00:00
$this->setProParent($sNewProUid);
$this->setProTime(1);
$this->setProTimeunit('DAYS');
$this->setProStatus((isset($aData["PRO_STATUS"])) ? $aData["PRO_STATUS"] : 'ACTIVE');
2017-12-04 13:25:35 +00:00
$this->setProTypeDay('');
$this->setProType((isset($aData["PRO_TYPE"]))? $aData["PRO_TYPE"]: "NORMAL");
2017-12-04 13:25:35 +00:00
$this->setProAssignment('FALSE');
$this->setProShowMap('');
$this->setProShowMessage('');
$this->setProShowDelegate('');
$this->setProShowDynaform('');
$this->setProCategory((isset($aData["PRO_CATEGORY"]))? $aData["PRO_CATEGORY"]: "");
2021-07-08 09:40:57 -04:00
$this->setCategoryId((isset($aData["CATEGORY_ID"])) ? $aData["CATEGORY_ID"]: 0);
2017-12-04 13:25:35 +00:00
$this->setProSubCategory('');
$this->setProIndustry('');
$this->setProCreateDate(date("Y-m-d H:i:s"));
$this->setProCreateUser($aData['USR_UID']);
$this->setProHeight(5000);
$this->setProWidth(10000);
$this->setProTitleX(0);
$this->setProTitleY(0);
$this->setProItee(1);
$this->setProDynaforms(isset($aData['PRO_DYNAFORMS']) ? (is_array($aData['PRO_DYNAFORMS']) ? serialize($aData['PRO_DYNAFORMS']) : $aData['PRO_DYNAFORMS']) : '');
if ($this->validate()) {
$con->begin();
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_TITLE'])) {
$this->setProTitleContent($aData['PRO_TITLE']);
} else {
2017-12-04 13:25:35 +00:00
$this->setProTitleContent('Default Process Title');
}
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_DESCRIPTION'])) {
$this->setProDescriptionContent($aData['PRO_DESCRIPTION']);
} else {
2017-12-04 13:25:35 +00:00
$this->setProDescriptionContent('Default Process Description');
}
2017-04-07 16:28:20 -04:00
$res = $this->save();
$con->commit();
$this->memcachedDelete();
return $this->getProUid();
} else {
$msg = '';
foreach ($this->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
2017-12-04 13:25:35 +00:00
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
/**
* verify if Process row specified in [pro_id] exists.
*
* @param string $sProUid the uid of the Prolication
*/
2017-12-04 13:25:35 +00:00
public function processExists($ProUid)
{
2017-12-04 13:25:35 +00:00
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
try {
2017-12-04 13:25:35 +00:00
$oPro = ProcessPeer::retrieveByPk($ProUid);
if (is_object($oPro) && get_class($oPro) == 'Process') {
return true;
} else {
return false;
}
} catch (Exception $oError) {
throw ($oError);
}
2010-12-02 23:34:41 +00:00
}
/**
* Load the Process row specified in [pro_id] column value.
*
* @param string $ProUid the uid of the Prolication
* @return array $Fields the fields
*/
2017-12-04 13:25:35 +00:00
public function load($ProUid, $getAllLang = false)
{
2017-12-04 13:25:35 +00:00
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
try {
2017-12-04 13:25:35 +00:00
$oPro = ProcessPeer::retrieveByPk($ProUid);
if (is_object($oPro) && get_class($oPro) == 'Process') {
$aFields = $oPro->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
//optimized to avoid double and multiple execution of the same query
// $aFields['PRO_TITLE'] = $oPro->getProTitle();
// $aFields['PRO_DESCRIPTION'] = $oPro->getProDescription();
// $this->pro_title = $aFields['PRO_TITLE'];
// $this->pro_description = $aFields['PRO_DESCRIPTION'];
//the following code is to copy the parent in old process, when the parent was empty.
if ($oPro->getProParent() == '') {
2017-12-04 13:25:35 +00:00
$oPro->setProParent($oPro->getProUid());
$oPro->save();
}
//Get category Name, by default No category
2017-12-04 13:25:35 +00:00
$aFields['PRO_CATEGORY_LABEL'] = G::LoadTranslation("ID_PROCESS_NO_CATEGORY");
if ($aFields['PRO_CATEGORY'] != "") {
2017-12-04 13:25:35 +00:00
$oProCat = ProcessCategoryPeer::retrieveByPk($aFields['PRO_CATEGORY']);
if (is_object($oProCat) && get_class($oProCat) == 'ProcessCategory') {
$aFields['PRO_CATEGORY_LABEL'] = $oProCat->getCategoryName();
}
}
2017-12-04 13:25:35 +00:00
$aFields['PRO_DYNAFORMS'] = @unserialize($aFields['PRO_DYNAFORMS']);
//Check if is BPMN process
$aFields['PRO_BPMN'] = $this->isBpmnProcess($ProUid);
return $aFields;
} else {
2017-12-04 13:25:35 +00:00
throw (new Exception("The row '$ProUid' in table Process doesn't exist!"));
}
} catch (Exception $oError) {
throw ($oError);
}
}
2017-12-04 13:25:35 +00:00
public function getAll()
{
2017-12-04 13:25:35 +00:00
$oCriteria = new Criteria('workflow');
2017-12-04 13:25:35 +00:00
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_DESCRIPTION);
$oCriteria->addSelectColumn(ProcessPeer::PRO_PARENT);
$oCriteria->addSelectColumn(ProcessPeer::PRO_STATUS);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
$oCriteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
2017-12-04 13:25:35 +00:00
$oCriteria->add(ProcessPeer::PRO_UID, '', Criteria::NOT_EQUAL);
$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
//execute the query
2017-12-04 13:25:35 +00:00
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$processes = array();
$uids = array();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$processes[] = $row;
2017-12-04 13:25:35 +00:00
$uids[] = $processes[sizeof($processes) - 1]['PRO_UID'];
}
$oConf = new Configurations();
2017-12-04 13:25:35 +00:00
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
2013-12-17 11:14:36 -04:00
if ($this->dir=='ASC') {
2017-12-04 13:25:35 +00:00
usort($processes, array($this, "ordProcessAsc"));
2013-12-17 11:14:36 -04:00
} else {
2017-12-04 13:25:35 +00:00
usort($processes, array($this, "ordProcessDesc"));
}
return $processes;
}
/**
* Update the Prolication row
*
* @param array $aData
* @return variant
*
*/
2017-12-04 13:25:35 +00:00
public function update($aData)
{
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_DYNAFORMS']) && is_array($aData['PRO_DYNAFORMS'])) {
$aData['PRO_DYNAFORMS'] = @serialize($aData['PRO_DYNAFORMS']);
}
2010-12-02 23:34:41 +00:00
2017-12-04 13:25:35 +00:00
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
try {
$con->begin();
2017-12-04 13:25:35 +00:00
$oPro = ProcessPeer::retrieveByPK($aData['PRO_UID']);
if (is_object($oPro) && get_class($oPro) == 'Process') {
$oPro->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oPro->validate()) {
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_TITLE'])) {
$oPro->setProTitleContent($aData['PRO_TITLE']);
}
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_DESCRIPTION'])) {
$oPro->setProDescriptionContent($aData['PRO_DESCRIPTION']);
}
2020-09-08 16:20:28 -04:00
if (isset($aData['PRO_PROCESS_OWNER'])) {
$oPro->setProCreateUser($aData['PRO_PROCESS_OWNER']);
}
$res = $oPro->save();
$con->commit();
$this->memcachedDelete();
return $res;
} else {
$msg = '';
foreach ($oPro->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
2017-12-04 13:25:35 +00:00
throw (new Exception('The row cannot be updated!' . $msg));
}
} else {
$con->rollback();
2017-12-04 13:25:35 +00:00
throw (new Exception("The row '" . $aData['PRO_UID'] . "' in table Process doesn't exist!"));
}
} catch (Exception $oError) {
throw ($oError);
}
}
/**
* creates an Application row
*
* @param array $aData
* @return variant
*
*/
2017-12-04 13:25:35 +00:00
public function createRow($aData)
{
2017-12-04 13:25:35 +00:00
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
//$con->begin(); //does not allow dual BEGIN
2017-12-04 13:25:35 +00:00
$this->setProUid($aData['PRO_UID']);
$this->setProTitle((isset($aData['PRO_TITLE'])) ? $aData['PRO_TITLE'] : 'Default Process Title');
$this->setProDescription((isset($aData['PRO_DESCRIPTION'])) ? $aData['PRO_DESCRIPTION'] : 'Default Process Description');
2017-12-04 13:25:35 +00:00
$this->setProParent($aData['PRO_PARENT']);
$this->setProTime($aData['PRO_TIME']);
$this->setProTimeunit($aData['PRO_TIMEUNIT']);
$this->setProStatus($aData['PRO_STATUS']);
$this->setProTypeDay($aData['PRO_TYPE_DAY']);
$this->setProType($aData['PRO_TYPE']);
$this->setProAssignment($aData['PRO_ASSIGNMENT']);
$this->setProShowMap($aData['PRO_SHOW_MAP']);
$this->setProShowMessage($aData['PRO_SHOW_MESSAGE']);
$this->setProSubprocess(isset($aData['PRO_SUBPROCESS']) ? $aData['PRO_SUBPROCESS'] : '');
$this->setProTriDeleted(isset($aData['PRO_TRI_DELETED']) ? $aData['PRO_TRI_DELETED'] : '');
$this->setProTriCanceled(isset($aData['PRO_TRI_CANCELED']) ? $aData['PRO_TRI_CANCELED'] : '');
$this->setProTriPaused(isset($aData['PRO_TRI_PAUSED']) ? $aData['PRO_TRI_PAUSED'] : '');
$this->setProTriReassigned(isset($aData['PRO_TRI_REASSIGNED']) ? $aData['PRO_TRI_REASSIGNED'] : '');
$this->setProTriUnpaused(isset($aData['PRO_TRI_UNPAUSED']) ? $aData['PRO_TRI_UNPAUSED'] : '');
$this->setProShowDelegate($aData['PRO_SHOW_DELEGATE']);
$this->setProShowDynaform($aData['PRO_SHOW_DYNAFORM']);
$this->setProDerivationScreenTpl(isset($aData['PRO_DERIVATION_SCREEN_TPL']) ? $aData['PRO_DERIVATION_SCREEN_TPL'] : '');
// validate if the category exists
2017-12-04 13:25:35 +00:00
$criteria = new Criteria('workflow');
$criteria->add(ProcessCategoryPeer::CATEGORY_UID, $aData['PRO_CATEGORY']);
$ds = ProcessCategoryPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$ds->next();
// if it is not set, set value as empty "No Category"
if (! $ds->getRow()) {
$aData['PRO_CATEGORY'] = '';
}
2017-12-04 13:25:35 +00:00
$this->setProCategory($aData['PRO_CATEGORY']);
$this->setProSubCategory($aData['PRO_SUB_CATEGORY']);
$this->setProIndustry($aData['PRO_INDUSTRY']);
$this->setProCreateDate($aData['PRO_CREATE_DATE']);
$this->setProCreateUser($aData['PRO_CREATE_USER']);
$this->setProHeight($aData['PRO_HEIGHT']);
$this->setProWidth($aData['PRO_WIDTH']);
$this->setProTitleX($aData['PRO_TITLE_X']);
$this->setProTitleY($aData['PRO_TITLE_Y']);
$this->setProDynaforms(isset($aData['PRO_DYNAFORMS']) ? (is_array($aData['PRO_DYNAFORMS']) ? serialize($aData['PRO_DYNAFORMS']) : $aData['PRO_DYNAFORMS']) : '');
if ($this->validate()) {
$con->begin();
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_TITLE']) && trim($aData['PRO_TITLE']) != '') {
$this->setProTitleContent($aData['PRO_TITLE']);
} else {
2017-12-04 13:25:35 +00:00
$this->setProTitleContent('Default Process Title');
}
2017-12-04 13:25:35 +00:00
if (isset($aData['PRO_DESCRIPTION'])) {
$this->setProDescriptionContent($aData['PRO_DESCRIPTION']);
} else {
2017-12-04 13:25:35 +00:00
$this->setProDescriptionContent('Default Process Description');
}
2017-04-07 16:28:20 -04:00
$res = $this->save();
$con->commit();
$this->memcachedDelete();
return $this->getProUid();
} else {
$msg = '';
foreach ($this->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "<br/>";
}
2017-12-04 13:25:35 +00:00
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
}
2010-12-02 23:34:41 +00:00
}
/**
* Remove the Prolication document registry
*
* @param array $aData or string $ProUid
* @return string
*
*/
2017-12-04 13:25:35 +00:00
public function remove($ProUid)
{
2017-12-04 13:25:35 +00:00
if (is_array($ProUid)) {
$ProUid = (isset($ProUid['PRO_UID']) ? $ProUid['PRO_UID'] : '');
}
try {
2017-12-04 13:25:35 +00:00
$oPro = ProcessPeer::retrieveByPK($ProUid);
if (! is_null($oPro)) {
Content::removeContent('PRO_TITLE', '', $oPro->getProUid());
Content::removeContent('PRO_DESCRIPTION', '', $oPro->getProUid());
$this->memcachedDelete();
return $oPro->delete();
} else {
2017-12-04 13:25:35 +00:00
throw (new Exception("The row '$ProUid' in table Process doesn't exist!"));
}
} catch (Exception $oError) {
throw ($oError);
}
2010-12-02 23:34:41 +00:00
}
2017-12-04 13:25:35 +00:00
public function exists($ProUid)
{
2017-12-04 13:25:35 +00:00
$oPro = ProcessPeer::retrieveByPk($ProUid);
return (is_object($oPro) && get_class($oPro) == 'Process');
2010-12-02 23:34:41 +00:00
}
/**
* @param $proTitle
* @return bool
* @throws PropelException
*/
public static function existsByProTitle($proTitle)
{
$oCriteria = new Criteria("workflow");
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
$oCriteria->add(ProcessPeer::PRO_TITLE, $proTitle);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
return ($aRow) ? true : false;
2010-12-02 23:34:41 +00:00
}
public static function getByProTitle($proTitle)
{
2015-01-29 10:59:45 -04:00
$oCriteria = new Criteria("workflow");
$oCriteria->add(ProcessPeer::PRO_TITLE, $proTitle);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
2015-01-29 10:59:45 -04:00
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
return isset($aRow) ? $aRow : null;
2015-01-29 10:59:45 -04:00
}
public static function getNextTitle($proTitle)
{
2015-01-29 10:59:45 -04:00
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
$oCriteria->add(ProcessPeer::PRO_TITLE, $proTitle . '-%', Criteria::LIKE);
$oCriteria->addAscendingOrderByColumn(ProcessPeer::PRO_TITLE);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
2015-01-29 10:59:45 -04:00
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$data = array();
$may = 0;
while ($oDataset->next()) {
$row = $oDataset->getRow();
$number = explode("-", $row["PRO_TITLE"]);
2015-01-29 10:59:45 -04:00
$number = $number[count($number) - 1] + 0;
if ($number > $may) {
$may = $number;
}
$row["PRO_TITLE"] = $number;
2015-01-29 10:59:45 -04:00
$data[] = $row;
}
2015-01-30 14:41:26 -04:00
return $proTitle . "-" . ($may + 1);
2015-01-29 10:59:45 -04:00
}
2017-12-04 13:25:35 +00:00
public function getAllProcessesCount()
{
$c = $this->tmpCriteria;
$c->clearSelectColumns();
2017-12-04 13:25:35 +00:00
$c->addSelectColumn('COUNT(*)');
$oDataset = ProcessPeer::doSelectRS($c, Propel::getDbConnection('workflow_ro'));
$oDataset->next();
$aRow = $oDataset->getRow();
2017-12-04 13:25:35 +00:00
if (is_array($aRow)) {
return $aRow[0];
} else {
return 0;
}
}
2017-12-04 13:25:35 +00:00
public function getAllProcesses($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false, $userLogged = "")
{
2017-12-04 13:25:35 +00:00
require_once PATH_RBAC . "model/RbacUsers.php";
require_once "classes/model/ProcessCategory.php";
require_once "classes/model/Users.php";
$user = new RbacUsers();
2017-12-04 13:25:35 +00:00
$aProcesses = array();
$categories = array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
$oCriteria->addSelectColumn(ProcessPeer::PRO_TITLE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_DESCRIPTION);
$oCriteria->addSelectColumn(ProcessPeer::PRO_PARENT);
$oCriteria->addSelectColumn(ProcessPeer::PRO_STATUS);
PM-3193 "Prepare integration of new Valeo simplified designer in process list" SOLVED Issue: Prepare integration of new Valeo simplified designer in process list Cause: Nuevo requerimiento de funciones Solution: > Se a implementado "DESIGNER: New options in menu" para los plugins; para lo cual se define en el archivo principal del plugin, lo siguiente (ejemplo): public function setup() { ... $this->registerDesignerMenu(PATH_PLUGINS . "DemoDesignerMenu/classes/DesignerMenuDemoDesignerMenu.php"); ... } El archivo "DesignerMenuDemoDesignerMenu.php" es una clase donde se define las nuevas opciones para el "Menu New" y "Context Menu" > Se a implementado "DESIGNER: Edit process" para los plugins; en el listado de procesos (esto en DESIGNER) al hacer doble-click en un proceso, se inicia el modulo para la edicion del proceso, esto tambien puede ser customizado en el plugin, para lo cual se debera realizar lo siguiente: - Cambiar en la Base de Datos el valor del campo PROCESS.PRO_TYPE por un nuevo tipo: * Ejemplo: PRO_TYPE = 'CPF_STANDARD_TPL' - Registrar un archivo JavaScript para el plugin, esto se define en el archivo principal del plugin (ejemplo): public function setup() { ... $this->registerJavascript("processes/main", "DemoDesignerMenu/MyJavaScript.js"); ... } - En el archivo "MyJavaScript.js" se debe definir la siguiente funcion: function CPF_STANDARD_TPLDesignerGridRowDblClick(...) { ... } - Ejemplos de "PROCESS.PRO_TYPE" y la funcion "DesignerGridRowDblClick": * Ejemplo: PRO_TYPE = 'CPF-STANDARD-TPL' => function CPF_STANDARD_TPLDesignerGridRowDblClick(...) * Ejemplo: PRO_TYPE = 'CPF STANDARD TPL' => function CPF_STANDARD_TPLDesignerGridRowDblClick(...) > Se adjunta el plugin "DemoDesignerMenu-1.tar" como ejmplo
2015-09-21 10:18:44 -04:00
$oCriteria->addSelectColumn(ProcessPeer::PRO_TYPE);
2017-12-04 13:25:35 +00:00
$oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
$oCriteria->addSelectColumn(ProcessPeer::PRO_UPDATE_DATE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
$oCriteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
$oCriteria->addSelectColumn(ProcessPeer::PRO_TYPE_PROCESS);
2017-12-04 13:25:35 +00:00
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
2017-12-04 13:25:35 +00:00
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
2017-12-04 13:25:35 +00:00
$oCriteria->add(ProcessPeer::PRO_UID, '', Criteria::NOT_EQUAL);
$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
if ($reviewSubProcess) {
2017-12-04 13:25:35 +00:00
$oCriteria->add(ProcessPeer::PRO_SUBPROCESS, '1', Criteria::NOT_EQUAL);
}
2017-12-04 13:25:35 +00:00
if (isset($category)) {
$oCriteria->add(ProcessPeer::PRO_CATEGORY, $category, Criteria::EQUAL);
}
2010-12-02 23:34:41 +00:00
2017-12-04 13:25:35 +00:00
$oCriteria->addJoin(ProcessPeer::PRO_CREATE_USER, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(ProcessPeer::PRO_CATEGORY, ProcessCategoryPeer::CATEGORY_UID, Criteria::LEFT_JOIN);
if ($this->sort == "PRO_CREATE_DATE") {
if ($this->dir == "DESC") {
$oCriteria->addDescendingOrderByColumn(ProcessPeer::PRO_CREATE_DATE);
} else {
$oCriteria->addAscendingOrderByColumn(ProcessPeer::PRO_CREATE_DATE);
}
}
if ($userLogged != "") {
$oCriteria->add(
$oCriteria->getNewCriterion(ProcessPeer::PRO_TYPE_PROCESS, "PUBLIC", Criteria::EQUAL)->addOr(
2017-12-04 13:25:35 +00:00
$oCriteria->getNewCriterion(ProcessPeer::PRO_CREATE_USER, $userLogged, Criteria::EQUAL)
)
);
}
$this->tmpCriteria = clone $oCriteria;
//execute a query to obtain numbers, how many cases there are by process
if ($counters) {
$casesCnt = $this->getCasesCountInAllProcesses();
}
2010-12-02 23:34:41 +00:00
// getting bpmn projects
$c = new Criteria('workflow');
$c->addSelectColumn(BpmnProjectPeer::PRJ_UID);
2017-12-04 13:25:35 +00:00
$ds = ProcessPeer::doSelectRS($c, Propel::getDbConnection('workflow_ro'));
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$bpmnProjects = array();
while ($ds->next()) {
$row = $ds->getRow();
$bpmnProjects[] = $row['PRJ_UID'];
}
//execute the query
2017-12-04 13:25:35 +00:00
$oDataset = ProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$processes = array();
$uids = array();
while ($oDataset->next()) {
$row = $oDataset->getRow();
PM-3193 "Prepare integration of new Valeo simplified designer in process list" SOLVED Issue: Prepare integration of new Valeo simplified designer in process list Cause: Nuevo requerimiento de funciones Solution: > Se a implementado "DESIGNER: New options in menu" para los plugins; para lo cual se define en el archivo principal del plugin, lo siguiente (ejemplo): public function setup() { ... $this->registerDesignerMenu(PATH_PLUGINS . "DemoDesignerMenu/classes/DesignerMenuDemoDesignerMenu.php"); ... } El archivo "DesignerMenuDemoDesignerMenu.php" es una clase donde se define las nuevas opciones para el "Menu New" y "Context Menu" > Se a implementado "DESIGNER: Edit process" para los plugins; en el listado de procesos (esto en DESIGNER) al hacer doble-click en un proceso, se inicia el modulo para la edicion del proceso, esto tambien puede ser customizado en el plugin, para lo cual se debera realizar lo siguiente: - Cambiar en la Base de Datos el valor del campo PROCESS.PRO_TYPE por un nuevo tipo: * Ejemplo: PRO_TYPE = 'CPF_STANDARD_TPL' - Registrar un archivo JavaScript para el plugin, esto se define en el archivo principal del plugin (ejemplo): public function setup() { ... $this->registerJavascript("processes/main", "DemoDesignerMenu/MyJavaScript.js"); ... } - En el archivo "MyJavaScript.js" se debe definir la siguiente funcion: function CPF_STANDARD_TPLDesignerGridRowDblClick(...) { ... } - Ejemplos de "PROCESS.PRO_TYPE" y la funcion "DesignerGridRowDblClick": * Ejemplo: PRO_TYPE = 'CPF-STANDARD-TPL' => function CPF_STANDARD_TPLDesignerGridRowDblClick(...) * Ejemplo: PRO_TYPE = 'CPF STANDARD TPL' => function CPF_STANDARD_TPLDesignerGridRowDblClick(...) > Se adjunta el plugin "DemoDesignerMenu-1.tar" como ejmplo
2015-09-21 10:18:44 -04:00
$row["PROJECT_TYPE"] = ($row["PRO_TYPE"] == "NORMAL")? ((in_array($row["PRO_UID"], $bpmnProjects))? "bpmn" : "classic") : $row["PRO_TYPE"];
$processes[] = $row;
2017-12-04 13:25:35 +00:00
$uids[] = $processes[sizeof($processes) - 1]['PRO_UID'];
}
$oConf = new Configurations();
2017-12-04 13:25:35 +00:00
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
foreach ($processes as $process) {
$proTitle = isset($process['PRO_TITLE'])? $process['PRO_TITLE'] : '';
2016-08-24 13:55:38 -04:00
$proDescription = isset($process['PRO_DESCRIPTION']) ? htmlspecialchars($process['PRO_DESCRIPTION']) : '';
$process["PRO_TYPE_PROCESS"] = ($process["PRO_TYPE_PROCESS"] == "PUBLIC") ? G::LoadTranslation("ID_PUBLIC") : G::LoadTranslation("ID_PRIVATE");
// verify if the title is already set on the current language
2017-12-04 13:25:35 +00:00
if (trim($proTitle) == '') {
// if not, then load the record to generate content for current language
2017-12-04 13:25:35 +00:00
$proData = $this->load($process['PRO_UID']);
$proTitle = $proData['PRO_TITLE'];
2016-08-24 13:55:38 -04:00
$proDescription = htmlspecialchars($proData['PRO_DESCRIPTION']);
}
//filtering by $processName
2017-12-04 13:25:35 +00:00
if (isset($processName) && $processName != '' && stripos($proTitle, $processName) === false) {
continue;
}
if ($counters) {
$casesCountTotal = 0;
2017-12-04 13:25:35 +00:00
if (isset($casesCnt[$process['PRO_UID']])) {
foreach ($casesCnt[$process['PRO_UID']] as $item) {
$casesCountTotal += $item;
}
}
}
//get user format from configuration
2017-12-04 13:25:35 +00:00
$userOwner = isset($oConf->aConfig['format']) ? $oConf->aConfig['format'] : '';
$creationDateMask = isset($oConf->aConfig['dateFormat']) ? $oConf->aConfig['dateFormat'] : '';
if ($userOwner != '') {
2017-12-04 13:25:35 +00:00
$userOwner = str_replace('@userName', $process['USR_USERNAME'], $userOwner);
$userOwner = str_replace('@firstName', $process['USR_FIRSTNAME'], $userOwner);
$userOwner = str_replace('@lastName', $process['USR_LASTNAME'], $userOwner);
if ($userOwner == " ( )") {
$userOwner = '-';
}
} else {
$userOwner = $process['USR_FIRSTNAME'] . ' ' . $process['USR_LASTNAME'];
}
//get date format from configuration
if ($creationDateMask != '') {
2017-12-04 13:25:35 +00:00
list($date, $time) = explode(' ', $process['PRO_CREATE_DATE']);
list($y, $m, $d) = explode('-', $date);
list($h, $i, $s) = explode(':', $time);
2017-12-04 13:25:35 +00:00
$process['PRO_CREATE_DATE'] = date($creationDateMask, mktime($h, $i, $s, $m, $d, $y));
}
2017-12-04 13:25:35 +00:00
$process['PRO_CATEGORY_LABEL'] = trim($process['PRO_CATEGORY']) != '' ? $process['CATEGORY_NAME'] : '- ' . G::LoadTranslation('ID_PROCESS_NO_CATEGORY') . ' -';
$process['PRO_TITLE'] = $proTitle;
$process['PRO_DESCRIPTION'] = $proDescription;
$process['PRO_DEBUG'] = $process['PRO_DEBUG'];
2017-12-04 13:25:35 +00:00
$process['PRO_DEBUG_LABEL'] = ($process['PRO_DEBUG'] == "1") ? G::LoadTranslation('ID_ON') : G::LoadTranslation('ID_OFF');
$process['PRO_STATUS_LABEL'] = $process['PRO_STATUS'] == 'ACTIVE' ? G::LoadTranslation('ID_ACTIVE') : G::LoadTranslation('ID_INACTIVE');
$process['PRO_CREATE_USER_LABEL'] = $userOwner;
if ($counters) {
2017-12-04 13:25:35 +00:00
$process['CASES_COUNT_TO_DO'] = (isset($casesCnt[$process['PRO_UID']]['TO_DO']) ? $casesCnt[$process['PRO_UID']]['TO_DO'] : 0);
$process['CASES_COUNT_COMPLETED'] = (isset($casesCnt[$process['PRO_UID']]['COMPLETED']) ? $casesCnt[$process['PRO_UID']]['COMPLETED'] : 0);
$process['CASES_COUNT_DRAFT'] = (isset($casesCnt[$process['PRO_UID']]['DRAFT']) ? $casesCnt[$process['PRO_UID']]['DRAFT'] : 0);
$process['CASES_COUNT_CANCELLED'] = (isset($casesCnt[$process['PRO_UID']]['CANCELLED']) ? $casesCnt[$process['PRO_UID']]['CANCELLED'] : 0);
$process['CASES_COUNT'] = $casesCountTotal;
}
2017-12-04 13:25:35 +00:00
unset($process['PRO_CREATE_USER']);
$aProcesses[] = $process;
}
2017-12-04 13:25:35 +00:00
$memcache = PMmemcached::getSingleton(config("system.workspace"));
if (isset($memcache) && $memcache->enabled == 1) {
return $aProcesses;
}
if ($limit == '') {
2017-12-04 13:25:35 +00:00
$limit = count($aProcesses);
}
if ($this->sort != "PRO_CREATE_DATE") {
if ($this->dir == "ASC") {
usort($aProcesses, array($this, "ordProcessAsc"));
} else {
usort($aProcesses, array($this, "ordProcessDesc"));
}
}
return $aProcesses;
}
2017-12-04 13:25:35 +00:00
public function getCasesCountInAllProcesses()
{
/*SELECT PRO_UID, APP_STATUS, COUNT( * )
FROM APPLICATION
GROUP BY PRO_UID, APP_STATUS*/
require_once 'classes/model/Application.php';
2017-12-04 13:25:35 +00:00
$memcache = PMmemcached::getSingleton( config("system.workspace") );
$memkey = 'getCasesCountInAllProcesses';
2017-12-04 13:25:35 +00:00
if (($aProcesses = $memcache->get($memkey)) === false) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria->addSelectColumn(ApplicationPeer::APP_STATUS);
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
$oCriteria->addGroupByColumn(ApplicationPeer::PRO_UID);
$oCriteria->addGroupByColumn(ApplicationPeer::APP_STATUS);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aProcesses = array();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$aProcesses[$row['PRO_UID']][$row['APP_STATUS']] = $row['CNT'];
}
2017-12-04 13:25:35 +00:00
$memcache->set($memkey, $aProcesses, PMmemcached::ONE_HOUR);
}
return $aProcesses;
}
/**
* This returns the number of cases for the process.
* @param string $pro_uid
* @return integer
* @see ProcessMaker\Project\Bpmn::canRemove()
*/
public static function getCasesCountForProcess($pro_uid)
2014-04-25 11:38:53 -04:00
{
2017-12-04 13:25:35 +00:00
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS TOTAL_CASES');
$oCriteria->add(ApplicationPeer::PRO_UID, $pro_uid);
$oDataset = ApplicationPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
2014-04-25 11:38:53 -04:00
$oDataset->next();
$cases = $oDataset->getRow();
return (int)$cases['TOTAL_CASES'];
}
2017-12-04 13:25:35 +00:00
public function getAllProcessesByCategory()
{
2017-12-04 13:25:35 +00:00
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
$oCriteria->addGroupByColumn(ProcessPeer::PRO_CATEGORY);
$oDataSet = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aProc = array();
while ($oDataSet->next()) {
$row = $oDataSet->getRow();
$aProc[$row['PRO_CATEGORY']] = $row['CNT'];
}
return $aProc;
}
2019-01-30 09:11:57 -04:00
/**
* Get the trigger configured in committing an action in cases
*
* @param string $proUid
* @param string $action
*
* @return mixed
*
* @see Cases::getExecuteTriggerProcess()
* @link https://wiki.processmaker.com/3.2/Triggers#When_action_cases
*/
2017-12-04 13:25:35 +00:00
public function getTriggerWebBotProcess($proUid, $action)
{
2017-12-04 13:25:35 +00:00
require_once("classes/model/Triggers.php");
2019-01-30 09:11:57 -04:00
if (empty($proUid) || empty($action)){
return false;
}
2017-12-04 13:25:35 +00:00
$action = G::toUpper($action);
$arrayWebBotTrigger = [];
switch ($action) {
case 'CREATE':
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_CREATE;
break;
case 'OPEN':
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_OPEN;
break;
case 'DELETED':
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_DELETED;
break;
case 'CANCELED':
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_CANCELED;
break;
case 'PAUSED':
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_PAUSED;
break;
case 'REASSIGNED':
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_REASSIGNED;
break;
case "UNPAUSE":
2019-01-30 09:11:57 -04:00
$columnName = ProcessPeer::PRO_TRI_UNPAUSED;
break;
}
2019-01-30 09:11:57 -04:00
$criteria = new Criteria('workflow');
$criteria->addSelectColumn($columnName);
$criteria->addSelectColumn(TriggersPeer::TRI_UID);
$criteria->addSelectColumn(TriggersPeer::TRI_WEBBOT);
$criteria->addSelectColumn(TriggersPeer::TRI_TITLE);
$criteria->addJoin($columnName, TriggersPeer::TRI_UID, Criteria::LEFT_JOIN);
$criteria->add(ProcessPeer::PRO_UID, $proUid);
$criteria->add($columnName, '', Criteria::NOT_EQUAL);
$dataSet = ProcessPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if ($dataSet->next()) {
$arrayWebBotTrigger[] = $dataSet->getRow();
}
//Return
return $arrayWebBotTrigger;
}
2017-12-04 13:25:35 +00:00
public function memcachedDelete()
{
//Limit defined in processmaker/workflow/engine/templates/processes/main.js
$limit = 25;
$start = 0;
2017-10-10 12:33:25 -04:00
$memcache = PMmemcached::getSingleton( config("system.workspace") );
for ($start = 0; $start <= 50 - 1; $start ++) {
$memkey = "processList-allProcesses-" . ($start * $limit) . "-" . $limit;
$memkeyTotal = $memkey . "-total";
2017-12-04 13:25:35 +00:00
$r = $memcache->delete($memkey);
$r = $memcache->delete($memkeyTotal);
}
}
public function orderMemcache($dataMemcache, $start, $limit)
{
2017-12-04 13:25:35 +00:00
if ($this->dir=='ASC') {
usort($dataMemcache, array($this, "ordProcessAsc"));
} else {
usort($dataMemcache, array($this, "ordProcessDesc"));
}
$response = new stdclass();
$response->totalCount = count($dataMemcache);
$dataMemcache = array_splice($dataMemcache, $start, $limit);
$response->dataMemcache = $dataMemcache;
2017-12-04 13:25:35 +00:00
return $response;
}
2017-12-04 13:25:35 +00:00
public function ordProcessAsc($a, $b)
{
2017-12-04 13:25:35 +00:00
if (($this->sort) == '') {
$this->sort = 'PRO_TITLE';
}
if (strtolower($a[$this->sort]) > strtolower($b[$this->sort])) {
2013-12-17 11:14:36 -04:00
return 1;
} elseif (strtolower($a[$this->sort]) < strtolower($b[$this->sort])) {
2013-12-17 11:14:36 -04:00
return - 1;
} else {
return 0;
}
}
2017-12-04 13:25:35 +00:00
public function ordProcessDesc($a, $b)
{
2017-12-04 13:25:35 +00:00
if (($this->sort) == '') {
$this->sort = 'PRO_TITLE';
}
if (strtolower($a[$this->sort]) > strtolower($b[$this->sort])) {
return - 1;
} elseif (strtolower($a[$this->sort]) < strtolower($b[$this->sort])) {
return 1;
} else {
return 0;
}
}
2015-02-13 16:33:22 -04:00
/**
* Check is the Process is BPMN.
*
* @param string $ProUid the uid of the Prolication
* @return int 1 if is BPMN process or 0 if a Normal process
*/
2017-12-04 13:25:35 +00:00
public function isBpmnProcess($proUid)
{
$c = new Criteria("workflow");
$c->add(BpmnProcessPeer::PRJ_UID, $proUid);
$res = BpmnProcessPeer::doSelect($c);
if (sizeof($res) == 0) {
return 0;
} else {
return 1;
}
}
public function getAllConfiguredCurrencies()
{
2017-12-04 13:25:35 +00:00
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_UNIT_COST);
$oCriteria->setDistinct();
2017-12-04 13:25:35 +00:00
$oDataSet = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aProc = array();
while ($oDataSet->next()) {
$row = $oDataSet->getRow();
$aProc[$row['PRO_UNIT_COST']] = $row['PRO_UNIT_COST'];
}
return $aProc;
}
2020-04-14 17:41:04 +00:00
/**
* Delete all cases from a process
*
* @param string $proUid
* @throws Exception
*
* @see workflow/engine/methods/processes/processes_DeleteCases.php
* @link https://wiki.processmaker.com/3.2/Processes#Deleting_all_Cases_of_a_Process
*/
public function deleteProcessCases($proUid)
{
try {
2020-04-14 17:41:04 +00:00
// Initialize variables
$casesInstance = new Cases();
// Get all cases from th process
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(ApplicationPeer::APP_UID);
$criteria->add(ApplicationPeer::PRO_UID, $proUid);
$dataSet = ApplicationPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro'));
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataSet->next()) {
$row = $dataSet->getRow();
// Delete/Remove the case
$casesInstance->removeCase($row['APP_UID']);
}
2017-12-04 13:25:35 +00:00
} catch (Exception $e) {
throw ($e);
}
}
/**
* Load a process object by PRO_ID
*
* @param type $id
* @return Process
*/
2017-12-04 13:25:35 +00:00
public static function loadById($id)
{
$criteria = new Criteria(ProcessPeer::DATABASE_NAME);
$criteria->add(ProcessPeer::PRO_ID, $id);
return ProcessPeer::doSelect($criteria)[0];
}
2011-02-10 17:01:21 +00:00
}