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


PHP CBPWorkflowTemplateLoader::GetLoader方法代碼示例

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


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

示例1: Delete

 public static function Delete($id)
 {
     $loader = CBPWorkflowTemplateLoader::GetLoader();
     $loader->DeleteTemplate($id);
     self::cleanTemplateCache($id);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:6,代碼來源:workflowtemplateloader.php

示例2: CreateWorkflow

 /**
  * Creates new workflow instance from the specified template.
  *
  * @param int $workflowTemplateId - ID of the workflow template
  * @param string $documentId - ID of the document
  * @param mixed $workflowParameters - Optional parameters of the created workflow instance
  * @param array|null $parentWorkflow - Parent Workflow information.
  * @return CBPWorkflow
  * @throws CBPArgumentNullException
  * @throws CBPArgumentOutOfRangeException
  * @throws Exception
  * @throws \Bitrix\Main\ArgumentNullException
  */
 public function CreateWorkflow($workflowTemplateId, $documentId, $workflowParameters = array(), $parentWorkflow = null)
 {
     $workflowTemplateId = intval($workflowTemplateId);
     if ($workflowTemplateId <= 0) {
         throw new Exception("workflowTemplateId");
     }
     $arDocumentId = CBPHelper::ParseDocumentId($documentId);
     $limit = \Bitrix\Main\Config\Option::get("bizproc", "limit_simultaneous_processes", "0");
     if (intval($limit) > 0) {
         if (CBPStateService::CountDocumentWorkflows($documentId) >= $limit) {
             throw new Exception(GetMessage("BPCGDOC_LIMIT_SIMULTANEOUS_PROCESSES", array("#NUM#" => $limit)));
         }
     }
     if (!$this->isStarted) {
         $this->StartRuntime();
     }
     $workflowId = uniqid("", true);
     if ($parentWorkflow) {
         $this->addWorkflowToChain($workflowId, $parentWorkflow);
         if ($this->checkWorkflowRecursion($workflowId, $workflowTemplateId)) {
             throw new Exception(GetMessage("BPCGDOC_WORKFLOW_RECURSION_LOCK"));
         }
     }
     $workflow = new CBPWorkflow($workflowId, $this);
     $loader = CBPWorkflowTemplateLoader::GetLoader();
     list($rootActivity, $workflowVariablesTypes, $workflowParametersTypes) = $loader->LoadWorkflow($workflowTemplateId);
     if ($rootActivity == null) {
         throw new Exception("EmptyRootActivity");
     }
     //if (!is_a($rootActivity, "IBPRootActivity"))
     //	throw new Exception("RootActivityIsNotAIBPRootActivity");
     foreach (GetModuleEvents("bizproc", "OnCreateWorkflow", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($workflowTemplateId, $documentId, &$workflowParameters));
     }
     $workflow->Initialize($rootActivity, $arDocumentId, $workflowParameters, $workflowVariablesTypes, $workflowParametersTypes, $workflowTemplateId);
     $starterUserId = 0;
     if (isset($workflowParameters[CBPDocument::PARAM_TAGRET_USER])) {
         $starterUserId = intval(substr($workflowParameters[CBPDocument::PARAM_TAGRET_USER], strlen("user_")));
     }
     $this->arServices["StateService"]->AddWorkflow($workflowId, $workflowTemplateId, $arDocumentId, $starterUserId);
     $this->arWorkflows[$workflowId] = $workflow;
     return $workflow;
 }
開發者ID:Satariall,項目名稱:izurit,代碼行數:56,代碼來源:runtime.php

示例3: CreateWorkflow

 /**
  * Creates new workflow instance from the specified template.
  * 
  * @param int $workflowTemplateId - ID of the workflow template
  * @param string $documentId - ID of the document
  * @param mixed $workflowParameters - Optional parameters of the created workflow instance
  * @return CBPWorkflow
  */
 public function CreateWorkflow($workflowTemplateId, $documentId, $workflowParameters = array())
 {
     $workflowTemplateId = intval($workflowTemplateId);
     if ($workflowTemplateId <= 0) {
         throw new Exception("workflowTemplateId");
     }
     $arDocumentId = CBPHelper::ParseDocumentId($documentId);
     if (!$this->isStarted) {
         $this->StartRuntime();
     }
     $workflowId = uniqid("", true);
     $workflow = new CBPWorkflow($workflowId, $this);
     $loader = CBPWorkflowTemplateLoader::GetLoader();
     list($rootActivity, $workflowVariablesTypes, $workflowParametersTypes) = $loader->LoadWorkflow($workflowTemplateId);
     if ($rootActivity == null) {
         throw new Exception("EmptyRootActivity");
     }
     //if (!is_a($rootActivity, "IBPRootActivity"))
     //	throw new Exception("RootActivityIsNotAIBPRootActivity");
     $events = GetModuleEvents("bizproc", "OnCreateWorkflow");
     while ($arEvent = $events->Fetch()) {
         ExecuteModuleEventEx($arEvent, array($workflowTemplateId, $documentId, &$workflowParameters));
     }
     $workflow->Initialize($rootActivity, $arDocumentId, $workflowParameters, $workflowVariablesTypes, $workflowParametersTypes);
     $starterUserId = 0;
     if (array_key_exists("TargetUser", $workflowParameters)) {
         $starterUserId = intval(substr($workflowParameters["TargetUser"], strlen("user_")));
     }
     $this->arServices["StateService"]->AddWorkflow($workflowId, $workflowTemplateId, $arDocumentId, $starterUserId);
     $this->arWorkflows[$workflowId] = $workflow;
     return $workflow;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:40,代碼來源:runtime.php


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