本文整理汇总了PHP中AppDelegationPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP AppDelegationPeer::retrieveByPK方法的具体用法?PHP AppDelegationPeer::retrieveByPK怎么用?PHP AppDelegationPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppDelegationPeer
的用法示例。
在下文中一共展示了AppDelegationPeer::retrieveByPK方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: throwExceptionIfNotExistsCase
/**
* Verify if does not exist the Case in table APPLICATION
*
* @param string $applicationUid Unique id of Case
* @param string $delIndex Delegation index
* @param string $fieldNameForException Field name for the exception
*
* return void Throw exception if does not exist the Case in table APPLICATION
*/
public function throwExceptionIfNotExistsCase($applicationUid, $delIndex, $fieldNameForException)
{
try {
$obj = \ApplicationPeer::retrieveByPK($applicationUid);
$flag = is_null($obj);
if (!$flag && $delIndex > 0) {
$obj = \AppDelegationPeer::retrieveByPK($applicationUid, $delIndex);
$flag = is_null($obj);
}
if ($flag) {
throw new \Exception(\G::LoadTranslation("ID_CASE_DOES_NOT_EXIST2", array($fieldNameForException, $applicationUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
示例2: doDerivation
//.........这里部分代码省略.........
case 'PARALLEL-BY-EVALUATION':
$this->case->closeAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex );
$iNewThreadIndex = $this->case->newAppThread( $currentDelegation['APP_UID'], $iNewDelIndex, $iAppThreadIndex );
$this->case->updateAppDelegation( $currentDelegation['APP_UID'], $iNewDelIndex, $iNewThreadIndex );
break;
default:
$this->case->updateAppThread( $currentDelegation['APP_UID'], $iAppThreadIndex, $iNewDelIndex );
break;
} //en switch
//if there are subprocess to create
if (isset( $aSP )) {
//Create the new case in the sub-process
// set the initial date to null the time its created
$aNewCase = $this->case->startCase( $aSP['TAS_UID'], $aSP['USR_UID'], true, $appFields);
$taskNextDel = TaskPeer::retrieveByPK($aSP["TAS_UID"]); //Sub-Process
//Copy case variables to sub-process case
$aFields = unserialize( $aSP['SP_VARIABLES_OUT'] );
$aNewFields = array ();
$aOldFields = $this->case->loadCase( $aNewCase['APPLICATION'] );
foreach ($aFields as $sOriginField => $sTargetField) {
$sOriginField = trim($sOriginField, " @#%?$=");
$sTargetField = trim($sTargetField, " @#%?$=");
$aNewFields[$sTargetField] = isset( $appFields['APP_DATA'][$sOriginField] ) ? $appFields['APP_DATA'][$sOriginField] : '';
}
$aOldFields['APP_DATA'] = array_merge( $aOldFields['APP_DATA'], $aNewFields );
$aOldFields['APP_STATUS'] = 'TO_DO';
示例3: remove
public function remove($sApplicationUID, $iDelegationIndex)
{
$oConnection = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
try {
$oConnection->begin();
$oApp = AppDelegationPeer::retrieveByPK($sApplicationUID, $iDelegationIndex);
if (is_object($oApp) && get_class($oApp) == 'AppDelegation') {
$result = $oApp->delete();
}
$oConnection->commit();
return $result;
} catch (Exception $e) {
$oConnection->rollback();
throw $e;
}
}
示例4: throwExceptionIfInputDocumentNotExistsInSteps
/**
* Verify if not exists input Document in Steps
*
* @param string $applicationUid Unique id of Case
* @param string $delIndex Delegataion index
* @param string $appDocumentUid
*
* return void Throw exception if not exists input Document in Steps
*/
public function throwExceptionIfInputDocumentNotExistsInSteps($applicacionUid, $delIndex, $appDocumentUid)
{
try {
//Verify Case
$appDelegation = \AppDelegationPeer::retrieveByPK($applicacionUid, $delIndex);
if (is_null($appDelegation)) {
throw new \Exception(\G::LoadTranslation("ID_CASE_DEL_INDEX_DOES_NOT_EXIST", array("app_uid", $applicacionUid, "del_index", $delIndex)));
}
$taskUid = $appDelegation->getTasUid();
//Verify Steps
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\AppDocumentPeer::DOC_UID);
$criteria->add(\AppDocumentPeer::APP_DOC_UID, $appDocumentUid, \Criteria::EQUAL);
$criteria->add(\AppDocumentPeer::APP_UID, $applicacionUid, \Criteria::EQUAL);
$criteria->add(\AppDocumentPeer::APP_DOC_TYPE, "INPUT", \Criteria::EQUAL);
$rsCriteria = \AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$inputDocumentUid = $row["DOC_UID"];
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\StepPeer::STEP_UID);
$criteria->add(\StepPeer::TAS_UID, $taskUid, \Criteria::EQUAL);
$criteria->add(\StepPeer::STEP_TYPE_OBJ, "INPUT_DOCUMENT", \Criteria::EQUAL);
$criteria->add(\StepPeer::STEP_UID_OBJ, $inputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if (!$rsCriteria->next()) {
throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_DOCUMENT_DOES_NOT_EXIST", array($appDocumentUid)));
}
}
} catch (\Exception $e) {
throw $e;
}
}
示例5: throwExceptionIfOuputDocumentNotExistsInSteps
/**
* Verify if not exists OuputDocument in Steps
*
* @param string $applicationUid Unique id of Case
* @param string $delIndex Delegation index
* @param string $outDocUuid
*
* return void Throw exception if not exists OuputDocument in Steps
*/
public function throwExceptionIfOuputDocumentNotExistsInSteps($applicacionUid, $delIndex, $outputDocumentUid)
{
try {
//Verify data
$appDelegation = \AppDelegationPeer::retrieveByPK($applicacionUid, $delIndex);
$taskUid = $appDelegation->getTasUid();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\StepPeer::STEP_UID);
$criteria->add(\StepPeer::TAS_UID, $taskUid, \Criteria::EQUAL);
$criteria->add(\StepPeer::STEP_TYPE_OBJ, "OUTPUT_DOCUMENT", \Criteria::EQUAL);
$criteria->add(\StepPeer::STEP_UID_OBJ, $outputDocumentUid, \Criteria::EQUAL);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if (!$rsCriteria->next()) {
throw new \Exception(\G::LoadTranslation("ID_CASES_OUTPUT_DOES_NOT_EXIST", array($outputDocumentUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
示例6: function
$filters['sort'] = G::toUpper($filters['sort']);
$columnsList = $listpeer::getFieldNames(BasePeer::TYPE_FIELDNAME);
if (!in_array($filters['sort'], $columnsList)) {
$filters['sort'] = '';
}
$filters['dir'] = G::toUpper($filters['dir']);
if (!($filters['dir'] == 'DESC' || $filters['dir'] == 'ASC')) {
$filters['dir'] = 'DESC';
}
$result = $list->loadList($userUid, $filters, function (array $record) {
try {
if (isset($record["DEL_PREVIOUS_USR_UID"])) {
if ($record["DEL_PREVIOUS_USR_UID"] == "") {
$appDelegation = AppDelegationPeer::retrieveByPK($record["APP_UID"], $record["DEL_INDEX"]);
if (!is_null($appDelegation)) {
$appDelegationPrevious = AppDelegationPeer::retrieveByPK($record["APP_UID"], $appDelegation->getDelPrevious());
if (!is_null($appDelegationPrevious)) {
$taskPrevious = TaskPeer::retrieveByPK($appDelegationPrevious->getTasUid());
if (!is_null($taskPrevious)) {
switch ($taskPrevious->getTasType()) {
case "SCRIPT-TASK":
$record["DEL_PREVIOUS_USR_UID"] = $taskPrevious->getTasType();
break;
}
}
}
}
}
$record["PREVIOUS_USR_UID"] = $record["DEL_PREVIOUS_USR_UID"];
$record["PREVIOUS_USR_USERNAME"] = $record["DEL_PREVIOUS_USR_USERNAME"];
$record["PREVIOUS_USR_FIRSTNAME"] = $record["DEL_PREVIOUS_USR_FIRSTNAME"];
示例7: get
/**
* Implementation for 'GET' method for Rest API
*
* @param mixed $appUid, $delIndex Primary key
*
* @return array $result Returns array within multiple records or a single record depending if
* a single selection was requested passing id(s) as param
*/
protected function get($appUid = null, $delIndex = null)
{
$result = array();
try {
$noArguments = true;
$argumentList = func_get_args();
foreach ($argumentList as $arg) {
if (!is_null($arg)) {
$noArguments = false;
}
}
if ($noArguments) {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(AppDelegationPeer::APP_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
$criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$criteria->addSelectColumn(AppDelegationPeer::USR_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_TYPE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_THREAD);
$criteria->addSelectColumn(AppDelegationPeer::DEL_THREAD_STATUS);
$criteria->addSelectColumn(AppDelegationPeer::DEL_PRIORITY);
$criteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
$criteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
$criteria->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
$criteria->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
$criteria->addSelectColumn(AppDelegationPeer::DEL_STARTED);
$criteria->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
$criteria->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
$criteria->addSelectColumn(AppDelegationPeer::DEL_DATA);
$criteria->addSelectColumn(AppDelegationPeer::APP_OVERDUE_PERCENTAGE);
$dataset = AppEventPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataset->next()) {
$result[] = $dataset->getRow();
}
} else {
$record = AppDelegationPeer::retrieveByPK($appUid, $delIndex);
if ($record) {
$result = $record->toArray(BasePeer::TYPE_FIELDNAME);
} else {
$paramValues = "";
foreach ($argumentList as $arg) {
$paramValues .= strlen($paramValues) ? ', ' : '';
if (!is_null($arg)) {
$paramValues .= "{$arg}";
} else {
$paramValues .= "NULL";
}
}
throw new RestException(417, "table AppDelegation ({$paramValues})");
}
}
} catch (RestException $e) {
throw new RestException($e->getCode(), $e->getMessage());
} catch (Exception $e) {
throw new RestException(412, $e->getMessage());
}
return $result;
}
示例8: sendNotifications
public function sendNotifications($taskUid, $arrayTask, $arrayData, $applicationUid, $delIndex, $from = '')
{
try {
$arrayApplicationData = $this->loadCase($applicationUid);
$arrayData['APP_NUMBER'] = $arrayApplicationData['APP_NUMBER'];
if (!class_exists('System')) {
G::LoadClass('system');
}
$aConfiguration = System::getEmailConfiguration();
$msgError = "";
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
$msgError = "The default configuration wasn't defined";
$aConfiguration['MESS_ENGINE'] = '';
}
//Send derivation notification - Start
$oTask = new Task();
$aTaskInfo = $oTask->load($taskUid);
if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] != 'TRUE') {
return false;
}
$from = G::buildFrom($aConfiguration, $from);
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
$sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $arrayData);
} else {
$sSubject = G::LoadTranslation('ID_MESSAGE_SUBJECT_DERIVATION');
}
//erik: new behaviour for messages
G::loadClass('configuration');
$oConf = new Configurations();
$oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
$conf = $oConf->aConfig;
$pathEmail = PATH_DATA_SITE . "mailTemplates" . PATH_SEP . $aTaskInfo["PRO_UID"] . PATH_SEP;
$swtplDefault = 0;
$sBody = null;
if (isset($conf["TAS_DEF_MESSAGE_TYPE"]) && isset($conf["TAS_DEF_MESSAGE_TEMPLATE"]) && $conf["TAS_DEF_MESSAGE_TYPE"] == "template" && $conf["TAS_DEF_MESSAGE_TEMPLATE"] != "") {
if ($conf["TAS_DEF_MESSAGE_TEMPLATE"] == "alert_message.html") {
$swtplDefault = 1;
}
$fileTemplate = $pathEmail . $conf["TAS_DEF_MESSAGE_TEMPLATE"];
if (!file_exists($fileTemplate)) {
$tempale = PATH_CORE . "templates" . PATH_SEP . "mails" . PATH_SEP . "alert_message.html";
$copied = @copy($tempale, $fileTemplate);
if ($copied) {
$dataTemplate = array("prf_filename" => $conf["TAS_DEF_MESSAGE_TEMPLATE"], "prf_path" => $fileTemplate, "pro_uid" => $aTaskInfo["PRO_UID"], "usr_uid" => "00000000000000000000000000000001", "prf_uid" => G::generateUniqueID(), "prf_type" => "file", "prf_create_date" => date("Y-m-d H:i:s"));
$filesManager = new ProcessMaker\BusinessModel\FilesManager();
$filesManager->addProcessFilesManagerInDb($dataTemplate);
} else {
throw new Exception("Template file \"{$fileTemplate}\" does not exist.");
}
}
$sBody = file_get_contents($fileTemplate);
} else {
$sBody = nl2br($aTaskInfo['TAS_DEF_MESSAGE']);
}
G::LoadClass("tasks");
G::LoadClass("groups");
G::LoadClass("spool");
$task = new Tasks();
$group = new Groups();
$oUser = new Users();
foreach ($arrayTask as $aTask) {
$sTo = null;
$sCc = null;
if (isset($aTask['DEL_INDEX'])) {
$arrayData2 = $arrayData;
$appDelegation = AppDelegationPeer::retrieveByPK($applicationUid, $aTask['DEL_INDEX']);
if (!is_null($appDelegation)) {
$arrayData2['TAS_TITLE'] = Content::load('TAS_TITLE', '', $appDelegation->getTasUid(), SYS_LANG);
$arrayData2['DEL_TASK_DUE_DATE'] = $appDelegation->getDelTaskDueDate();
}
} else {
$arrayData2 = $arrayData;
}
if (isset($aTask['USR_UID']) && !empty($aTask['USR_UID'])) {
$user = new \ProcessMaker\BusinessModel\User();
$arrayUserData = $user->getUser($aTask['USR_UID'], true);
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2, trim($arrayUserData['USR_TIME_ZONE']) != '' ? trim($arrayUserData['USR_TIME_ZONE']) : \ProcessMaker\Util\System::getTimeZone());
} else {
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2);
}
$sBody2 = G::replaceDataGridField($sBody, $arrayData2, false);
switch ($aTask["TAS_ASSIGN_TYPE"]) {
case "SELF_SERVICE":
if ($swtplDefault == 1) {
G::verifyPath($pathEmail, true);
//Create if it does not exist
$fileTemplate = $pathEmail . G::LoadTranslation('ID_UNASSIGNED_MESSAGE');
if (!file_exists($fileTemplate) && file_exists(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'))) {
@copy(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'), $fileTemplate);
}
$sBody2 = G::replaceDataField(file_get_contents($fileTemplate), $arrayData2);
}
if (isset($aTask["TAS_UID"]) && !empty($aTask["TAS_UID"])) {
$arrayTaskUser = array();
$arrayAux1 = $task->getGroupsOfTask($aTask["TAS_UID"], 1);
foreach ($arrayAux1 as $arrayGroup) {
$arrayAux2 = $group->getUsersOfGroup($arrayGroup["GRP_UID"]);
foreach ($arrayAux2 as $arrayUser) {
$arrayTaskUser[] = $arrayUser["USR_UID"];
}
//.........这里部分代码省略.........