private function processRealTime()
    {
        if (!$this->realTime || !$this->campaign || !$this->contact) {
            return;
        }

        $this->campaignExecutioner->execute($this->campaign, [$this->contact->getId()]);
        $this->contactCampaigns[$this->campaign->getId()] = true;

        // Retrieve events fired by MauticContactClientBundle (if any)
        $events = $this->session->get('mautic.contactClient.events', []);
        if (!empty($events)) {
            $this->eventErrors = [];
            foreach ($events as $event) {
                if (isset($event['contactId']) && $event['contactId'] !== $this->contact->getId()) {
                    // For not ignore/exclude all events not relating to the current contact.
                    continue;
                }
                $this->events[] = $event;
                if (!empty($event['error'])) {
                    $eventName = !empty($event['name']) ? $event['name'] : '';
                    if (!is_array($event['errors'])) {
                        $event['errors'] = [$event['errors']];
                    }
                    $this->eventErrors[] = $eventName.' ('.$event['id'].'): '.implode(', ', $event['errors']);
                }
                if (isset($event['valid']) && $event['valid']) {
                    // One valid Contact Client was found to accept the lead.
                    $this->status = Stat::TYPE_ACCEPTED;
                    $this->valid  = true;
                    break;
                }
            }
        }

        // There was no accepted client hit, consider this a rejection.
        // @todo - This is highly dependent on the contact client plugin, thus should be made configurable, or we can make the realTime mode only available to those with both plugins.
        if (!$this->valid) {
            // If one or more clients were found, but none accepted.
            // This should be considered a rejected contact.
            $this->status = Stat::TYPE_REJECT;
        }

        // Apply scrub only to accepted contacts in real-time mode after evaluation.
        if ($this->valid && $this->isScrubbed()) {
            $this->status = Stat::TYPE_SCRUBBED;
            $this->valid  = false;
        }
    }
private function processRealTime()
    {
        if (!$this->realTime || !$this->campaign || !$this->contact) {
            return;
        }

        $this->campaignExecutioner->execute($this->campaign, [$this->contact->getId()]);
        $this->contactCampaigns[$this->campaign->getId()] = true;

        // Retrieve events fired by MauticContactClientBundle (if any)
        $events = $this->session->get('mautic.contactClient.events', []);
        if (!empty($events)) {
            $this->eventErrors = [];
            foreach ($events as $event) {
                if (isset($event['contactId']) && $event['contactId'] !== $this->contact->getId()) {
                    // For not ignore/exclude all events not relating to the current contact.
                    continue;
                }
                $this->events[] = $event;
                if (!empty($event['error'])) {
                    $eventName = !empty($event['name']) ? $event['name'] : '';
                    if (!is_array($event['errors'])) {
                        $event['errors'] = [$event['errors']];
                    }
                    $this->eventErrors[] = $eventName.' ('.$event['id'].'): '.implode(', ', $event['errors']);
                }
                if (isset($event['valid']) && $event['valid']) {
                    // One valid Contact Client was found to accept the lead.
                    $this->status = Stat::TYPE_ACCEPTED;
                    $this->valid  = true;
                    break;
                }
            }
        }

        // There was no accepted client hit, consider this a rejection.
        // @todo - This is highly dependent on the contact client plugin, thus should be made configurable, or we can make the realTime mode only available to those with both plugins.
        if (!$this->valid) {
            // If one or more clients were found, but none accepted.
            // This should be considered a rejected contact.
            $this->status = Stat::TYPE_REJECT;
        }

        // Apply scrub only to accepted contacts in real-time mode after evaluation.
        if ($this->valid && $this->isScrubbed()) {
            $this->status = Stat::TYPE_SCRUBBED;
            $this->valid  = false;
        }
    }
private function processRealTime ( ) { if ( ! $ this -> realTime || ! $ this -> campaign || ! $ this -> contact ) { return ; } $ this -> campaignExecutioner -> execute ( $ this -> campaign , [ $ this -> contact -> getId ( ) ] ) ; $ this -> contactCampaigns [ $ this -> campaign -> getId ( ) ] = true ; // Retrieve events fired by MauticContactClientBundle (if any) $ events = $ this -> session -> get ( 'mautic.contactClient.events' , [ ] ) ; if ( ! empty ( $ events ) ) { $ this -> eventErrors = [ ] ; foreach ( $ events as $ event ) { if ( isset ( $ event [ 'contactId' ] ) && $ event [ 'contactId' ] !== $ this -> contact -> getId ( ) ) { // For not ignore/exclude all events not relating to the current contact. continue ; } $ this -> events [ ] = $ event ; if ( ! empty ( $ event [ 'error' ] ) ) { $ eventName = ! empty ( $ event [ 'name' ] ) ? $ event [ 'name' ] : '' ; if ( ! is_array ( $ event [ 'errors' ] ) ) { $ event [ 'errors' ] = [ $ event [ 'errors' ] ] ; } $ this -> eventErrors [ ] = $ eventName . ' (' . $ event [ 'id' ] . '): ' . implode ( ', ' , $ event [ 'errors' ] ) ; } if ( isset ( $ event [ 'valid' ] ) && $ event [ 'valid' ] ) { // One valid Contact Client was found to accept the lead. $ this -> status = Stat :: TYPE_ACCEPTED ; $ this -> valid = true ; break ; } } } // There was no accepted client hit, consider this a rejection. // @todo - This is highly dependent on the contact client plugin, thus should be made configurable, or we can make the realTime mode only available to those with both plugins. if ( ! $ this -> valid ) { // If one or more clients were found, but none accepted. // This should be considered a rejected contact. $ this -> status = Stat :: TYPE_REJECT ; } // Apply scrub only to accepted contacts in real-time mode after evaluation. if ( $ this -> valid && $ this -> isScrubbed ( ) ) { $ this -> status = Stat :: TYPE_SCRUBBED ; $ this -> valid = false ; } }
If real-time mode is enabled, process the lead through the campaign now,
to discern acceptance or rejection based upon the Clients in the workflow.

@throws \Doctrine\ORM\ORMException
@throws \Exception
If real - time mode is enabled process the lead through the campaign now to discern acceptance or rejection based upon the Clients in the workflow .