本文整理汇总了PHP中TaskPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP TaskPeer::retrieveByPK方法的具体用法?PHP TaskPeer::retrieveByPK怎么用?PHP TaskPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskPeer
的用法示例。
在下文中一共展示了TaskPeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculateDueDate
public function calculateDueDate($sNextTasParam)
{
//Get Task properties
$task = TaskPeer::retrieveByPK($this->getTasUid());
$aData['TAS_UID'] = $this->getTasUid();
//Added to allow User defined Timing Control at Run time from Derivation screen
if (isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
$aData['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
$aData['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
$aData['TAS_TYPE_DAY'] = $sNextTasParam['NEXT_TASK']['TAS_TYPE_DAY'];
if (isset($sNextTasParam['NEXT_TASK']['TAS_CALENDAR']) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '') {
$aCalendarUID = $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'];
} else {
$aCalendarUID = '';
}
//Updating the task Table , so that user will see updated values in the assign screen in consequent cases
$oTask = new Task();
$oTask->update($aData);
} else {
if (is_null($task)) {
return 0;
}
$aData['TAS_DURATION'] = $task->getTasDuration();
$aData['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
$aData['TAS_TYPE_DAY'] = $task->getTasTypeDay();
$aCalendarUID = '';
}
//use the dates class to calculate dates
$calendar = new calendar();
if ($calendar->pmCalendarUid == '') {
$calendar->getCalendar(null, $task->getProUid(), $aData['TAS_UID']);
$calendar->getCalendarData();
}
$iDueDate = $calendar->calculateDate($this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT']);
return $iDueDate;
}
示例2: get
/**
* Implementation for 'GET' method for Rest API
*
* @param mixed $tasUid 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($tasUid = 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(TaskPeer::PRO_UID);
$criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->addSelectColumn(TaskPeer::TAS_TYPE);
$criteria->addSelectColumn(TaskPeer::TAS_DURATION);
$criteria->addSelectColumn(TaskPeer::TAS_DELAY_TYPE);
$criteria->addSelectColumn(TaskPeer::TAS_TEMPORIZER);
$criteria->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
$criteria->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
$criteria->addSelectColumn(TaskPeer::TAS_ALERT);
$criteria->addSelectColumn(TaskPeer::TAS_PRIORITY_VARIABLE);
$criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_TYPE);
$criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_VARIABLE);
$criteria->addSelectColumn(TaskPeer::TAS_GROUP_VARIABLE);
$criteria->addSelectColumn(TaskPeer::TAS_MI_INSTANCE_VARIABLE);
$criteria->addSelectColumn(TaskPeer::TAS_MI_COMPLETE_VARIABLE);
$criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_LOCATION);
$criteria->addSelectColumn(TaskPeer::TAS_ASSIGN_LOCATION_ADHOC);
$criteria->addSelectColumn(TaskPeer::TAS_TRANSFER_FLY);
$criteria->addSelectColumn(TaskPeer::TAS_LAST_ASSIGNED);
$criteria->addSelectColumn(TaskPeer::TAS_USER);
$criteria->addSelectColumn(TaskPeer::TAS_CAN_UPLOAD);
$criteria->addSelectColumn(TaskPeer::TAS_VIEW_UPLOAD);
$criteria->addSelectColumn(TaskPeer::TAS_VIEW_ADDITIONAL_DOCUMENTATION);
$criteria->addSelectColumn(TaskPeer::TAS_CAN_CANCEL);
$criteria->addSelectColumn(TaskPeer::TAS_OWNER_APP);
$criteria->addSelectColumn(TaskPeer::STG_UID);
$criteria->addSelectColumn(TaskPeer::TAS_CAN_PAUSE);
$criteria->addSelectColumn(TaskPeer::TAS_CAN_SEND_MESSAGE);
$criteria->addSelectColumn(TaskPeer::TAS_CAN_DELETE_DOCS);
$criteria->addSelectColumn(TaskPeer::TAS_SELF_SERVICE);
$criteria->addSelectColumn(TaskPeer::TAS_START);
$criteria->addSelectColumn(TaskPeer::TAS_TO_LAST_USER);
$criteria->addSelectColumn(TaskPeer::TAS_SEND_LAST_EMAIL);
$criteria->addSelectColumn(TaskPeer::TAS_DERIVATION);
$criteria->addSelectColumn(TaskPeer::TAS_POSX);
$criteria->addSelectColumn(TaskPeer::TAS_POSY);
$criteria->addSelectColumn(TaskPeer::TAS_WIDTH);
$criteria->addSelectColumn(TaskPeer::TAS_HEIGHT);
$criteria->addSelectColumn(TaskPeer::TAS_COLOR);
$criteria->addSelectColumn(TaskPeer::TAS_EVN_UID);
$criteria->addSelectColumn(TaskPeer::TAS_BOUNDARY);
$criteria->addSelectColumn(TaskPeer::TAS_DERIVATION_SCREEN_TPL);
$dataset = AppEventPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataset->next()) {
$result[] = $dataset->getRow();
}
} else {
$record = TaskPeer::retrieveByPK($tasUid);
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 Task ({$paramValues})");
}
}
} catch (RestException $e) {
throw new RestException($e->getCode(), $e->getMessage());
} catch (Exception $e) {
throw new RestException(412, $e->getMessage());
}
return $result;
}
示例3: getStartCasesPerType
public function getStartCasesPerType($sUIDUser = '', $typeView = null)
{
$rows[] = array('uid' => 'char', 'value' => 'char');
$tasks = array();
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::PRO_UID);
$c->addJoin(TaskPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$c->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN);
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_START, 'TRUE');
$c->add(TaskUserPeer::USR_UID, $sUIDUser);
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$tasks[] = $row['TAS_UID'];
$rs->next();
$row = $rs->getRow();
}
//check groups
G::LoadClass('groups');
$group = new Groups();
$aGroups = $group->getActiveGroupsForAnUser($sUIDUser);
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::PRO_UID);
$c->addJoin(TaskPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$c->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN);
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_START, 'TRUE');
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$tasks[] = $row['TAS_UID'];
$rs->next();
$row = $rs->getRow();
}
$c = new Criteria();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::PRO_UID);
$c->addAsColumn('TAS_TITLE', 'C1.CON_VALUE');
$c->addAsColumn('PRO_TITLE', 'C2.CON_VALUE');
$c->addAlias('C1', 'CONTENT');
$c->addAlias('C2', 'CONTENT');
if ($typeView == 'category') {
$c->addAsColumn('PRO_CATEGORY', 'PCS.PRO_CATEGORY');
$c->addAsColumn('CATEGORY_NAME', 'PCSCAT.CATEGORY_NAME');
$c->addAlias('PCS', 'PROCESS');
$c->addAlias('PCSCAT', 'PROCESS_CATEGORY');
$aConditions = array();
$aConditions[] = array(TaskPeer::PRO_UID, 'PCS.PRO_UID');
$c->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array('PCS.PRO_CATEGORY', 'PCSCAT.CATEGORY_UID');
$c->addJoinMC($aConditions, Criteria::LEFT_JOIN);
}
$aConditions = array();
$aConditions[] = array(TaskPeer::TAS_UID, 'C1.CON_ID');
$aConditions[] = array('C1.CON_CATEGORY', DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter());
$aConditions[] = array('C1.CON_LANG', DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
$c->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(TaskPeer::PRO_UID, 'C2.CON_ID');
$aConditions[] = array('C2.CON_CATEGORY', DBAdapter::getStringDelimiter() . 'PRO_TITLE' . DBAdapter::getStringDelimiter());
$aConditions[] = array('C2.CON_LANG', DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
$c->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$c->add(TaskPeer::TAS_UID, $tasks, Criteria::IN);
if ($typeView == 'category') {
$c->addDescendingOrderByColumn('PRO_CATEGORY');
} else {
$c->addAscendingOrderByColumn('PRO_TITLE');
$c->addAscendingOrderByColumn('TAS_TITLE');
}
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
while ($row = $rs->getRow()) {
if ($typeView == 'category') {
$taskTitle = TaskPeer::retrieveByPK($row['TAS_UID']);
$row['TAS_TITLE'] = $taskTitle->getTasTitle();
$row['CATEGORY_NAME'] = $row['CATEGORY_NAME'] == '' ? G::LoadTranslation('ID_PROCESS_NOCATEGORY') : $row['CATEGORY_NAME'];
$rows[] = array('uid' => $row['TAS_UID'], 'value' => $row['PRO_TITLE'] . ' (' . $row['TAS_TITLE'] . ')', 'pro_uid' => $row['PRO_UID'], 'cat' => $row['PRO_CATEGORY'], 'catname' => $row['CATEGORY_NAME']);
} else {
$rows[] = array('uid' => $row['TAS_UID'], 'value' => $row['PRO_TITLE'] . ' (' . $row['TAS_TITLE'] . ')', 'pro_uid' => $row['PRO_UID']);
}
$rs->next();
$row = $rs->getRow();
}
return $rows;
}
示例4: startCase
public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array())
{
if ($sTasUid != '') {
try {
$task = TaskPeer::retrieveByPK($sTasUid);
if (is_null($task)) {
throw new Exception(G::LoadTranslation("ID_TASK_NOT_EXIST", array("TAS_UID", $sTasUid)));
}
//To allow Self Service as the first task
$arrayTaskTypeToExclude = array("START-TIMER-EVENT");
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $task->getTasAssignType() != "SELF_SERVICE" && $sUsrUid == "") {
throw (new Exception('You tried to start a new case without send the USER UID!'));
}
//Process
$sProUid = $task->getProUid();
$this->Process = new Process;
$proFields = $this->Process->Load($sProUid);
//application
$Application = new Application;
$sAppUid = $Application->create($sProUid, $sUsrUid);
//appDelegation
$AppDelegation = new AppDelegation;
$iAppThreadIndex = 1; // Start Thread
$iAppDelPrio = 3; // Priority
$iDelIndex = $AppDelegation->createAppDelegation(
$sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iAppDelPrio, $isSubprocess
);
//appThread
$AppThread = new AppThread;
$iAppThreadIndex = $AppThread->createAppThread($sAppUid, $iDelIndex, 0);
//DONE: Al ya existir un delegation, se puede "calcular" el caseTitle.
$Fields = $Application->toArray(BasePeer::TYPE_FIELDNAME);
$aApplicationFields = $Fields['APP_DATA'];
$newValues = $this->newRefreshCaseTitleAndDescription($sAppUid, $Fields, $aApplicationFields);
if (!isset($newValues['APP_TITLE'])) {
$newValues['APP_TITLE'] = '';
}
$caseNumber = $Fields['APP_NUMBER'];
$Application->update($Fields);
//Update the task last assigned (for web entry and web services)
//.........这里部分代码省略.........
示例5: function
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"];
$record["PREVIOUS_USR_LASTNAME"] = $record["DEL_PREVIOUS_USR_LASTNAME"];
}
示例6: prepareInformation
/**
* Configuration functions
*
* @param string $UsrUid
* @param string $ProUid
* @param string $TasUid
* @return void
*/
public function prepareInformation($UsrUid = null, $ProUid = null, $TasUid = null)
{
// setup calendarDays according the task
if (isset($TasUid)) {
$task = TaskPeer::retrieveByPK($TasUid);
if (!is_null($task)) {
$this->calendarDays = $task->getTasTypeDay() == 2;
}
}
//get an array with all holidays.
$aoHolidays = HolidayPeer::doSelect(new Criteria());
$holidays = array();
foreach ($aoHolidays as $holiday) {
$holidays[] = strtotime($holiday->getHldDate());
}
// by default the weekdays are from monday to friday
$this->weekends = array(0, 6);
$this->holidays = $holidays;
return;
}
示例7: verifyDependecies
public function verifyDependecies($TRI_UID)
{
require_once "classes/model/Event.php";
require_once "classes/model/StepTrigger.php";
$oResult = new stdClass();
$oResult->dependencies = array();
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(EventPeer::EVN_UID);
$oCriteria->addSelectColumn(EventPeer::TRI_UID);
$oCriteria->add(EventPeer::EVN_ACTION, '', Criteria::NOT_EQUAL);
$oCriteria->add(EventPeer::TRI_UID, $TRI_UID);
$oDataset = EventPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aRows = array();
while ($oDataset->next()) {
array_push($aRows, $oDataset->getRow());
}
$oResult->dependencies['Events'] = array();
if (count($aRows) == 0) {
$oResult->code = 0;
} else {
$oResult->code = 1;
foreach ($aRows as $row) {
$oTrigger = TriggersPeer::retrieveByPK($row['TRI_UID']);
array_push($oResult->dependencies['Events'], array('UID' => $oTrigger->getTriUid(), 'DESCRIPTION' => $oTrigger->getTriTitle()));
}
}
//for tasks dependencies
$oCriteria = new Criteria();
$oCriteria->addSelectColumn(StepTriggerPeer::TAS_UID);
$oCriteria->addSelectColumn(StepTriggerPeer::TRI_UID);
$oCriteria->add(StepTriggerPeer::TRI_UID, $TRI_UID);
$oDataset = StepTriggerPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aRows = array();
while ($oDataset->next()) {
array_push($aRows, $oDataset->getRow());
}
$oResult->dependencies['Tasks'] = array();
if ($oResult->code == 0 && count($aRows) == 0) {
$oResult->code = 0;
} elseif (count($aRows) > 0) {
$oResult->code = 1;
foreach ($aRows as $row) {
$oTask = TaskPeer::retrieveByPK($row['TAS_UID']);
array_push($oResult->dependencies['Tasks'], array('UID' => $oTask->getTasUid(), 'DESCRIPTION' => $oTask->getTasTitle()));
}
}
//Tasks, assignment rules dependencies
$criteria = new Criteria();
$criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->add(TaskPeer::TAS_SELFSERVICE_TIMEOUT, 1);
$criteria->add(TaskPeer::TAS_SELFSERVICE_TRIGGER_UID, $TRI_UID);
$rsCriteria = TaskPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$arrayRow = array();
while ($rsCriteria->next()) {
array_push($arrayRow, $rsCriteria->getRow());
}
$oResult->dependencies["Assignment rules"] = array();
if ($oResult->code == 0 && count($arrayRow) == 0) {
$oResult->code = 0;
} else {
if (count($arrayRow) > 0) {
foreach ($arrayRow as $row) {
$task = TaskPeer::retrieveByPK($row["TAS_UID"]);
array_push($oResult->dependencies["Assignment rules"], array("UID" => $task->getTasUid(), "DESCRIPTION" => $task->getTasTitle()));
}
$oResult->code = 1;
}
}
return $oResult;
}
示例8: getTaskUserSelfService
public function getTaskUserSelfService($tas_uid, $appFields)
{
$oTask = new \Tasks();
$oGroup = new \Groups();
$taskNextDel = \TaskPeer::retrieveByPK($tas_uid);
$arrayTaskUser = array();
if ($taskNextDel->getTasAssignType() == "SELF_SERVICE" && trim($taskNextDel->getTasGroupVariable()) != "") {
// Self Service Value Based Assignment
$nextTaskGroupVariable = trim($taskNextDel->getTasGroupVariable(), " @#");
if (isset($appFields["APP_DATA"][$nextTaskGroupVariable])) {
$dataGroupVariable = $appFields["APP_DATA"][$nextTaskGroupVariable];
$dataGroupVariable = is_array($dataGroupVariable) ? $dataGroupVariable : trim($dataGroupVariable);
if (!empty($dataGroupVariable) && is_array($dataGroupVariable)) {
$arrayTaskUser[] = $dataGroupVariable;
} elseif (!empty($dataGroupVariable)) {
$arrayUsersOfGroup = $oGroup->getUsersOfGroup($dataGroupVariable);
foreach ($arrayUsersOfGroup as $arrayUser) {
$arrayTaskUser[] = $arrayUser["USR_UID"];
}
}
}
} else {
// Self Service
$arrayGroupsOfTask = $oTask->getGroupsOfTask($tas_uid, 1);
foreach ($arrayGroupsOfTask as $arrayGroup) {
$arrayUsersOfGroup = $oGroup->getUsersOfGroup($arrayGroup["GRP_UID"]);
foreach ($arrayUsersOfGroup as $arrayUser) {
$arrayTaskUser[] = $arrayUser["USR_UID"];
}
}
$arrayUsersOfTask = $oTask->getUsersOfTask($tas_uid, 1);
foreach ($arrayUsersOfTask as $arrayUser) {
$arrayTaskUser[] = $arrayUser["USR_UID"];
}
}
return $arrayTaskUser;
}
示例9: calculateRiskDate
public function calculateRiskDate($dueDate, $risk)
{
try {
$data = array();
if (isset( $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] ) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
$data['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
$data['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
} else {
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
$data['TAS_DURATION'] = $task->getTasDuration();
$data['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
}
$riskTime = $data['TAS_DURATION'] - ($data['TAS_DURATION'] * $risk);
//Calendar - Use the dates class to calculate dates
$calendar = new calendar();
$arrayCalendarData = array();
if ($calendar->pmCalendarUid == "") {
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
$arrayCalendarData = $calendar->getCalendarData();
}
//Risk date
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $riskTime, $data['TAS_TIMEUNIT'], $arrayCalendarData);
return $riskDate;
} catch (Exception $e) {
throw $e;
}
}
示例10: execScriptByActivityUid
/**
* Execute Script
*
* @param string $activityUid Unique id of Event
* @param array $arrayApplicationData Case data
*
* return array
*/
public function execScriptByActivityUid($activityUid, array $arrayApplicationData)
{
try {
$task = \TaskPeer::retrieveByPK($activityUid);
if (!is_null($task) && $task->getTasType() == "SCRIPT-TASK") {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ScriptTaskPeer::SCRTAS_OBJ_UID);
$criteria->add(\ScriptTaskPeer::ACT_UID, $activityUid, \Criteria::EQUAL);
$rsCriteria = \ScriptTaskPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$scriptTasObjUid = $row["SCRTAS_OBJ_UID"];
$trigger = \TriggersPeer::retrieveByPK($scriptTasObjUid);
if (!is_null($trigger)) {
$pmScript = new \PMScript();
$pmScript->setFields($arrayApplicationData["APP_DATA"]);
$pmScript->setScript($trigger->getTriWebbot());
$result = $pmScript->execute();
if (isset($pmScript->aFields["__ERROR__"])) {
\G::log("Case Uid: " . $arrayApplicationData["APP_UID"] . ", Error: " . $pmScript->aFields["__ERROR__"], PATH_DATA . "log/ScriptTask.log");
}
$arrayApplicationData["APP_DATA"] = $pmScript->aFields;
$case = new \Cases();
$result = $case->updateCase($arrayApplicationData["APP_UID"], $arrayApplicationData);
}
}
}
//Return
return $arrayApplicationData["APP_DATA"];
} catch (\Exception $e) {
throw $e;
}
}
示例11: remove
public function remove($TasUid)
{
$oConnection = Propel::getConnection(TaskPeer::DATABASE_NAME);
try {
$oTask = TaskPeer::retrieveByPK($TasUid);
if (!is_null($oTask)) {
$oConnection->begin();
Content::removeContent('TAS_TITLE', '', $oTask->getTasUid());
Content::removeContent('TAS_DESCRIPTION', '', $oTask->getTasUid());
Content::removeContent('TAS_DEF_TITLE', '', $oTask->getTasUid());
Content::removeContent('TAS_DEF_DESCRIPTION', '', $oTask->getTasUid());
Content::removeContent('TAS_DEF_PROC_CODE', '', $oTask->getTasUid());
Content::removeContent('TAS_DEF_MESSAGE', '', $oTask->getTasUid());
Content::removeContent('TAS_DEF_SUBJECT_MESSAGE', '', $oTask->getTasUid());
$iResult = $oTask->delete();
$oConnection->commit();
return $iResult;
} else {
throw new Exception("The row '" . $TasUid . "' in table TASK doesn't exist!");
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例12: getTask
public function getTask($con = null)
{
if ($this->aTask === null && $this->task_id !== null) {
include_once 'lib/model/om/BaseTaskPeer.php';
$this->aTask = TaskPeer::retrieveByPK($this->task_id, $con);
}
return $this->aTask;
}
示例13: deleteWebEntry
/**
* Delete WebEntry
*
* @param string $webEntryUid Unique id of WebEntry
* @param string $webEntryTaskUid WebEntry, unique id of Task
*
* return void
*/
public function deleteWebEntry($webEntryUid, $webEntryTaskUid)
{
try {
if ($webEntryTaskUid != "") {
$obj = \TaskPeer::retrieveByPK($webEntryTaskUid);
if (!is_null($obj)) {
$task = new \Tasks();
$task->deleteTask($webEntryTaskUid);
}
}
if ($webEntryUid != "") {
$obj = \WebEntryPeer::retrieveByPK($webEntryUid);
if (!is_null($obj)) {
$this->webEntry->delete($webEntryUid);
}
}
} catch (\Exception $e) {
throw $e;
}
}
示例14: newCase
//.........这里部分代码省略.........
if ($taskId == '') {
if ($tasksInThisProcess == 1) {
$founded = $validTaskId;
$taskId = $validTaskId;
}
if ($tasksInThisProcess > 1) {
$result = new wsResponse( 13, G::loadTranslation( 'ID_MULTIPLE_STARTING_TASKS' ) );
$g->sessionVarRestore();
return $result;
}
}
$task = TaskPeer::retrieveByPK($taskId);
$arrayTaskTypeToExclude = array("START-TIMER-EVENT");
if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $founded == "") {
$result = new wsResponse( 14, G::loadTranslation( 'ID_TASK_INVALID_USER_NOT_ASSIGNED_TASK' ) );
$g->sessionVarRestore();
return $result;
}
//Start case
$case = $oCase->startCase( $taskId, $userId );
$_SESSION['APPLICATION'] = $case['APPLICATION'];
$_SESSION['PROCESS'] = $case['PROCESS'];
示例15: setStartTask
/**
* @param string $tasUid
* @param bool $value
*/
public function setStartTask($tasUid, $value = true)
{
$value = $value ? "TRUE" : "FALSE";
self::log("Setting Start Task with Uid: {$tasUid}: {$value}");
$task = \TaskPeer::retrieveByPK($tasUid);
$task->setTasStart($value);
$task->save();
self::log("Setting Start Task -> {$value}, Success!");
}