GetWorkflow
CBPWorkflow
public function CBPRuntime::GetWorkflow(
string workflowId
);
This method returns a workflow instance by its ID code.
Method parameters
Parameter | Description |
---|---|
workflowId | Workflow ID |
Returned value
Instance of CBPWorkflow class is returned, presenting an instance of existing workflow.
Exceptions
Code | Description |
---|---|
workflowId | Workflow ID code is not specified |
Empty root activity | Fail 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