Refactoring of classes that where in workflow/engine/src , now all of them have a unique parent namespace \ProcessMaker
This commit is contained in:
717
workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php
Normal file
717
workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php
Normal file
File diff suppressed because it is too large
Load Diff
841
workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php
Normal file
841
workflow/engine/src/ProcessMaker/BusinessModel/CaseScheduler.php
Normal file
File diff suppressed because it is too large
Load Diff
382
workflow/engine/src/ProcessMaker/BusinessModel/CaseTracker.php
Normal file
382
workflow/engine/src/ProcessMaker/BusinessModel/CaseTracker.php
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1492
workflow/engine/src/ProcessMaker/BusinessModel/Cases.php
Normal file
1492
workflow/engine/src/ProcessMaker/BusinessModel/Cases.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,222 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel\Cases;
|
||||
|
||||
class InputDocument
|
||||
{
|
||||
/**
|
||||
* Get data of Cases InputDocument
|
||||
*
|
||||
* @param string $applicationUid
|
||||
* @param string $userUid
|
||||
*
|
||||
* return array Return an array with data of an InputDocument
|
||||
*/
|
||||
public function getCasesInputDocuments($applicationUid, $userUid)
|
||||
{
|
||||
try {
|
||||
$sApplicationUID = $applicationUid;
|
||||
$sUserUID = $userUid;
|
||||
\G::LoadClass('case');
|
||||
$oCase = new \Cases();
|
||||
$fields = $oCase->loadCase( $sApplicationUID );
|
||||
$sProcessUID = $fields['PRO_UID'];
|
||||
$sTaskUID = '';
|
||||
$oCaseRest = new \ProcessMaker\BusinessModel\Cases();
|
||||
$oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID);
|
||||
$result = array ();
|
||||
global $_DBArray;
|
||||
foreach ($_DBArray['inputDocuments'] as $key => $row) {
|
||||
if (isset( $row['DOC_VERSION'] )) {
|
||||
$docrow = array ();
|
||||
$docrow['app_doc_uid'] = $row['APP_DOC_UID'];
|
||||
$docrow['app_doc_filename'] = $row['APP_DOC_FILENAME'];
|
||||
$docrow['doc_uid'] = $row['DOC_UID'];
|
||||
$docrow['app_doc_version'] = $row['DOC_VERSION'];
|
||||
$docrow['app_doc_create_date'] = $row['CREATE_DATE'];
|
||||
$docrow['app_doc_create_user'] = $row['CREATED_BY'];
|
||||
$docrow['app_doc_type'] = $row['TYPE'];
|
||||
$docrow['app_doc_index'] = $row['APP_DOC_INDEX'];
|
||||
$docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK'];
|
||||
$result[] = $docrow;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of Cases InputDocument
|
||||
*
|
||||
* @param string $applicationUid
|
||||
* @param string $userUid
|
||||
* @param string $inputDocumentUid
|
||||
*
|
||||
* return array Return an array with data of an InputDocument
|
||||
*/
|
||||
public function getCasesInputDocument($applicationUid, $userUid, $inputDocumentUid)
|
||||
{
|
||||
try {
|
||||
$sApplicationUID = $applicationUid;
|
||||
$sUserUID = $userUid;
|
||||
\G::LoadClass('case');
|
||||
$oCase = new \Cases();
|
||||
$fields = $oCase->loadCase( $sApplicationUID );
|
||||
$sProcessUID = $fields['PRO_UID'];
|
||||
$sTaskUID = '';
|
||||
$oCaseRest = new \ProcessMaker\BusinessModel\Cases();
|
||||
$oCaseRest->getAllUploadedDocumentsCriteria( $sProcessUID, $sApplicationUID, $sTaskUID, $sUserUID );
|
||||
$result = array ();
|
||||
global $_DBArray;
|
||||
foreach ($_DBArray['inputDocuments'] as $key => $row) {
|
||||
if (isset( $row['DOC_VERSION'] )) {
|
||||
$docrow = array ();
|
||||
$docrow['app_doc_uid'] = $row['APP_DOC_UID'];
|
||||
$docrow['app_doc_filename'] = $row['APP_DOC_FILENAME'];
|
||||
$docrow['doc_uid'] = $row['DOC_UID'];
|
||||
$docrow['app_doc_version'] = $row['DOC_VERSION'];
|
||||
$docrow['app_doc_create_date'] = $row['CREATE_DATE'];
|
||||
$docrow['app_doc_create_user'] = $row['CREATED_BY'];
|
||||
$docrow['app_doc_type'] = $row['TYPE'];
|
||||
$docrow['app_doc_index'] = $row['APP_DOC_INDEX'];
|
||||
$docrow['app_doc_link'] = 'cases/' . $row['DOWNLOAD_LINK'];
|
||||
if ($docrow['app_doc_uid'] == $inputDocumentUid) {
|
||||
$result = $docrow;
|
||||
}
|
||||
}
|
||||
}
|
||||
$oResponse = json_decode(json_encode($result), false);
|
||||
return $oResponse;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete InputDocument
|
||||
*
|
||||
* @param string $inputDocumentUid
|
||||
*
|
||||
* return array Return an array with data of an InputDocument
|
||||
*/
|
||||
public function removeInputDocument($inputDocumentUid)
|
||||
{
|
||||
try {
|
||||
$oAppDocument = \AppDocumentPeer::retrieveByPK( $inputDocumentUid, 1 );
|
||||
if (is_null( $oAppDocument ) || $oAppDocument->getAppDocStatus() == 'DELETED') {
|
||||
throw (new \Exception('This input document with id: '.$inputDocumentUid.' doesn\'t exist!'));
|
||||
}
|
||||
\G::LoadClass('wsBase');
|
||||
$ws = new \wsBase();
|
||||
$ws->removeDocument($inputDocumentUid);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of Cases InputDocument
|
||||
*
|
||||
* @param string $applicationUid
|
||||
* @param string $taskUid
|
||||
* @param string $appDocComment
|
||||
* @param string $inputDocumentUid
|
||||
* @param string $userUid
|
||||
*
|
||||
* return array Return an array with data of an InputDocument
|
||||
*/
|
||||
public function addCasesInputDocument($applicationUid, $taskUid, $appDocComment, $inputDocumentUid, $userUid)
|
||||
{
|
||||
try {
|
||||
if ((isset( $_FILES['form'] )) && ($_FILES['form']['error'] != 0)) {
|
||||
$code = $_FILES['form']['error'];
|
||||
switch ($code) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' );
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' );
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' );
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' );
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' );
|
||||
break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' );
|
||||
break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' );
|
||||
break;
|
||||
default:
|
||||
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' );
|
||||
break;
|
||||
}
|
||||
\G::SendMessageText( $message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
\G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
\G::LoadClass("case");
|
||||
$appDocUid = \G::generateUniqueID();
|
||||
$docVersion = '';
|
||||
$appDocType = 'INPUT';
|
||||
$case = new \Cases();
|
||||
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
|
||||
$case->thisIsTheCurrentUser($applicationUid, $delIndex, $userUid, "REDIRECT", "casesListExtJs");
|
||||
//Load the fields
|
||||
$arrayField = $case->loadCase($applicationUid);
|
||||
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], \G::getSystemConstants());
|
||||
//Triggers
|
||||
$arrayTrigger = $case->loadTriggers($taskUid, "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
|
||||
//Add Input Document
|
||||
if (!$_FILES["form"]["error"]) {
|
||||
$_FILES["form"]["error"] = 0;
|
||||
}
|
||||
if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
|
||||
$appDocUid = $case->addInputDocument(
|
||||
$inputDocumentUid,
|
||||
$appDocUid,
|
||||
$docVersion,
|
||||
$appDocType,
|
||||
$appDocComment,
|
||||
'',
|
||||
$applicationUid,
|
||||
$delIndex,
|
||||
$taskUid,
|
||||
$userUid,
|
||||
"xmlform",
|
||||
$_FILES["form"]["name"],
|
||||
$_FILES["form"]["error"],
|
||||
$_FILES["form"]["tmp_name"]
|
||||
);
|
||||
}
|
||||
//Trigger - Execute after - Start
|
||||
$arrayField["APP_DATA"] = $case->executeTriggers(
|
||||
$taskUid,
|
||||
"INPUT_DOCUMENT",
|
||||
$inputDocumentUid,
|
||||
"AFTER",
|
||||
$arrayField["APP_DATA"]
|
||||
);
|
||||
//Trigger - Execute after - End
|
||||
|
||||
//Save data
|
||||
$arrayData = array();
|
||||
$arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"];
|
||||
//$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"];
|
||||
$arrayData["APP_DATA"] = $arrayField["APP_DATA"];
|
||||
$arrayData["DEL_INDEX"] = $delIndex;
|
||||
$arrayData["TAS_UID"] = $taskUid;
|
||||
$case->updateCase($applicationUid, $arrayData);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
185
workflow/engine/src/ProcessMaker/BusinessModel/Department.php
Normal file
185
workflow/engine/src/ProcessMaker/BusinessModel/Department.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \UsersPeer;
|
||||
use \DepartmentPeer;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Department
|
||||
{
|
||||
/**
|
||||
* Get list for Departments
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDepartments()
|
||||
{
|
||||
$oDepartment = new \Department();
|
||||
$aDepts = $oDepartment->getDepartments('');
|
||||
foreach ($aDepts as &$depData) {
|
||||
$depData['DEP_CHILDREN'] = $this->getChildren($depData);
|
||||
$depData = array_change_key_case($depData, CASE_LOWER);
|
||||
}
|
||||
return $aDepts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list for Departments
|
||||
* @var string $dep_uid. Uid for Department
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDepartment($dep_uid)
|
||||
{
|
||||
$dep_uid = Validator::depUid($dep_uid);
|
||||
$criteria = new \Criteria( 'workflow' );
|
||||
$criteria->add( DepartmentPeer::DEP_UID, $dep_uid, \Criteria::EQUAL );
|
||||
$con = \Propel::getConnection( DepartmentPeer::DATABASE_NAME );
|
||||
$objects = DepartmentPeer::doSelect( $criteria, $con );
|
||||
$oUsers = new \Users();
|
||||
|
||||
$node = array ();
|
||||
foreach ($objects as $oDepartment) {
|
||||
$node['DEP_UID'] = $oDepartment->getDepUid();
|
||||
$node['DEP_PARENT'] = $oDepartment->getDepParent();
|
||||
$node['DEP_TITLE'] = $oDepartment->getDepTitle();
|
||||
$node['DEP_STATUS'] = $oDepartment->getDepStatus();
|
||||
$node['DEP_MANAGER'] = $oDepartment->getDepManager();
|
||||
$node['DEP_LDAP_DN'] = $oDepartment->getDepLdapDn();
|
||||
$node['DEP_LAST'] = 0;
|
||||
|
||||
$manager = $oDepartment->getDepManager();
|
||||
if ($manager != '') {
|
||||
$UserUID = $oUsers->load($manager);
|
||||
$node['DEP_MANAGER_USERNAME'] = isset( $UserUID['USR_USERNAME'] ) ? $UserUID['USR_USERNAME'] : '';
|
||||
$node['DEP_MANAGER_FIRSTNAME'] = isset( $UserUID['USR_FIRSTNAME'] ) ? $UserUID['USR_FIRSTNAME'] : '';
|
||||
$node['DEP_MANAGER_LASTNAME'] = isset( $UserUID['USR_LASTNAME'] ) ? $UserUID['USR_LASTNAME'] : '';
|
||||
} else {
|
||||
$node['DEP_MANAGER_USERNAME'] = '';
|
||||
$node['DEP_MANAGER_FIRSTNAME'] = '';
|
||||
$node['DEP_MANAGER_LASTNAME'] = '';
|
||||
}
|
||||
|
||||
$criteriaCount = new \Criteria( 'workflow' );
|
||||
$criteriaCount->clearSelectColumns();
|
||||
$criteriaCount->addSelectColumn( 'COUNT(*)' );
|
||||
$criteriaCount->add( DepartmentPeer::DEP_PARENT, $oDepartment->getDepUid(), \Criteria::EQUAL );
|
||||
$rs = DepartmentPeer::doSelectRS( $criteriaCount );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$node['HAS_CHILDREN'] = $row[0];
|
||||
}
|
||||
$node = array_change_key_case($node, CASE_LOWER);
|
||||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Department
|
||||
* @var string $dep_data. Data for Process
|
||||
* @var string $create. Flag for create or update
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveDepartment($dep_data, $create = true)
|
||||
{
|
||||
Validator::isArray($dep_data, '$dep_data');
|
||||
Validator::isNotEmpty($dep_data, '$dep_data');
|
||||
Validator::isBoolean($create, '$create');
|
||||
|
||||
$dep_data = array_change_key_case($dep_data, CASE_UPPER);
|
||||
$oDepartment = new \Department();
|
||||
if (isset($dep_data['DEP_UID']) && $dep_data['DEP_UID'] != '') {
|
||||
Validator::depUid($dep_data['DEP_UID']);
|
||||
}
|
||||
if (isset($dep_data['DEP_PARENT']) && $dep_data['DEP_PARENT'] != '') {
|
||||
Validator::depUid($dep_data['DEP_PARENT'], 'dep_parent');
|
||||
}
|
||||
if (isset($dep_data['DEP_MANAGER']) && $dep_data['DEP_MANAGER'] != '') {
|
||||
Validator::usrUid($dep_data['DEP_MANAGER'], 'dep_manager');
|
||||
}
|
||||
if (isset($dep_data['DEP_STATUS'])) {
|
||||
Validator::depStatus($dep_data['DEP_STATUS']);
|
||||
}
|
||||
|
||||
if (!$create) {
|
||||
$dep_data['DEPO_TITLE'] = $dep_data['DEP_TITLE'];
|
||||
if (isset($dep_data['DEP_TITLE'])) {
|
||||
Validator::depTitle($dep_data['DEP_TITLE'], $dep_data['DEP_UID']);
|
||||
}
|
||||
$oDepartment->update($dep_data);
|
||||
$oDepartment->updateDepartmentManager($dep_data['DEP_UID']);
|
||||
} else {
|
||||
if (isset($dep_data['DEP_TITLE'])) {
|
||||
Validator::depTitle($dep_data['DEP_TITLE']);
|
||||
} else {
|
||||
throw (new \Exception("The field dep_title is required."));
|
||||
}
|
||||
$dep_uid = $oDepartment->create($dep_data);
|
||||
$response = $this->getDepartment($dep_uid);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete department
|
||||
* @var string $dep_uid. Uid for department
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function deleteDepartment($dep_uid)
|
||||
{
|
||||
$dep_uid = Validator::depUid($dep_uid);
|
||||
$dep_data = $this->getDepartment($dep_uid);
|
||||
if ($dep_data['has_children'] != 0) {
|
||||
throw (new \Exception("Can not delete the department, it has a children department."));
|
||||
}
|
||||
$oDepartment = new \Department();
|
||||
$oDepartment->remove($dep_uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Look for Children for department
|
||||
* @var array $dataDep. Data for child department
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getChildren ($dataDep)
|
||||
{
|
||||
$children = array();
|
||||
if ((int)$dataDep['HAS_CHILDREN'] > 0) {
|
||||
$oDepartment = new \Department();
|
||||
$aDepts = $oDepartment->getDepartments($dataDep['DEP_UID']);
|
||||
foreach ($aDepts as &$depData) {
|
||||
$depData['DEP_CHILDREN'] = $this->getChildren($depData);
|
||||
$depData = array_change_key_case($depData, CASE_LOWER);
|
||||
$children[] = $depData;
|
||||
}
|
||||
}
|
||||
return $children;
|
||||
}
|
||||
}
|
||||
|
||||
1000
workflow/engine/src/ProcessMaker/BusinessModel/DynaForm.php
Normal file
1000
workflow/engine/src/ProcessMaker/BusinessModel/DynaForm.php
Normal file
File diff suppressed because it is too large
Load Diff
258
workflow/engine/src/ProcessMaker/BusinessModel/Event.php
Normal file
258
workflow/engine/src/ProcessMaker/BusinessModel/Event.php
Normal file
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
/**
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
class Event
|
||||
{
|
||||
/**
|
||||
* Get list for Events
|
||||
* @var string $pro_uid. Uid for Process
|
||||
* @var string $filter.
|
||||
* @var string $evn_uid. Uid for Process
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getEvents($pro_uid, $filter = '', $evn_uid = '')
|
||||
{
|
||||
$pro_uid = $this->validateProUid($pro_uid);
|
||||
if ($evn_uid != '') {
|
||||
$evn_uid = $this->validateEvnUid($evn_uid);
|
||||
}
|
||||
|
||||
$oProcess = new \Process();
|
||||
if (!($oProcess->processExists($pro_uid))) {
|
||||
throw (new \Exception( 'This process does not exist!' ));
|
||||
}
|
||||
|
||||
$sDelimiter = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(\EventPeer::EVN_UID);
|
||||
$oCriteria->addSelectColumn(\EventPeer::EVN_ACTION);
|
||||
$oCriteria->addSelectColumn(\EventPeer::EVN_STATUS);
|
||||
$oCriteria->addSelectColumn(\EventPeer::EVN_WHEN_OCCURS);
|
||||
$oCriteria->addSelectColumn(\EventPeer::EVN_RELATED_TO);
|
||||
|
||||
$oCriteria->addAsColumn('EVN_DESCRIPTION', \ContentPeer::CON_VALUE);
|
||||
$aConditions = array();
|
||||
$aConditions[] = array(\EventPeer::EVN_UID, \ContentPeer::CON_ID );
|
||||
$aConditions[] = array(\ContentPeer::CON_CATEGORY, $sDelimiter . 'EVN_DESCRIPTION' . $sDelimiter );
|
||||
$aConditions[] = array(\ContentPeer::CON_LANG, $sDelimiter . SYS_LANG . $sDelimiter );
|
||||
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(\EventPeer::PRO_UID, $pro_uid);
|
||||
if ($evn_uid != '') {
|
||||
$oCriteria->add(\EventPeer::EVN_UID, $evn_uid);
|
||||
}
|
||||
|
||||
switch ($filter) {
|
||||
case 'message':
|
||||
$oCriteria->add(\EventPeer::EVN_ACTION, "SEND_MESSAGE");
|
||||
break;
|
||||
case 'conditional':
|
||||
$oCriteria->add(\EventPeer::EVN_ACTION, "EXECUTE_CONDITIONAL_TRIGGER");
|
||||
break;
|
||||
case 'multiple':
|
||||
$oCriteria->add(\EventPeer::EVN_ACTION, "EXECUTE_TRIGGER");
|
||||
break;
|
||||
}
|
||||
$eventsArray = array();
|
||||
|
||||
$oDataset = \EventPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$oEvent = new \Event();
|
||||
$aFields = $oEvent->load( $aRow['EVN_UID'] );
|
||||
$aRow = array_merge($aRow, $aFields);
|
||||
$eventsArray[] = array_change_key_case($aRow, CASE_LOWER);
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
if ($evn_uid != '' && empty($eventsArray)) {
|
||||
throw (new \Exception( 'This row does not exist!' ));
|
||||
} elseif ($evn_uid != '' && !empty($eventsArray)) {
|
||||
return current($eventsArray);
|
||||
}
|
||||
return $eventsArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Event Post Put
|
||||
*
|
||||
* @param string $evn_uid
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function saveEvents($pro_uid, $dataEvent, $create = false)
|
||||
{
|
||||
$pro_uid = $this->validateProUid($pro_uid);
|
||||
if (!$create) {
|
||||
$dataEvent['evn_uid'] = $this->validateEvnUid($dataEvent['evn_uid']);
|
||||
}
|
||||
|
||||
if ( ($pro_uid == '') || (count($dataEvent) == 0) ) {
|
||||
return false;
|
||||
}
|
||||
$dataEvent = array_change_key_case($dataEvent, CASE_UPPER);
|
||||
if ($dataEvent['EVN_RELATED_TO'] == 'SINGLE') {
|
||||
if (empty($dataEvent['TAS_UID'])) {
|
||||
throw (new \Exception('The field "tas_uid" is required!'));
|
||||
}
|
||||
$this->validateTasUid($dataEvent['TAS_UID']);
|
||||
} else {
|
||||
if (empty($dataEvent['EVN_TAS_UID_FROM'])) {
|
||||
throw (new \Exception('The field "evn_tas_uid_from" is required!'));
|
||||
}
|
||||
$this->validateTasUid($dataEvent['EVN_TAS_UID_FROM']);
|
||||
$dataEvent['TAS_UID'] = $dataEvent['EVN_TAS_UID_FROM'];
|
||||
|
||||
if (empty($dataEvent['EVN_TAS_UID_TO'])) {
|
||||
throw (new \Exception('The field "evn_tas_uid_to" is required!'));
|
||||
}
|
||||
$this->validateTasUid($dataEvent['EVN_TAS_UID_TO']);
|
||||
}
|
||||
|
||||
$this->validateTriUid($dataEvent['TRI_UID']);
|
||||
if ( $create && (isset($dataEvent['EVN_UID'])) ) {
|
||||
unset($dataEvent['EVN_UID']);
|
||||
}
|
||||
|
||||
$dataEvent['PRO_UID'] = $pro_uid;
|
||||
$oEvent = new \Event();
|
||||
|
||||
if ($create) {
|
||||
$uidNewEvent = $oEvent->create( $dataEvent );
|
||||
$dataEvent = $this->getEvents($pro_uid, '', $uidNewEvent);
|
||||
$dataEvent = array_change_key_case($dataEvent, CASE_LOWER);
|
||||
return $dataEvent;
|
||||
} else {
|
||||
$oEvent->update( $dataEvent );
|
||||
$uidNewEvent = $dataEvent['EVN_UID'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Event
|
||||
*
|
||||
* @param string $evn_uid
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteEvent($pro_uid, $evn_uid)
|
||||
{
|
||||
$pro_uid = $this->validateProUid($pro_uid);
|
||||
$evn_uid = $this->validateEvnUid($evn_uid);
|
||||
|
||||
try {
|
||||
$oEvent = new \Event();
|
||||
$oEvent->remove( $evn_uid );
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Process Uid
|
||||
* @var string $pro_uid. Uid for process
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function validateProUid ($pro_uid)
|
||||
{
|
||||
$pro_uid = trim($pro_uid);
|
||||
if ($pro_uid == '') {
|
||||
throw (new \Exception("The project with prj_uid: '', does not exist."));
|
||||
}
|
||||
$oProcess = new \Process();
|
||||
if (!($oProcess->processExists($pro_uid))) {
|
||||
throw (new \Exception("The project with prj_uid: '$pro_uid', does not exist."));
|
||||
}
|
||||
return $pro_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Event Uid
|
||||
* @var string $evn_uid. Uid for event
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function validateEvnUid ($evn_uid)
|
||||
{
|
||||
$evn_uid = trim($evn_uid);
|
||||
if ($evn_uid == '') {
|
||||
throw (new \Exception("The event with evn_uid: '', does not exist."));
|
||||
}
|
||||
$oEvent = new \Event();
|
||||
if (!($oEvent->Exists($evn_uid))) {
|
||||
throw (new \Exception("The event with evn_uid: '$evn_uid', does not exist."));
|
||||
}
|
||||
return $evn_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Task Uid
|
||||
* @var string $tas_uid. Uid for task
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function validateTasUid($tas_uid)
|
||||
{
|
||||
$tas_uid = trim($tas_uid);
|
||||
if ($tas_uid == '') {
|
||||
throw (new \Exception("The task with tas_uid: '', does not exist."));
|
||||
}
|
||||
$oTask = new \Task();
|
||||
if (!($oTask->taskExists($tas_uid))) {
|
||||
throw (new \Exception("The task with tas_uid: '$tas_uid', does not exist."));
|
||||
}
|
||||
return $tas_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Trigger Uid
|
||||
* @var string $tri_uid. Uid for trigger
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function validateTriUid($tri_uid)
|
||||
{
|
||||
$tri_uid = trim($tri_uid);
|
||||
if ($tri_uid == '') {
|
||||
throw (new \Exception("The trigger with tri_uid: '', does not exist."));
|
||||
}
|
||||
|
||||
$oTriggers = new \Triggers();
|
||||
if (!($oTriggers->TriggerExists($tri_uid))) {
|
||||
throw (new \Exception("The trigger with tri_uid: '', does not exist."));
|
||||
}
|
||||
|
||||
return $tri_uid;
|
||||
}
|
||||
}
|
||||
|
||||
546
workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php
Normal file
546
workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php
Normal file
File diff suppressed because it is too large
Load Diff
776
workflow/engine/src/ProcessMaker/BusinessModel/Group.php
Normal file
776
workflow/engine/src/ProcessMaker/BusinessModel/Group.php
Normal file
File diff suppressed because it is too large
Load Diff
206
workflow/engine/src/ProcessMaker/BusinessModel/Group/User.php
Normal file
206
workflow/engine/src/ProcessMaker/BusinessModel/Group/User.php
Normal file
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel\Group;
|
||||
|
||||
class User
|
||||
{
|
||||
private $arrayFieldDefinition = array(
|
||||
"GRP_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "groupUid"),
|
||||
"USR_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "userUid")
|
||||
);
|
||||
|
||||
private $formatFieldNameInUppercase = true;
|
||||
|
||||
private $arrayFieldNameForException = array();
|
||||
|
||||
/**
|
||||
* Constructor of the class
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
try {
|
||||
foreach ($this->arrayFieldDefinition as $key => $value) {
|
||||
$this->arrayFieldNameForException[$value["fieldNameAux"]] = $key;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the format of the fields name (uppercase, lowercase)
|
||||
*
|
||||
* @param bool $flag Value that set the format
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function setFormatFieldNameInUppercase($flag)
|
||||
{
|
||||
try {
|
||||
$this->formatFieldNameInUppercase = $flag;
|
||||
|
||||
$this->setArrayFieldNameForException($this->arrayFieldNameForException);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set exception messages for fields
|
||||
*
|
||||
* @param array $arrayData Data with the fields
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function setArrayFieldNameForException($arrayData)
|
||||
{
|
||||
try {
|
||||
foreach ($arrayData as $key => $value) {
|
||||
$this->arrayFieldNameForException[$key] = $this->getFieldNameByFormatFieldName($value);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the field according to the format
|
||||
*
|
||||
* @param string $fieldName Field name
|
||||
*
|
||||
* return string Return the field name according the format
|
||||
*/
|
||||
public function getFieldNameByFormatFieldName($fieldName)
|
||||
{
|
||||
try {
|
||||
return ($this->formatFieldNameInUppercase)? strtoupper($fieldName) : strtolower($fieldName);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if doesn't exist the User in Group
|
||||
*
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param string $userUid Unique id of User
|
||||
* @param string $fieldNameForException Field name for the exception
|
||||
*
|
||||
* return void Throw exception if doesn't exist the User in Group
|
||||
*/
|
||||
public function throwExceptionIfNotExistsGroupUser($groupUid, $userUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$obj = \GroupUserPeer::retrieveByPK($groupUid, $userUid);
|
||||
|
||||
if (!(is_object($obj) && get_class($obj) == "GroupUser")) {
|
||||
$msg = str_replace(array("{0}", "{1}"), array($fieldNameForException, $userUid), "The user with {0}: {1} is not assigned to the group");
|
||||
|
||||
throw (new \Exception($msg));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if exists the User in Group
|
||||
*
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param string $userUid Unique id of User
|
||||
* @param string $fieldNameForException Field name for the exception
|
||||
*
|
||||
* return void Throw exception if exists the User in Group
|
||||
*/
|
||||
public function throwExceptionIfExistsGroupUser($groupUid, $userUid, $fieldNameForException)
|
||||
{
|
||||
try {
|
||||
$obj = \GroupUserPeer::retrieveByPK($groupUid, $userUid);
|
||||
|
||||
if (is_object($obj) && get_class($obj) == "GroupUser") {
|
||||
$msg = str_replace(array("{0}", "{1}"), array($fieldNameForException, $userUid), "The user with {0}: {1} is already assigned to the group");
|
||||
|
||||
throw (new \Exception($msg));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign User to Group
|
||||
*
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the User assigned to Group
|
||||
*/
|
||||
public function create($groupUid, $arrayData)
|
||||
{
|
||||
try {
|
||||
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
|
||||
|
||||
unset($arrayData["GRP_UID"]);
|
||||
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$group = new \ProcessMaker\BusinessModel\Group();
|
||||
|
||||
$group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true);
|
||||
|
||||
$process->throwExceptionIfNotExistsUser($arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
$this->throwExceptionIfExistsGroupUser($groupUid, $arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
//Create
|
||||
$group = new \Groups();
|
||||
|
||||
$group->addUserToGroup($groupUid, $arrayData["USR_UID"]);
|
||||
|
||||
//Return
|
||||
$arrayData = array_merge(array("GRP_UID" => $groupUid), $arrayData);
|
||||
|
||||
if (!$this->formatFieldNameInUppercase) {
|
||||
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
|
||||
}
|
||||
|
||||
return $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unassign User of the Group
|
||||
*
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param string $userUid Unique id of User
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function delete($groupUid, $userUid)
|
||||
{
|
||||
try {
|
||||
//Verify data
|
||||
$process = new \ProcessMaker\BusinessModel\Process();
|
||||
$group = new \ProcessMaker\BusinessModel\Group();
|
||||
|
||||
$group->throwExceptionIfNotExistsGroup($groupUid, $this->arrayFieldNameForException["groupUid"]);
|
||||
|
||||
$process->throwExceptionIfNotExistsUser($userUid, $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
$this->throwExceptionIfNotExistsGroupUser($groupUid, $userUid, $this->arrayFieldNameForException["userUid"]);
|
||||
|
||||
//Delete
|
||||
$group = new \Groups();
|
||||
|
||||
$group->removeUserOfGroup($groupUid, $userUid);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
466
workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php
Normal file
466
workflow/engine/src/ProcessMaker/BusinessModel/InputDocument.php
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1803
workflow/engine/src/ProcessMaker/BusinessModel/Process.php
Normal file
1803
workflow/engine/src/ProcessMaker/BusinessModel/Process.php
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1033
workflow/engine/src/ProcessMaker/BusinessModel/ProcessSupervisor.php
Normal file
1033
workflow/engine/src/ProcessMaker/BusinessModel/ProcessSupervisor.php
Normal file
File diff suppressed because it is too large
Load Diff
392
workflow/engine/src/ProcessMaker/BusinessModel/ProjectUser.php
Normal file
392
workflow/engine/src/ProcessMaker/BusinessModel/ProjectUser.php
Normal file
File diff suppressed because it is too large
Load Diff
928
workflow/engine/src/ProcessMaker/BusinessModel/Step.php
Normal file
928
workflow/engine/src/ProcessMaker/BusinessModel/Step.php
Normal file
File diff suppressed because it is too large
Load Diff
454
workflow/engine/src/ProcessMaker/BusinessModel/Step/Trigger.php
Normal file
454
workflow/engine/src/ProcessMaker/BusinessModel/Step/Trigger.php
Normal file
File diff suppressed because it is too large
Load Diff
151
workflow/engine/src/ProcessMaker/BusinessModel/Subprocess.php
Normal file
151
workflow/engine/src/ProcessMaker/BusinessModel/Subprocess.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use \G;
|
||||
use \SubProcessPeer;
|
||||
|
||||
class Subprocess
|
||||
{
|
||||
/**
|
||||
* Get SubProcess in Process
|
||||
*
|
||||
* return object
|
||||
*/
|
||||
public function getSubprocesss($pro_uid, $tas_uid)
|
||||
{
|
||||
try {
|
||||
$pro_uid = $this->validateProUid($pro_uid);
|
||||
$tas_uid = $this->validateTasUid($tas_uid);
|
||||
|
||||
$oCriteria = new \Criteria('workflow');
|
||||
$del = \DBAdapter::getStringDelimiter();
|
||||
$oCriteria->add(SubProcessPeer::PRO_PARENT, $pro_uid);
|
||||
$oCriteria->add(SubProcessPeer::TAS_PARENT, $tas_uid);
|
||||
|
||||
$oCriteria->addAsColumn('CON_VALUE', 'C1.CON_VALUE', 'CON_TITLE');
|
||||
$oCriteria->addAlias("C1", 'CONTENT');
|
||||
$tasTitleConds = array();
|
||||
$tasTitleConds[] = array(SubProcessPeer::TAS_PARENT, 'C1.CON_ID' );
|
||||
$tasTitleConds[] = array('C1.CON_CATEGORY', $del . 'TAS_TITLE' . $del );
|
||||
$tasTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del );
|
||||
$oCriteria->addJoinMC($tasTitleConds, \Criteria::LEFT_JOIN);
|
||||
|
||||
$oDataset = SubProcessPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$aRow = array_change_key_case($aRow, CASE_LOWER);
|
||||
|
||||
$response['spr_uid'] = $aRow['sp_uid'];
|
||||
$response['spr_pro_parent'] = $aRow['pro_parent'];
|
||||
$response['spr_tas_parent'] = $aRow['tas_parent'];
|
||||
$response['spr_pro'] = $aRow['pro_uid'];
|
||||
$response['spr_tas'] = $aRow['tas_uid'];
|
||||
$response['spr_name'] = $aRow['con_value'];
|
||||
$response['spr_synchronous'] = $aRow['sp_synchronous'];
|
||||
$response['spr_variables_out'] = unserialize($aRow['sp_variables_out']);
|
||||
if ((int)$response['spr_synchronous'] === 1) {
|
||||
$response['spr_variables_in'] = unserialize($aRow['sp_variables_in']);
|
||||
}
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put SubProcess in Process
|
||||
* @var string $pro_uid. Uid for Process
|
||||
* @var string $spr_uid. Uid for SubProcess
|
||||
* @var array $spr_data. Data for SubProcess
|
||||
*
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function putSubprocesss($pro_uid, $tas_uid, $spr_data)
|
||||
{
|
||||
$pro_uid = $this->validateProUid($pro_uid);
|
||||
$tas_uid = $this->validateTasUid($tas_uid);
|
||||
if (empty($spr_data)) {
|
||||
throw (new \Exception("The request data is empty."));
|
||||
}
|
||||
if (isset($spr_data['spr_pro'])) {
|
||||
$spr_data['spr_pro'] = $this->validateProUid($spr_data['spr_pro']);
|
||||
}
|
||||
if (isset($spr_data['spr_tas'])) {
|
||||
$spr_data['spr_tas'] = $this->validateTasUid($spr_data['spr_tas']);
|
||||
}
|
||||
|
||||
$dataTemp = $this->getSubprocesss($pro_uid, $tas_uid);
|
||||
$spr_data = array_merge($dataTemp, $spr_data);
|
||||
$spr_data['spr_variables_in'] = (isset($spr_data['spr_variables_in'])) ? $spr_data['spr_variables_in'] : array();
|
||||
|
||||
$oSubProcess = new \SubProcess();
|
||||
$aData = array (
|
||||
'SP_UID' => $spr_data['spr_uid'],
|
||||
'PRO_UID' => $spr_data['spr_pro'],
|
||||
'TAS_UID' => $spr_data['spr_tas'],
|
||||
'PRO_PARENT' => $pro_uid,
|
||||
'TAS_PARENT' => $tas_uid,
|
||||
'SP_TYPE' => 'SIMPLE',
|
||||
'SP_SYNCHRONOUS' => (int)$spr_data['spr_synchronous'],
|
||||
'SP_SYNCHRONOUS_TYPE' => 'ALL',
|
||||
'SP_SYNCHRONOUS_WAIT' => 0,
|
||||
'SP_VARIABLES_OUT' => serialize( $spr_data['spr_variables_out'] ),
|
||||
'SP_VARIABLES_IN' => serialize( $spr_data['spr_variables_in'] ),
|
||||
'SP_GRID_IN' => ''
|
||||
);
|
||||
$oSubProcess->update( $aData );
|
||||
|
||||
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
|
||||
\Content::addContent( 'TAS_TITLE', '', $tas_uid, $lang, $spr_data['spr_name']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Process Uid
|
||||
* @var string $pro_uid. Uid for process
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function validateProUid ($pro_uid)
|
||||
{
|
||||
$pro_uid = trim($pro_uid);
|
||||
if ($pro_uid == '') {
|
||||
throw (new \Exception("The project with prj_uid: '', does not exist."));
|
||||
}
|
||||
$oProcess = new \Process();
|
||||
if (!($oProcess->processExists($pro_uid))) {
|
||||
throw (new \Exception("The project with prj_uid: '$pro_uid', does not exist."));
|
||||
}
|
||||
return $pro_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Task Uid
|
||||
* @var string $tas_uid. Uid for task
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function validateTasUid($tas_uid)
|
||||
{
|
||||
$tas_uid = trim($tas_uid);
|
||||
if ($tas_uid == '') {
|
||||
throw (new \Exception("The task with tas_uid: '', does not exist."));
|
||||
}
|
||||
$oTask = new \Task();
|
||||
if (!($oTask->taskExists($tas_uid))) {
|
||||
throw (new \Exception("The task with tas_uid: '$tas_uid', does not exist."));
|
||||
}
|
||||
return $tas_uid;
|
||||
}
|
||||
}
|
||||
|
||||
1112
workflow/engine/src/ProcessMaker/BusinessModel/Table.php
Normal file
1112
workflow/engine/src/ProcessMaker/BusinessModel/Table.php
Normal file
File diff suppressed because it is too large
Load Diff
2190
workflow/engine/src/ProcessMaker/BusinessModel/Task.php
Normal file
2190
workflow/engine/src/ProcessMaker/BusinessModel/Task.php
Normal file
File diff suppressed because it is too large
Load Diff
300
workflow/engine/src/ProcessMaker/BusinessModel/Trigger.php
Normal file
300
workflow/engine/src/ProcessMaker/BusinessModel/Trigger.php
Normal file
File diff suppressed because it is too large
Load Diff
964
workflow/engine/src/ProcessMaker/BusinessModel/TriggerWizard.php
Normal file
964
workflow/engine/src/ProcessMaker/BusinessModel/TriggerWizard.php
Normal file
File diff suppressed because it is too large
Load Diff
786
workflow/engine/src/ProcessMaker/BusinessModel/User.php
Normal file
786
workflow/engine/src/ProcessMaker/BusinessModel/User.php
Normal file
File diff suppressed because it is too large
Load Diff
335
workflow/engine/src/ProcessMaker/BusinessModel/Validator.php
Normal file
335
workflow/engine/src/ProcessMaker/BusinessModel/Validator.php
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user