CBPRestActivity :: Subscribe: Bitrix method

      
<?php 
//  CBPRestActivity :: Subscribe()
//  /dist/bitrix/modules/bizproc/classes/general/restactivity.php:219

    
public function Subscribe(IBPActivityExternalEventListener $eventHandler)
    {
        if (
$eventHandler == null)
            throw new 
Exception('eventHandler');

        
$timeoutDuration $this->CalculateTimeoutDuration();
        if (
$timeoutDuration 0)
        {
            
$schedulerService $this->workflow->GetService('SchedulerService');
            
$this->subscriptionId $schedulerService->SubscribeOnTime($this->workflow->GetInstanceId(), $this->nametime() + $timeoutDuration);
        }

        
$this->workflow->AddEventHandler($this->name$eventHandler);
    }