Documentation

SendExternalEvent

void
public function CBPDocument::SendExternalEvent(
 string workflowId,
 string workflowEvent,
 array arParameters,
 array &arErrors
);

This method sends an external event to a workflow.

Note: This method receives an array of configuration parameters and generates scripts, required to show file dialog. Static method.

Method parameters

ParameterDescription
workflowIdWorkflow ID code
workflowEventEvent name
arParametersEvent parameters
arErrorsArray of error that occurred when sending events as follows
array(
array(
"code" => error_code,
"message" => message,
"file" => path_to_file
),
...
)

See Also

Examples of use

<?
$arCurrentUserGroups = $GLOBALS["USER"]->GetUserGroupArray();
if ($GLOBALS["USER"]->GetID() == $createdBy)
$arCurrentUserGroups[] = "Author";

$arErrorTmp = array();

CBPDocument::SendExternalEvent(
$bizprocId,
$bizprocEvent,
array("Groups" => $arCurrentUserGroups, "User" => $GLOBALS["USER"]->GetID()),
$arErrorTmp
);

if (count($arErrorsTmp) > 0)
{
foreach ($arErrorsTmp as $e)
$fatalErrorMessage .= $e["message"].". ";
}
?>


© «Bitrix24», 2001-2024
Up