CBPWorkflow :: Resume: Bitrix method

      
<?php 
//  CBPWorkflow :: Resume()
//  /dist/bitrix/modules/bizproc/classes/general/workflow.php:225

    
public function Resume()
    {
        if (
$this->GetWorkflowStatus() != CBPWorkflowStatus::Suspended)
            throw new 
Exception("CanNotResumeInstance");

        
$this->SetWorkflowStatus(CBPWorkflowStatus::Running);

        try
        {
            
$this->RunQueue();
        }
        catch (
Exception $e)
        {
            
$this->Terminate($e);
            throw 
$e;
        }

        if (
$this->rootActivity->executionStatus == CBPActivityExecutionStatus::Closed)
        {
            
$this->SetWorkflowStatus(CBPWorkflowStatus::Completed);
        }
        else
        {
            
$workflowStatus $this->GetWorkflowStatus();
            if (
$workflowStatus == CBPWorkflowStatus::Running)
                
$this->SetWorkflowStatus(CBPWorkflowStatus::Suspended);
        }

        
$persister CBPWorkflowPersister::GetPersister();
        
$persister->SaveWorkflow($this->rootActivitytrue);
    }