/**
  * Cleanup information about excluded definitions.
  *
  * @param ProcessHandleEvent $event
  */
 public function onProcessHandleAfterFlush(ProcessHandleEvent $event)
 {
     $excludeDefinitions = $event->getProcessTrigger()->getDefinition()->getExcludeDefinitions();
     foreach ($excludeDefinitions as $name) {
         if (isset($this->excludeDefinitions[$name]) && $this->excludeDefinitions[$name] > 0) {
             // As this event comes after "before" event, counter will eventually be 0.
             $this->excludeDefinitions[$name] -= 1;
         }
     }
 }
 /**
  * @param ProcessHandleEvent $event
  *
  * @throws \Exception
  */
 public function onProcessHandleAfter(ProcessHandleEvent $event)
 {
     $entity = $event->getProcessData()->get('data');
     if (!$entity instanceof MemberActivity) {
         return;
     }
     $this->processCollectorListener->setEnabled(false);
     try {
         $this->doctrineHelper->getEntityManager($entity)->flush($entity);
     } catch (\Exception $e) {
         $this->processCollectorListener->setEnabled(true);
         throw $e;
     }
     $this->processCollectorListener->setEnabled(true);
 }
 public function testGetProcessDataWorks()
 {
     $this->assertSame($this->processData, $this->event->getProcessData());
 }