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


PHP VTWorkflowManager::updateNexTriggerTime方法代码示例

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


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

示例1: updateNextTriggerTime

 public function updateNextTriggerTime()
 {
     $db = PearDatabase::getInstance();
     $wm = new VTWorkflowManager($db);
     $wf = $this->getWorkflowObject();
     $wm->updateNexTriggerTime($wf);
 }
开发者ID:artisan4710,项目名称:YetiForceCRM,代码行数:7,代码来源:Record.php

示例2: queueScheduledWorkflowTasks

 public function queueScheduledWorkflowTasks()
 {
     global $default_timezone;
     $adb = $this->db;
     $vtWorflowManager = new VTWorkflowManager($adb);
     $taskQueue = new VTTaskQueue($adb);
     $entityCache = new VTEntityCache($this->user);
     // set the time zone to the admin's time zone, this is needed so that the scheduled workflow will be triggered
     // at admin's time zone rather than the systems time zone. This is specially needed for Hourly and Daily scheduled workflows
     $admin = Users::getActiveAdminUser();
     $adminTimeZone = $admin->time_zone;
     @date_default_timezone_set($adminTimeZone);
     $currentTimestamp = date("Y-m-d H:i:s");
     @date_default_timezone_set($default_timezone);
     $scheduledWorkflows = $vtWorflowManager->getScheduledWorkflows($currentTimestamp);
     $noOfScheduledWorkflows = count($scheduledWorkflows);
     for ($i = 0; $i < $noOfScheduledWorkflows; ++$i) {
         $workflow = $scheduledWorkflows[$i];
         $tm = new VTTaskManager($adb);
         $tasks = $tm->getTasksForWorkflow($workflow->id);
         if ($tasks) {
             $records = $this->getEligibleWorkflowRecords($workflow);
             $noOfRecords = count($records);
             for ($j = 0; $j < $noOfRecords; ++$j) {
                 $recordId = $records[$j];
                 // We need to pass proper module name to get the webservice
                 if ($workflow->moduleName == 'Calendar') {
                     $moduleName = vtws_getCalendarEntityType($recordId);
                 } else {
                     $moduleName = $workflow->moduleName;
                 }
                 $wsEntityId = vtws_getWebserviceEntityId($moduleName, $recordId);
                 $entityData = $entityCache->forId($wsEntityId);
                 $data = $entityData->getData();
                 foreach ($tasks as $task) {
                     if ($task->active) {
                         $trigger = $task->trigger;
                         if ($trigger != null) {
                             $delay = strtotime($data[$trigger['field']]) + $trigger['days'] * 86400;
                         } else {
                             $delay = 0;
                         }
                         if ($task->executeImmediately == true) {
                             $task->doTask($entityData);
                         } else {
                             $taskQueue->queueTask($task->id, $entityData->getId(), $delay);
                         }
                     }
                 }
             }
         }
         $vtWorflowManager->updateNexTriggerTime($workflow);
     }
     $scheduledWorkflows = null;
 }
开发者ID:xrstf,项目名称:vtiger-mirror,代码行数:55,代码来源:WorkFlowScheduler.php

示例3: queueScheduledWorkflowTasks

 public function queueScheduledWorkflowTasks()
 {
     global $default_timezone;
     $adb = $this->db;
     $vtWorflowManager = new VTWorkflowManager($adb);
     $entityCache = new VTEntityCache($this->user);
     // set the time zone to the admin's time zone, this is needed so that the scheduled workflow will be triggered
     // at admin's time zone rather than the systems time zone. This is specially needed for Hourly and Daily scheduled workflows
     $admin = Users::getActiveAdminUser();
     $adminTimeZone = $admin->time_zone;
     @date_default_timezone_set($adminTimeZone);
     $currentTimestamp = date("Y-m-d H:i:s");
     @date_default_timezone_set($default_timezone);
     $scheduledWorkflows = $vtWorflowManager->getScheduledWorkflows($currentTimestamp);
     $noOfScheduledWorkflows = count($scheduledWorkflows);
     for ($i = 0; $i < $noOfScheduledWorkflows; ++$i) {
         $workflow = $scheduledWorkflows[$i];
         if ($workflow->active != 1) {
             continue;
         }
         $tm = new VTTaskManager($adb);
         $tasks = $tm->getTasksForWorkflow($workflow->id);
         if ($tasks) {
             $records = $this->getEligibleWorkflowRecords($workflow);
             $noOfRecords = count($records);
             for ($j = 0; $j < $noOfRecords; ++$j) {
                 $recordId = $records[$j];
                 // We need to pass proper module name to get the webservice
                 if ($workflow->moduleName == 'Calendar') {
                     $moduleName = vtws_getCalendarEntityType($recordId);
                 } else {
                     $moduleName = $workflow->moduleName;
                 }
                 $wsEntityId = vtws_getWebserviceEntityId($moduleName, $recordId);
                 $entityData = $entityCache->forId($wsEntityId);
                 $tm->performTasks($entityData, false);
             }
         }
         $vtWorflowManager->updateNexTriggerTime($workflow);
     }
     $scheduledWorkflows = null;
 }
开发者ID:Wasage,项目名称:werpa,代码行数:42,代码来源:WorkFlowScheduler.php


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