CBPSchedulerService :: SubscribeOnEvent: Bitrix method

      
<?php 
//  CBPSchedulerService :: SubscribeOnEvent()
//  /dist/bitrix/modules/bizproc/classes/general/schedulerservice.php:113

    
public function SubscribeOnEvent($workflowId$eventHandlerName$eventModule$eventName$entityId null)
    {
        
$entityKey null;
        if (
is_array($entityId))
        {
            foreach (
$entityId as $entityKey => $entityId)
                break;
        }
        elseif (
$entityId !== null)
        {
            
$entityKey 0;
        }

        if (!
SchedulerEventTable::isSubscribed($workflowId$eventHandlerName$eventModule$eventName$entityId))
        {
            
SchedulerEventTable::add(array(
                
'WORKFLOW_ID' => (string)$workflowId,
                
'HANDLER' => (string)$eventHandlerName,
                
'EVENT_MODULE' => (string)$eventModule,
                
'EVENT_TYPE' => (string)$eventName,
                
'ENTITY_ID' => (string)$entityId
            
));
        }

        
RegisterModuleDependences(
            
$eventModule,
            
$eventName,
            
'bizproc',
            
'CBPSchedulerService',
            
'sendEvents',
            
100,
            
'',
            array(
$eventModule$eventName$entityKey)
        );
    }