CBPRuntime :: GetWorkflow: Bitrix method

      
<?php 
//  CBPRuntime :: GetWorkflow()
//  /dist/bitrix/modules/bizproc/classes/general/runtime.php:290

    
public function GetWorkflow($workflowId$silent false)
    {
        if (
strlen($workflowId) <= 0)
            throw new 
Exception("workflowId");

        if (!
$this->isStarted)
            
$this->StartRuntime();

        if (
array_key_exists($workflowId$this->arWorkflows))
            return 
$this->arWorkflows[$workflowId];

        
$workflow = new CBPWorkflow($workflowId$this);

        
$persister CBPWorkflowPersister::GetPersister();
        
$rootActivity $persister->LoadWorkflow($workflowId$silent);
        if (
$rootActivity == null)
            throw new 
Exception("Empty root activity");

        
$workflow->Reload($rootActivity);

        
$this->arWorkflows[$workflowId] = $workflow;
        return 
$workflow;
    }