public function handleEvent(EventInterface $event)
 {
     $affected_entities = parent::handleEvent($event);
     if ($event instanceof WorkflowProceededEvent && !$affected_entities->isEmpty()) {
         // @todo add the origin type_prefix to the payload so we can
         // decide the relation state transition based on the origin type
         $payload = ['origin_state' => $event->getWorkflowState()];
         foreach ($affected_entities as $affected_entity) {
             $payload['affected_entities'][] = ['identifier' => $affected_entity->getIdentifier(), 'revision' => $affected_entity->getRevision(), 'state' => $affected_entity->getWorkflowState(), 'type_prefix' => $affected_entity->getType()->getPrefix()];
         }
         $process_state = new ProcessState(['process_name' => $this->config->get('process_name'), 'payload' => $payload]);
         if ($this->config->get('pass_event', false)) {
             $this->process_manager->beginProcess($process_state, $event);
         } else {
             $this->process_manager->beginProcess($process_state);
         }
     }
 }
 public function testHandleCreateEvents()
 {
     // Relation projection updater should not handle creation events
     $mock_storage_writer_map = Mockery::mock(StorageWriterMap::CLASS)->shouldNotReceive('getItem')->mock();
     $mock_query_service_map = Mockery::mock(QueryServiceMap::CLASS)->shouldNotReceive('getItem')->mock();
     $mock_event_bus = Mockery::mock(EventBus::CLASS)->shouldNotReceive('distribute')->mock();
     // prepare and test subject
     $relation_projection_updater = new RelationProjectionUpdater(new ArrayConfig([]), new NullLogger(), $mock_storage_writer_map, $mock_query_service_map, $this->projection_type_map, $mock_event_bus);
     $event = $this->buildEvent(['@type' => 'Honeybee\\Projection\\Event\\ProjectionCreatedEvent', 'uuid' => '44c4597c-f463-4916-a330-2db87ef36547', 'projection_type' => 'honeybee_tests.game_schema.player::projection.standard', 'projection_identifier' => 'honeybee.fixtures.player-a726301d-dbae-4fb6-91e9-a19188a17e71-de_DE-1', 'data' => []]);
     $relation_projection_updater->handleEvent($event);
 }