当前位置: 首页>>代码示例>>PHP>>正文


PHP AppDelegationPeer类代码示例

本文整理汇总了PHP中AppDelegationPeer的典型用法代码示例。如果您正苦于以下问题:PHP AppDelegationPeer类的具体用法?PHP AppDelegationPeer怎么用?PHP AppDelegationPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AppDelegationPeer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: startContinueCaseByTimerEvent


//.........这里部分代码省略.........
                     case "HOURLY":
                     case "DAILY":
                     case "MONTHLY":
                     case "EVERY":
                         if ($timerEventNextRunDateNew == "") {
                             $timerEventNextRunDateNew = $this->getNextRunDateByDataAndDatetime($arrayTimerEventData, $timerEventNextRunDate, false);
                         }
                         if ($arrayTimerEventData["TMREVN_OPTION"] != "EVERY" && $arrayTimerEventData["TMREVN_END_DATE"] . "" != "" && strtotime($timerEventNextRunDateNew) > strtotime($arrayTimerEventData["TMREVN_END_DATE"] . " 23:59:59")) {
                             $arrayData["TMREVN_STATUS"] = "PROCESSED";
                         } else {
                             $arrayData["TMREVN_NEXT_RUN_DATE"] = $timerEventNextRunDateNew;
                         }
                         break;
                     case "ONE-DATE-TIME":
                         $arrayData["TMREVN_STATUS"] = "PROCESSED";
                         break;
                 }
                 $arrayData["TMREVN_LAST_RUN_DATE"] = $timerEventNextRunDate;
                 $arrayData["TMREVN_LAST_EXECUTION_DATE"] = date("Y-m-d H:i:s");
                 $result = $this->singleUpdate($arrayTimerEventData["TMREVN_UID"], $arrayData);
                 $flagRecord = true;
             }
         }
         if (!$flagRecord) {
             $common->frontEndShow("TEXT", "Not exists any record to start a new case, on date \"{$datetime}\"");
             $this->log("NO-RECORDS", "Not exists any record to start a new case");
         }
         $common->frontEndShow("END");
         $this->log("END-NEW-CASES", "Date \"{$datetime}\": End new cases");
         //Intermediate Catch Timer-Event (continue the case) ///////////////////////////////////////////////////////
         $this->log("START-CONTINUE-CASES", "Date \"{$datetime}\": Start continue the cases");
         //Query
         $criteriaMain = $this->getTimerEventCriteria();
         $criteriaMain->addSelectColumn(\AppDelegationPeer::APP_UID);
         $criteriaMain->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
         $criteriaMain->addSelectColumn(\AppDelegationPeer::DEL_DELEGATE_DATE);
         $criteriaMain->addSelectColumn(\BpmnEventPeer::EVN_NAME);
         $arrayCondition = array();
         $arrayCondition[] = array(\AppDelegationPeer::PRO_UID, \ProcessPeer::PRO_UID, \Criteria::EQUAL);
         $criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
         $criteriaMain->add(\ProcessPeer::PRO_STATUS, "ACTIVE", \Criteria::EQUAL);
         $arrayCondition = array();
         $arrayCondition[] = array(\AppDelegationPeer::APP_UID, \ApplicationPeer::APP_UID, \Criteria::EQUAL);
         $criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
         $criteriaMain->add(\ApplicationPeer::APP_STATUS, "DRAFT", \Criteria::NOT_EQUAL);
         $arrayCondition = array();
         $arrayCondition[] = array(\AppDelegationPeer::PRO_UID, \TaskPeer::PRO_UID, \Criteria::EQUAL);
         $arrayCondition[] = array(\AppDelegationPeer::TAS_UID, \TaskPeer::TAS_UID, \Criteria::EQUAL);
         $criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
         $criteriaMain->add(\TaskPeer::TAS_TYPE, "INTERMEDIATE-CATCH-TIMER-EVENT", \Criteria::EQUAL);
         $arrayCondition = array();
         $arrayCondition[] = array(\TaskPeer::PRO_UID, \ElementTaskRelationPeer::PRJ_UID, \Criteria::EQUAL);
         $arrayCondition[] = array(\TaskPeer::TAS_UID, \ElementTaskRelationPeer::TAS_UID, \Criteria::EQUAL);
         $criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
         $criteriaMain->add(\ElementTaskRelationPeer::ELEMENT_TYPE, "bpmnEvent", \Criteria::EQUAL);
         $arrayCondition = array();
         $arrayCondition[] = array(\ElementTaskRelationPeer::PRJ_UID, \TimerEventPeer::PRJ_UID, \Criteria::EQUAL);
         $arrayCondition[] = array(\ElementTaskRelationPeer::ELEMENT_UID, \TimerEventPeer::EVN_UID, \Criteria::EQUAL);
         $criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
         $arrayCondition = array();
         $arrayCondition[] = array(\TimerEventPeer::PRJ_UID, \BpmnEventPeer::PRJ_UID, \Criteria::EQUAL);
         $arrayCondition[] = array(\TimerEventPeer::EVN_UID, \BpmnEventPeer::EVN_UID, \Criteria::EQUAL);
         $criteriaMain->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
         $criteriaMain->add(\BpmnEventPeer::EVN_TYPE, "INTERMEDIATE", \Criteria::EQUAL);
         $criteriaMain->add(\BpmnEventPeer::EVN_MARKER, "TIMER", \Criteria::EQUAL);
         $criteriaMain->add(\TimerEventPeer::TMREVN_OPTION, array("WAIT-FOR", "WAIT-UNTIL-SPECIFIED-DATE-TIME"), \Criteria::IN);
开发者ID:emildev35,项目名称:processmaker,代码行数:67,代码来源:TimerEvent.php

示例2: getDerivatedCases

    function getDerivatedCases ($sParentUid, $sDelIndexParent)

    {

        $oCriteria = new Criteria( 'workflow' );

        $cases = array ();

        $derivation = array ();

        //get the child delegations , of parent delIndex

        $children = array ();

        $oCriteria->clearSelectColumns();

        $oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX );

        $oCriteria->add( AppDelegationPeer::APP_UID, $sParentUid );

        $oCriteria->add( AppDelegationPeer::DEL_PREVIOUS, $sDelIndexParent );

        $oDataset = AppDelegationPeer::doSelectRS( $oCriteria );

        $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );

        $oDataset->next();

        $aRow = $oDataset->getRow();

        while (is_array( $aRow )) {

            $children[] = $aRow['DEL_INDEX'];



            $oDataset->next();

            $aRow = $oDataset->getRow();

        }



        //foreach child , get the info of their derivations and subprocesses

        foreach ($children as $keyChild => $child) {

            $oCriteria = new Criteria( 'workflow' );

            $oCriteria->clearSelectColumns();

            $oCriteria->addSelectColumn( SubApplicationPeer::APP_UID );

            $oCriteria->addSelectColumn( AppDelegationPeer::APP_UID );

            $oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX );

            $oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID );

            $oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID );

            $oCriteria->addSelectColumn( AppDelegationPeer::USR_UID );

            $oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );

            $oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );

            $oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );



            $oCriteria->add( SubApplicationPeer::APP_PARENT, $sParentUid );

            $oCriteria->add( SubApplicationPeer::DEL_INDEX_PARENT, $child );

            $oCriteria->addJoin( SubApplicationPeer::APP_UID, AppDelegationPeer::APP_UID );

            $oCriteria->addJoin( AppDelegationPeer::USR_UID, UsersPeer::USR_UID );

            $oDataset = SubApplicationPeer::doSelectRS( $oCriteria );

            $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );

            $oDataset->next();

            $aRow = $oDataset->getRow();

            while (is_array( $aRow )) {

                $oProcess = new Process();

                $proFields = $oProcess->load( $aRow['PRO_UID'] );

                $oCase = new Application();

                $appFields = $oCase->load( $aRow['APP_UID'] );

                $oTask = new Task();

//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:class.derivation.php

示例3: unset

                /* Redirect to next step */
                unset( $_SESSION['bNoShowSteps'] );
                $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
                $sPage = $aNextStep['PAGE'];
                G::header( 'location: ' . $sPage );

            } else {
                //when the case have another user or current user doesn't have rights to this self-service,
                //just view the case Resume

                // Get DEL_INDEX
                $criteria = new Criteria('workflow');
                $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
                $criteria->add(AppDelegationPeer::APP_UID, $sAppUid);
                $criteria->add(AppDelegationPeer::DEL_LAST_INDEX , 1);
                $rs = AppDelegationPeer::doSelectRS($criteria);
                $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                $rs->next();
                $row = $rs->getRow();

                $_SESSION['APPLICATION'] = $sAppUid;
                if($_action=='search'){
                    $_SESSION['INDEX'] = $iDelIndex;
                } else {
                    $_SESSION['INDEX'] = $row['DEL_INDEX'];
                }
                $_SESSION['PROCESS'] = $aFields['PRO_UID'];
                $_SESSION['TASK'] = - 1;
                //$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
                if ($_action == 'jump') {
                    $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], 1);
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:31,代码来源:cases_Open.php

示例4: getSummary

 /**
  * get the case summary data
  *
  * @param string $httpData->appUid
  * @param string $httpData->delIndex
  * @return array containg the case summary data
  */
 function getSummary($httpData)
 {
     $labels = array();
     $form = new Form('cases/cases_Resume', PATH_XMLFORM, SYS_LANG);
     G::LoadClass('case');
     $case = new Cases();
     foreach ($form->fields as $fieldName => $field) {
         $labels[$fieldName] = $field->label;
     }
     if (isset($_SESSION['_applicationFields']) && $_SESSION['_processData']) {
         $applicationFields = $_SESSION['_applicationFields'];
         unset($_SESSION['_applicationFields']);
         $processData = $_SESSION['_processData'];
         unset($_SESSION['_processData']);
     } else {
         if ($httpData->action == 'sent') {
             // Get the last valid delegation for participated list
             $criteria = new Criteria();
             $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
             $criteria->add(AppDelegationPeer::APP_UID, $httpData->appUid);
             $criteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
             $criteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
             if (AppDelegationPeer::doCount($criteria) > 0) {
                 $dataset = AppDelegationPeer::doSelectRS($criteria);
                 $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                 $dataset->next();
                 $row = $dataset->getRow();
                 $httpData->delIndex = $row['DEL_INDEX'];
             }
         }
         $applicationFields = $case->loadCase($httpData->appUid, $httpData->delIndex);
         $process = new Process();
         $processData = $process->load($applicationFields['PRO_UID']);
     }
     $data = array();
     $task = new Task();
     $taskData = $task->load($applicationFields['TAS_UID']);
     $currentUser = $applicationFields['CURRENT_USER'] != '' ? $applicationFields['CURRENT_USER'] : '[' . G::LoadTranslation('ID_UNASSIGNED') . ']';
     $data[] = array('label' => $labels['PRO_TITLE'], 'value' => $processData['PRO_TITLE'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['TITLE'], 'value' => $applicationFields['TITLE'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['APP_NUMBER'], 'value' => $applicationFields['APP_NUMBER'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['STATUS'], 'value' => $applicationFields['STATUS'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['APP_UID'], 'value' => $applicationFields['APP_UID'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['CREATOR'], 'value' => $applicationFields['CREATOR'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['CREATE_DATE'], 'value' => $applicationFields['CREATE_DATE'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['UPDATE_DATE'], 'value' => $applicationFields['UPDATE_DATE'], 'section' => $labels['TITLE1']);
     $data[] = array('label' => $labels['DESCRIPTION'], 'value' => $applicationFields['DESCRIPTION'], 'section' => $labels['TITLE1']);
     // note added by krlos pacha carlos[at]colosa[dot]com
     //getting this field if it doesn't exist. Related 7994 bug
     $taskData['TAS_TITLE'] = array_key_exists('TAS_TITLE', $taskData) ? $taskData['TAS_TITLE'] : Content::Load("TAS_TITLE", "", $applicationFields['TAS_UID'], SYS_LANG);
     $data[] = array('label' => $labels['TAS_TITLE'], 'value' => $taskData['TAS_TITLE'], 'section' => $labels['TITLE2']);
     $data[] = array('label' => $labels['CURRENT_USER'], 'value' => $currentUser, 'section' => $labels['TITLE2']);
     $data[] = array('label' => $labels['DEL_DELEGATE_DATE'], 'value' => $applicationFields['DEL_DELEGATE_DATE'], 'section' => $labels['TITLE2']);
     $data[] = array('label' => $labels['DEL_INIT_DATE'], 'value' => $applicationFields['DEL_INIT_DATE'], 'section' => $labels['TITLE2']);
     $data[] = array('label' => $labels['DEL_TASK_DUE_DATE'], 'value' => $applicationFields['DEL_TASK_DUE_DATE'], 'section' => $labels['TITLE2']);
     $data[] = array('label' => $labels['DEL_FINISH_DATE'], 'value' => $applicationFields['DEL_FINISH_DATE'], 'section' => $labels['TITLE2']);
     //$data[] = array('label'=>$labels['DYN_UID'] ,           'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labels['DYN_UID']);
     return $data;
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:66,代码来源:appProxy.php

示例5: Criteria

     $_SESSION['INDEX'] = $iDelIndex;
     $_SESSION['PROCESS'] = $aFields['PRO_UID'];
     $_SESSION['TASK'] = -1;
     $_SESSION['STEP_POSITION'] = 0;
     require_once PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php';
     exit;
 }
 /**
  * these routine is to verify if the case was acceded from advaced search list
  */
 if ($_action == 'search') {
     //verify if the case is with teh current user
     $c = new Criteria('workflow');
     $c->add(AppDelegationPeer::APP_UID, $sAppUid);
     $c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
     $oDataset = AppDelegationPeer::doSelectRs($c);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $aData = $oDataset->getRow();
     if ($aData['USR_UID'] != $_SESSION['USER_LOGGED'] && $aData['USR_UID'] != "") {
         //distinct "" for selfservice
         //so we show just the resume
         $_SESSION['alreadyDerivated'] = true;
         //the case is paused show only the resume
         $_SESSION['APPLICATION'] = $sAppUid;
         $_SESSION['INDEX'] = $iDelIndex;
         $_SESSION['PROCESS'] = $aFields['PRO_UID'];
         $_SESSION['TASK'] = -1;
         $_SESSION['STEP_POSITION'] = 0;
         require_once PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php';
         exit;
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:31,代码来源:cases_Open.php

示例6: getLastDeleration

 public function getLastDeleration($APP_UID)
 {
     $c = new Criteria('workflow');
     $c->addSelectColumn(AppDelegationPeer::APP_UID);
     $c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
     $c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
     $c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
     $c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
     $c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
     $c->addSelectColumn(AppDelegationPeer::DEL_DURATION);
     $c->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
     $c->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
     $c->addSelectColumn(AppDelegationPeer::DEL_STARTED);
     $c->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
     $c->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
     $c->addSelectColumn(AppDelegationPeer::USR_UID);
     $c->add(AppDelegationPeer::APP_UID, $APP_UID);
     $c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
     $rs = AppDelegationPeer::doSelectRS($c);
     $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $rs->next();
     return $rs->getRow();
 }
开发者ID:norahmollo,项目名称:processmaker,代码行数:23,代码来源:AppDelegation.php

示例7: reportsPatch

 /** 
  * Patch for reports by The Answer (17-10-2k8)
  * 
  * 
  * @name reportsPatch
  *
  * param 
  * @return void
  */
 function reportsPatch()
 {
     require_once 'classes/model/AppDelegation.php';
     $oCriteria = new Criteria('workflow');
     $del = DBAdapter::getStringDelimiter();
     $oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
     $oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
     $oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
     $oCriteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
     $oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
     $oCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
     $oCriteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
     $oDataset = AppDelegationPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     while ($aRow = $oDataset->getRow()) {
         $oAppDelegation = new AppDelegation();
         $aData['APP_UID'] = $aRow['APP_UID'];
         $aData['DEL_INDEX'] = $aRow['DEL_INDEX'];
         $aData['DEL_DELEGATE_DATE'] = $aRow['DEL_DELEGATE_DATE'];
         if ($aRow['DEL_INIT_DATE'] == NULL) {
             $aData['DEL_INIT_DATE'] = $aRow['DEL_DELEGATE_DATE'];
         } else {
             $aData['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE'];
         }
         //$aData['DEL_FINISH_DATE']=$aRow['DEL_FINISH_DATE'];
         if ($aRow['DEL_DURATION'] != 0) {
             G::LoadClass('dates');
             $oDates = new dates();
             $aData['DEL_DURATION'] = $oDates->calculateDuration($aData['DEL_INIT_DATE'], $aRow['DEL_FINISH_DATE'], null, null, $aRow['TAS_UID']);
         }
         $oAppDelegation->update($aData);
         $oDataset->next();
     }
     return;
 }
开发者ID:nshong,项目名称:processmaker,代码行数:45,代码来源:class.report.php

示例8: isExistNextNotification

 public function isExistNextNotification($app_uid, $del_index)
 {
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
     $oCriteria->add(AppDelegationPeer::APP_UID, $app_uid);
     $oCriteria->add(AppDelegationPeer::DEL_PREVIOUS, $del_index);
     $oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
     $oCriteria->setLimit(1);
     //execute the query
     $oDataset = AppDelegationPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     if ($oDataset->next()) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:17,代码来源:NotificationDevice.php

示例9: Users

 $oUser = new Users();
 $aUser = $oUser->load($_SESSION['USER_LOGGED']);
 if (trim($aUser['USR_EMAIL']) == '') {
     $aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
 }
 $sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
 try {
     $oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName);
 } catch (Exception $e) {
     G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR') . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%');
 }
 // Send notifications - End
 // Events - Start
 $oEvent = new Event();
 $oEvent->closeAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
 $oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1);
 $multipleDelegation = false;
 // check if there are multiple derivations
 if (count($_POST['form']['TASKS']) > 1) {
     $multipleDelegation = true;
 }
 // If the case has been delegated
 if (isset($oCurrentAppDel)) {
     // if there is just a single derivation the TASK_UID can be set by the delegation data
     if (!$multipleDelegation) {
         $aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
         $oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID']);
     } else {
         // else we need to check every task and create the events if it have any
         foreach ($_POST['form']['TASKS'] as $taskDelegated) {
             $aCurrentAppDel = $oCurrentAppDel->toArray(BasePeer::TYPE_FIELDNAME);
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:cases_Derivate.php

示例10: PMFRedirectToStep

/**
 *
 * @method
 *
 * Redirects a case to any step in the current task. In order for the step to
 * be executed, the specified step much exist and if it contains a condition,
 * it must evaluate to true.
 *
 * @name PMFRedirectToStep
 * @label PMF Redirect To Step
 * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFRedirectToStep.28.29
 *
 * @param string(32) | $sApplicationUID | Case ID | The unique ID for a case,
 * @param int | $iDelegation | Delegation index | The delegation index of a case.
 * @param string(32) | $sStepType | Type of Step | The type of step, which can be "DYNAFORM", "INPUT_DOCUMENT" or "OUTPUT_DOCUMENT".
 * @param string(32) | $sStepUid | Step ID | The unique ID for the step.
 * @return none | $none | None | None
 *
 */
function PMFRedirectToStep($sApplicationUID, $iDelegation, $sStepType, $sStepUid)
{
    $g = new G();
    $g->sessionVarSave();
    $iDelegation = intval($iDelegation);
    $_SESSION["APPLICATION"] = $sApplicationUID;
    $_SESSION["INDEX"] = $iDelegation;
    require_once 'classes/model/AppDelegation.php';
    $oCriteria = new Criteria('workflow');
    $oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
    $oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
    $oCriteria->add(AppDelegationPeer::DEL_INDEX, $iDelegation);
    $oDataset = AppDelegationPeer::doSelectRS($oCriteria);
    $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
    $oDataset->next();
    global $oPMScript;
    $aRow = $oDataset->getRow();
    if ($aRow) {
        require_once 'classes/model/Step.php';
        $oStep = new Step();
        $oTheStep = $oStep->loadByType($aRow['TAS_UID'], $sStepType, $sStepUid);
        $bContinue = true;
        G::LoadClass('case');
        $oCase = new Cases();
        $aFields = $oCase->loadCase($sApplicationUID);
        if ($oTheStep->getStepCondition() != '') {
            G::LoadClass('pmScript');
            $pmScript = new PMScript();
            $pmScript->setFields($aFields['APP_DATA']);
            $pmScript->setScript($oTheStep->getStepCondition());
            $bContinue = $pmScript->evaluate();
        }
        if ($bContinue) {
            switch ($oTheStep->getStepTypeObj()) {
                case 'DYNAFORM':
                    $sAction = 'EDIT';
                    break;
                case 'OUTPUT_DOCUMENT':
                    $sAction = 'GENERATE';
                    break;
                case 'INPUT_DOCUMENT':
                    $sAction = 'ATTACH';
                    break;
                case 'EXTERNAL':
                    $sAction = 'EDIT';
                    break;
                case 'MESSAGE':
                    $sAction = '';
                    break;
            }
            // save data
            if (!is_null($oPMScript)) {
                $aFields['APP_DATA'] = $oPMScript->aFields;
                $oCase->updateCase($sApplicationUID, $aFields);
            }
            $g->sessionVarRestore();
            G::header('Location: ' . 'cases_Step?TYPE=' . $sStepType . '&UID=' . $sStepUid . '&POSITION=' . $oTheStep->getStepPosition() . '&ACTION=' . $sAction);
            die;
        }
    }
    $g->sessionVarRestore();
}
开发者ID:ralpheav,项目名称:processmaker,代码行数:81,代码来源:class.pmFunctions.php

示例11: 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;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:72,代码来源:AppDelegation.php

示例12: generateData

    /**
     * Generate data
     *
     * return void
     */
    public function generateData()
    {
        try {
            G::LoadClass("case");

            AppAssignSelfServiceValuePeer::doDeleteAll(); //Delete all records

            //Generate data
            $case = new Cases();

            $criteria = new Criteria("workflow");

            $criteria->addSelectColumn(AppDelegationPeer::APP_UID);
            $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
            $criteria->addSelectColumn(ApplicationPeer::APP_DATA);
            $criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
            $criteria->addSelectColumn(TaskPeer::TAS_UID);
            $criteria->addSelectColumn(TaskPeer::TAS_GROUP_VARIABLE);
            $criteria->addJoin(AppDelegationPeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
            $criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
            $criteria->add(TaskPeer::TAS_ASSIGN_TYPE, "SELF_SERVICE", Criteria::EQUAL);
            $criteria->add(TaskPeer::TAS_GROUP_VARIABLE, "", Criteria::NOT_EQUAL);
            $criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL);
            $criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL);

            $rsCriteria = AppDelegationPeer::doSelectRS($criteria);
            $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);

            while ($rsCriteria->next()) {
                $row = $rsCriteria->getRow();

                $applicationData = $case->unserializeData($row["APP_DATA"]);
                $taskGroupVariable = trim($row["TAS_GROUP_VARIABLE"], " @#");

                if ($taskGroupVariable != "" && isset($applicationData[$taskGroupVariable]) && trim($applicationData[$taskGroupVariable]) != "") {
                    $this->create($row["APP_UID"], $row["DEL_INDEX"], array("PRO_UID" => $row["PRO_UID"], "TAS_UID" => $row["TAS_UID"], "GRP_UID" => trim($applicationData[$taskGroupVariable])));
                }
            }
        } catch (Exception $e) {
            throw $e;
        }
    }
开发者ID:rrsc,项目名称:processmaker,代码行数:47,代码来源:AppAssignSelfServiceValue.php

示例13: catchMessageEvent

 /**
  * Catch Message-Events for the Cases
  *
  * @param bool $frontEnd Flag to represent progress bar
  *
  * @return void
  */
 public function catchMessageEvent($frontEnd = false)
 {
     try {
         \G::LoadClass("wsBase");
         //Set variables
         $ws = new \wsBase();
         $case = new \Cases();
         $common = new \ProcessMaker\Util\Common();
         $common->setFrontEnd($frontEnd);
         //Get data
         $totalMessageEvent = 0;
         $counterStartMessageEvent = 0;
         $counterIntermediateCatchMessageEvent = 0;
         $counter = 0;
         $flagFirstTime = false;
         $common->frontEndShow("START");
         do {
             $flagNextRecords = false;
             $arrayMessageApplicationUnread = $this->getMessageApplications(array("messageApplicationStatus" => "UNREAD"), null, null, 0, 1000);
             if (!$flagFirstTime) {
                 $totalMessageEvent = $arrayMessageApplicationUnread["total"];
                 $flagFirstTime = true;
             }
             foreach ($arrayMessageApplicationUnread["data"] as $value) {
                 if ($counter + 1 > $totalMessageEvent) {
                     $flagNextRecords = false;
                     break;
                 }
                 $arrayMessageApplicationData = $value;
                 $processUid = $arrayMessageApplicationData["PRJ_UID"];
                 $taskUid = $arrayMessageApplicationData["TAS_UID"];
                 $messageApplicationUid = $arrayMessageApplicationData["MSGAPP_UID"];
                 $messageApplicationCorrelation = $arrayMessageApplicationData["MSGAPP_CORRELATION"];
                 $messageEventDefinitionUserUid = $arrayMessageApplicationData["MSGED_USR_UID"];
                 $messageEventDefinitionCorrelation = $arrayMessageApplicationData["MSGED_CORRELATION"];
                 $arrayVariable = $this->mergeVariables($arrayMessageApplicationData["MSGED_VARIABLES"], $arrayMessageApplicationData["MSGAPP_VARIABLES"]);
                 $flagCatched = false;
                 switch ($arrayMessageApplicationData["EVN_TYPE"]) {
                     case "START":
                         if ($messageEventDefinitionCorrelation == $messageApplicationCorrelation && $messageEventDefinitionUserUid != "") {
                             //Start and derivate new Case
                             $result = $ws->newCase($processUid, $messageEventDefinitionUserUid, $taskUid, $arrayVariable);
                             $arrayResult = json_decode(json_encode($result), true);
                             if ($arrayResult["status_code"] == 0) {
                                 $applicationUid = $arrayResult["caseId"];
                                 $result = $ws->derivateCase($messageEventDefinitionUserUid, $applicationUid, 1);
                                 $flagCatched = true;
                                 //Counter
                                 $counterStartMessageEvent++;
                             }
                         }
                         break;
                     case "INTERMEDIATE":
                         $criteria = new \Criteria("workflow");
                         $criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
                         $criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
                         $criteria->addSelectColumn(\AppDelegationPeer::USR_UID);
                         $criteria->add(\AppDelegationPeer::PRO_UID, $processUid, \Criteria::EQUAL);
                         $criteria->add(\AppDelegationPeer::TAS_UID, $taskUid, \Criteria::EQUAL);
                         $criteria->add(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", \Criteria::EQUAL);
                         $criteria->add(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL);
                         $rsCriteria = \AppDelegationPeer::doSelectRS($criteria);
                         $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
                         while ($rsCriteria->next()) {
                             $row = $rsCriteria->getRow();
                             $applicationUid = $row["APP_UID"];
                             $delIndex = $row["DEL_INDEX"];
                             $userUid = $row["USR_UID"];
                             $arrayApplicationData = $case->loadCase($applicationUid);
                             if (\G::replaceDataField($messageEventDefinitionCorrelation, $arrayApplicationData["APP_DATA"]) == $messageApplicationCorrelation) {
                                 //"Unpause" and derivate Case
                                 $arrayApplicationData["APP_DATA"] = array_merge($arrayApplicationData["APP_DATA"], $arrayVariable);
                                 $arrayResult = $case->updateCase($applicationUid, $arrayApplicationData);
                                 $result = $ws->derivateCase($userUid, $applicationUid, $delIndex);
                                 $flagCatched = true;
                             }
                         }
                         //Counter
                         if ($flagCatched) {
                             $counterIntermediateCatchMessageEvent++;
                         }
                         break;
                 }
                 //Message-Application catch
                 if ($flagCatched) {
                     $result = $this->update($messageApplicationUid, array("MSGAPP_STATUS" => "READ"));
                 }
                 $counter++;
                 //Progress bar
                 $common->frontEndShow("BAR", "Message-Events (unread): " . $counter . "/" . $totalMessageEvent . " " . $common->progressBar($totalMessageEvent, $counter));
                 $flagNextRecords = true;
             }
         } while ($flagNextRecords);
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:MessageApplication.php

示例14: retrieveByPK

 /**
  * Retrieve object using using composite pkey values.
  * @param string $app_uid
  * @param int $del_index
  * @param      Connection $con
  * @return     AppDelegation
  */
 public static function retrieveByPK($app_uid, $del_index, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(AppDelegationPeer::APP_UID, $app_uid);
     $criteria->add(AppDelegationPeer::DEL_INDEX, $del_index);
     $v = AppDelegationPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:18,代码来源:BaseAppDelegationPeer.php

示例15: 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;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:44,代码来源:InputDocument.php


注:本文中的AppDelegationPeer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。