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


PHP CBPRuntime::SendExternalEvent方法代码示例

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


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

示例1: OnEvent

 public static function OnEvent($workflowId, $eventName, $arEventParameters = array())
 {
     $num = func_num_args();
     if ($num > 3) {
         for ($i = 3; $i < $num; $i++) {
             $arEventParameters[] = func_get_arg($i);
         }
     }
     if ($arEventParameters["EntityId"] != null && $arEventParameters["EntityId"] != $arEventParameters[0]) {
         return;
     }
     try {
         CBPRuntime::SendExternalEvent($workflowId, $eventName, $arEventParameters);
     } catch (Exception $e) {
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:schedulerservice.php

示例2: OnUnlockDocument

 public static function OnUnlockDocument($workflowId, $eventName, $documentId = array())
 {
     CBPRuntime::SendExternalEvent($workflowId, $eventName, array());
 }
开发者ID:rasuldev,项目名称:torino,代码行数:4,代码来源:documentservice.php

示例3: PostTaskForm

 public static function PostTaskForm($arTask, $userId, $arRequest, &$arErrors, $userName = "", $realUserId = null)
 {
     $arErrors = array();
     try {
         $userId = intval($userId);
         if ($userId <= 0) {
             throw new CBPArgumentNullException("userId");
         }
         $arEventParameters = array("USER_ID" => $userId, "REAL_USER_ID" => $realUserId, "USER_NAME" => $userName, "COMMENT" => isset($arRequest["task_comment"]) ? $arRequest["task_comment"] : '');
         if (isset($arRequest['INLINE_USER_STATUS']) && $arRequest['INLINE_USER_STATUS'] != CBPTaskUserStatus::Ok) {
             throw new CBPNotSupportedException(GetMessage("BPAA_ACT_NO_ACTION"));
         }
         CBPRuntime::SendExternalEvent($arTask["WORKFLOW_ID"], $arTask["ACTIVITY_NAME"], $arEventParameters);
         return true;
     } catch (Exception $e) {
         $arErrors[] = array("code" => $e->getCode(), "message" => $e->getMessage(), "file" => $e->getFile() . " [" . $e->getLine() . "]");
     }
     return false;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:19,代码来源:reviewactivity.php

示例4: PostTaskForm

 public static function PostTaskForm($arTask, $userId, $arRequest, &$arErrors, $userName = "", $realUserId = null)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $runtime->StartRuntime();
     $documentService = $runtime->GetService("DocumentService");
     try {
         $userId = intval($userId);
         if ($userId <= 0) {
             throw new CBPArgumentNullException("userId");
         }
         $arEventParameters = array("USER_ID" => $userId, "REAL_USER_ID" => $realUserId, "USER_NAME" => $userName, "COMMENT" => $arRequest["task_comment"], "RESPONCE" => array());
         if ($arTask["PARAMETERS"] && is_array($arTask["PARAMETERS"]) && count($arTask["PARAMETERS"]) > 0 && $arTask["PARAMETERS"]["REQUEST"] && is_array($arTask["PARAMETERS"]["REQUEST"]) && count($arTask["PARAMETERS"]["REQUEST"]) > 0) {
             $arRequest = $_REQUEST;
             foreach ($_FILES as $k => $v) {
                 if (array_key_exists("name", $v)) {
                     if (is_array($v["name"])) {
                         $ks = array_keys($v["name"]);
                         for ($i = 0, $cnt = count($ks); $i < $cnt; $i++) {
                             $ar = array();
                             foreach ($v as $k1 => $v1) {
                                 $ar[$k1] = $v1[$ks[$i]];
                             }
                             $arRequest[$k][] = $ar;
                         }
                     } else {
                         $arRequest[$k] = $v;
                     }
                 }
             }
             foreach ($arTask["PARAMETERS"]["REQUEST"] as $parameter) {
                 $arErrorsTmp = array();
                 $arEventParameters["RESPONCE"][$parameter["Name"]] = $documentService->GetFieldInputValue($arTask["PARAMETERS"]["DOCUMENT_TYPE"], $parameter, $parameter["Name"], $arRequest, $arErrorsTmp);
                 if (count($arErrorsTmp) > 0) {
                     $m = "";
                     foreach ($arErrorsTmp as $e) {
                         $m .= $e["message"] . "<br />";
                     }
                     throw new CBPArgumentException($m);
                 }
                 if (CBPHelper::getBool($parameter['Required']) && CBPHelper::isEmptyValue($arEventParameters['RESPONCE'][$parameter['Name']])) {
                     throw new CBPArgumentNullException($parameter["Name"], str_replace("#PARAM#", htmlspecialcharsbx($parameter["Title"]), GetMessage("BPRIA_ARGUMENT_NULL")));
                 }
             }
         }
         CBPRuntime::SendExternalEvent($arTask["WORKFLOW_ID"], $arTask["ACTIVITY_NAME"], $arEventParameters);
         return true;
     } catch (Exception $e) {
         $arErrors[] = array("code" => $e->getCode(), "message" => $e->getMessage(), "file" => $e->getFile() . " [" . $e->getLine() . "]");
     }
     return false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon,代码行数:52,代码来源:requestinformationactivity.php

示例5: PostTaskForm

 public static function PostTaskForm($arTask, $userId, $arRequest, &$arErrors, $userName = "")
 {
     $arErrors = array();
     try {
         $userId = intval($userId);
         if ($userId <= 0) {
             throw new CBPArgumentNullException("userId");
         }
         $arEventParameters = array("USER_ID" => $userId, "USER_NAME" => $userName, "COMMENT" => $arRequest["task_comment"]);
         if (strlen($arRequest["approve"]) > 0) {
             $arEventParameters["APPROVE"] = true;
         } elseif (strlen($arRequest["nonapprove"]) > 0) {
             $arEventParameters["APPROVE"] = false;
         } else {
             throw new CBPNotSupportedException(GetMessage("BPAA_ACT_NO_ACTION"));
         }
         CBPRuntime::SendExternalEvent($arTask["WORKFLOW_ID"], $arTask["ACTIVITY_NAME"], $arEventParameters);
         return true;
     } catch (Exception $e) {
         $arErrors[] = array("code" => $e->getCode(), "message" => $e->getMessage(), "file" => $e->getFile() . " [" . $e->getLine() . "]");
     }
     return false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:23,代码来源:approveactivity.php

示例6: SendExternalEvent

	/**
	* Метод отправляет событие рабочему потоку.
	*
	* @param string $workflowId - код рабочего потока.
	* @param string $workflowEvent - событие.
	* @param array $arParameters - параметры события.
	* @param array $arErrors - массив ошибок, которые произошли при отправке события в виде array(array("code" => код_ошибки, "message" => сообщение, "file" => путь_к_файлу), ...).
	*/
	public function SendExternalEvent($workflowId, $workflowEvent, $arParameters, &$arErrors)
	{
		$arErrors = array();

		try
		{
			CBPRuntime::SendExternalEvent($workflowId, $workflowEvent, $arParameters);
		}
		catch(Exception $e)
		{
			$arErrors[] = array(
				"code" => $e->getCode(),
				"message" => $e->getMessage(),
				"file" => $e->getFile()." [".$e->getLine()."]"
			);
		}
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:25,代码来源:document.php


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