CBPAllStateService :: onStatusChange: Bitrix method

      
<?php 
//  CBPAllStateService :: onStatusChange()
//  /dist/bitrix/modules/bizproc/classes/general/stateservice.php:158

    
public function onStatusChange($workflowId$status)
    {
        if (
$status == CBPWorkflowStatus::Completed || $status == CBPWorkflowStatus::Terminated)
        {
            
$info $this->getWorkflowStateInfo($workflowId);
            
$userId = isset($info['STARTED_BY']) ? (int)$info['STARTED_BY'] : 0;
            if (
$userId 0)
            {
                
self::cleanRunningCountersCache($userId);
            }

            foreach (
GetModuleEvents('bizproc''OnWorkflowComplete'true) as $event)
                
ExecuteModuleEventEx($event, array($workflowId$status));
        }
    }