Documentation

GetWorkflow

CBPWorkflow
public function CBPRuntime::GetWorkflow(
 string workflowId
);

This method returns a workflow instance by its ID code.

Method parameters

ParameterDescription
workflowIdWorkflow ID

Returned value

Instance of CBPWorkflow class is returned, presenting an instance of existing workflow.

Exceptions

CodeDescription
workflowIdWorkflow ID code is not specified
Empty root activityFail to restore workflow instance

Examples

<?

// Result is the document code for which the workflow is launched with the specified ID
$runtime = CBPRuntime::GetRuntime();
try
{
$workflow = $runtime->GetWorkflow($workflowId);
$d = $workflow->GetDocumentId();
}
catch(Exception $e)
{
//
}
?>


© «Bitrix24», 2001-2024