當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CBPActivity::Execute方法代碼示例

本文整理匯總了PHP中CBPActivity::Execute方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBPActivity::Execute方法的具體用法?PHP CBPActivity::Execute怎麽用?PHP CBPActivity::Execute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CBPActivity的用法示例。


在下文中一共展示了CBPActivity::Execute方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: RunQueuedItem

 private function RunQueuedItem(CBPActivity $activity, $activityOperation, Exception $exception = null)
 {
     if ($activityOperation == CBPActivityExecutorOperationType::Execute) {
         if ($activity->executionStatus == CBPActivityExecutionStatus::Executing) {
             try {
                 $trackingService = $this->GetService("TrackingService");
                 $trackingService->Write($this->GetInstanceId(), CBPTrackingType::ExecuteActivity, $activity->GetName(), $activity->executionStatus, $activity->executionResult, $activity->IsPropertyExists("Title") ? $activity->Title : "", "");
                 $newStatus = $activity->Execute();
                 if ($newStatus == CBPActivityExecutionStatus::Closed) {
                     $this->CloseActivity($activity);
                 } elseif ($newStatus != CBPActivityExecutionStatus::Executing) {
                     throw new Exception("InvalidExecutionStatus");
                 }
             } catch (Exception $e) {
                 throw $e;
             }
         }
     } elseif ($activityOperation == CBPActivityExecutorOperationType::Cancel) {
         if ($activity->executionStatus == CBPActivityExecutionStatus::Canceling) {
             try {
                 $trackingService = $this->GetService("TrackingService");
                 $trackingService->Write($this->GetInstanceId(), CBPTrackingType::CancelActivity, $activity->GetName(), $activity->executionStatus, $activity->executionResult, $activity->IsPropertyExists("Title") ? $activity->Title : "", "");
                 $newStatus = $activity->Cancel();
                 if ($newStatus == CBPActivityExecutionStatus::Closed) {
                     $this->CloseActivity($activity);
                 } elseif ($newStatus != CBPActivityExecutionStatus::Canceling) {
                     throw new Exception("InvalidExecutionStatus");
                 }
             } catch (Exception $e) {
                 throw $e;
             }
         }
     } elseif ($activityOperation == CBPActivityExecutorOperationType::HandleFault) {
         if ($activity->executionStatus == CBPActivityExecutionStatus::Faulting) {
             try {
                 $trackingService = $this->GetService("TrackingService");
                 $trackingService->Write($this->GetInstanceId(), CBPTrackingType::FaultActivity, $activity->GetName(), $activity->executionStatus, $activity->executionResult, $activity->IsPropertyExists("Title") ? $activity->Title : "", $exception != null ? "[" . $exception->getCode() . "] " . $exception->getMessage() : "");
                 $newStatus = $activity->HandleFault($exception);
                 if ($newStatus == CBPActivityExecutionStatus::Closed) {
                     $this->CloseActivity($activity);
                 } elseif ($newStatus != CBPActivityExecutionStatus::Faulting) {
                     throw new Exception("InvalidExecutionStatus");
                 }
             } catch (Exception $e) {
                 throw $e;
             }
         }
     }
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:49,代碼來源:workflow.php


注:本文中的CBPActivity::Execute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。