Documentation

TerminateWorkflow

void
public static function CBPDocument::TerminateWorkflow(
 string workflowId,
 array documentId,
 array &arErrors
);

This method stops completion of 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
documentIdDocument ID code as an array(module, document_class, document_code_in_module)
arErrorsArray of errors, if workflow stopped as follows
array(
array(
"code" => error_code,
"message" => message,
"file" => path_to_file
),
...
)

Examples

<?
$arState = CBPStateService::GetWorkflowState($stopWorkflowId);
if (count($arState) > 0)
{
CBPDocument::TerminateWorkflow(
$stopWorkflowId,
$arState["DOCUMENT_ID"],
$arErrorsTmp
);

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


© «Bitrix24», 2001-2024
Up