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


PHP processMap::saveNewGateway方法代码示例

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


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

示例1: saveNewPattern

 /**
  * saveNewPattern
  *
  * @param string $sProcessUID Default value empty
  * @param string $sTaskUID Default value empty
  * @param string $sNextTask Default value empty
  * @param string $sType Default value empty
  * @param boolean $sDelete
  * @return array void
  */
 public function saveNewPattern($sProcessUID = '', $sTaskUID = '', $sNextTask = '', $sType = '', $sDelete = '')
 {
     try {
         $oCriteria = new Criteria('workflow');
         $oCriteria->addSelectColumn('COUNT(*) AS ROUTE_NUMBER');
         $oCriteria->addSelectColumn('GAT_UID AS GATEWAY_UID');
         $oCriteria->add(RoutePeer::PRO_UID, $sProcessUID);
         $oCriteria->add(RoutePeer::TAS_UID, $sTaskUID);
         $oCriteria->add(RoutePeer::ROU_TYPE, $sType);
         $oDataset = RoutePeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $aRow = $oDataset->getRow();
         $aFields['PRO_UID'] = $sProcessUID;
         $aFields['TAS_UID'] = $sTaskUID;
         $aFields['ROU_NEXT_TASK'] = $sNextTask;
         $aFields['ROU_TYPE'] = $sType;
         $aFields['ROU_CASE'] = (int) $aRow['ROUTE_NUMBER'] + 1;
         $sGatewayUID = $aRow['GATEWAY_UID'];
         if ($sDelete && $sGatewayUID != '') {
             $oGateway = new Gateway();
             $oGateway->remove($sGatewayUID);
         }
         //Getting Gateway UID after saving gateway
         //if($sType != 'SEQUENTIAL' && $sGatewayUID == '' && $sDelete == '1')
         if ($sType != 'SEQUENTIAL') {
             $oProcessMap = new processMap();
             $sGatewayUID = $oProcessMap->saveNewGateway($sProcessUID, $sTaskUID, $sNextTask);
         }
         $aFields['GAT_UID'] = isset($sGatewayUID) ? $sGatewayUID : '';
         $oRoute = new Route();
         $oRoute->create($aFields);
     } catch (Exception $oError) {
         throw $oError;
     }
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:46,代码来源:class.processMap.php

示例2: createRouteRows

 /**
  * creates row tasks from an Route Array
  * @param string $aTasks
  * @return array
  */
 public function createRouteRows($aRoutes)
 {
     $routeID = array();
     $aField = array();
     $taskParallel = '';
     $taskSecJoin = '';
     $taskEvaluate = '';
     $taskParallelEv = '';
     $taskSelect = '';
     $taskDiscriminator = '';
     foreach ($aRoutes as $key => $row) {
         $sRouteType = $row['ROU_TYPE'];
         $oRoute = new Route();
         $oProcessMap = new processMap();
         $oTask = new Task();
         $oEvent = new Event();
         //unset ($row['ROU_UID']);
         //Saving Gateway into the GATEWAY table
         $idTask = $row['TAS_UID'];
         $nextTask = $row['ROU_NEXT_TASK'];
         if ($nextTask == "-1") {
             $end = 1;
         }
         if ($sRouteType != 'SEQUENTIAL') {
             switch ($sRouteType) {
                 case 'PARALLEL':
                     if ($idTask != $taskParallel) {
                         $taskParallel = $idTask;
                         $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']);
                     }
                     break;
                 case 'SEC-JOIN':
                     if ($nextTask != $taskSecJoin) {
                         $taskSecJoin = $nextTask;
                         $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']);
                     }
                     break;
                 case 'EVALUATE':
                     if ($idTask != $taskEvaluate) {
                         $taskEvaluate = $idTask;
                         $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']);
                     }
                     break;
                 case 'PARALLEL-BY-EVALUATION':
                     if ($idTask != $taskParallelEv) {
                         $taskParallelEv = $idTask;
                         $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']);
                     }
                     break;
                 case 'SELECT':
                     if ($idTask != $taskSelect) {
                         $taskSelect = $idTask;
                         $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']);
                     }
                     break;
                 case 'DISCRIMINATOR':
                     if ($nextTask != $taskDiscriminator) {
                         $taskDiscriminator = $nextTask;
                         $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']);
                     }
                     break;
             }
             $row['GAT_UID'] = $sGatewayUID;
         }
         if ($oRoute->routeExists($row['ROU_UID'])) {
             $oRoute->remove($row['ROU_UID']);
         }
         $routeID = $oRoute->create($row);
         //saving end event while import old processes
         if (isset($end) && $end == 1) {
             if (!$oEvent->existsByTaskUidFrom($idTask)) {
                 if ($sRouteType == "SEQUENTIAL") {
                     $aTaskDetails = $oTask->load($idTask);
                     $positionX = $aTaskDetails['TAS_POSX'] + $aTaskDetails['TAS_WIDTH'] / 2;
                     $positionY = $aTaskDetails['TAS_POSY'] + $aTaskDetails['TAS_HEIGHT'] + 10;
                     $aData['PRO_UID'] = $row['PRO_UID'];
                     $aData['EVN_TYPE'] = 'bpmnEventEmptyEnd';
                     $aData['EVN_POSX'] = $positionX;
                     $aData['EVN_POSY'] = $positionY;
                     $aData['EVN_TAS_UID_FROM'] = $idTask;
                     $aData['EVN_STATUS'] = 'ACTIVE';
                     $aData['EVN_RELATED_TO'] = 'MULTIPLE';
                     $aData['EVN_WHEN'] = '1';
                     $aData['EVN_ACTION'] = '';
                     $sEvn_uid = $oEvent->create($aData);
                     $aField['ROU_UID'] = $routeID;
                     $aField['ROU_EVN_UID'] = $sEvn_uid;
                     $oRoute->update($aField);
                     $end = 0;
                 }
             }
         }
     }
     return;
 }
开发者ID:nshong,项目名称:processmaker,代码行数:100,代码来源:class.tasks.php


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