protected function createWorkflowActivity(AggregateRootTypeInterface $aggregate_root_type, $workflow_event)
 {
     $write_events = $this->service_locator->getWorkflowService()->getWriteEventNames();
     if (in_array($workflow_event, $write_events)) {
         $request_method = 'write';
         $activity_route = $aggregate_root_type->getPrefix() . '.resource.task.proceed';
     } else {
         $request_method = 'read';
         $activity_route = $aggregate_root_type->getPrefix() . '.resource.task';
     }
     return new Activity(['name' => $workflow_event, 'scope' => $aggregate_root_type->getPrefix(), 'label' => sprintf('%s.label', $workflow_event), 'type' => Activity::TYPE_WORKFLOW, 'description' => sprintf('%s.description', $workflow_event), 'verb' => $request_method, 'rels' => [$workflow_event, sprintf('%s_resource', $workflow_event)], 'settings' => new Settings(['form_id' => 'randomId-' . rand()]), 'url' => new Url(['type' => Url::TYPE_ROUTE, 'value' => $activity_route, 'parameters' => ['event' => $workflow_event]])]);
 }
 protected function getChronologicEventIterator(AggregateRootTypeInterface $aggregate_root_type)
 {
     $service_locator = $this->getContext()->getServiceLocator();
     $data_access_service = $service_locator->getDataAccessService();
     $reader_key = sprintf('%s::domain_event::event_source::reader', $aggregate_root_type->getPrefix());
     return $data_access_service->getStorageReader($reader_key);
 }
 public function getByAggregateRootType(AggregateRootTypeInterface $aggregate_root_type, $variant = ProjectionTypeInterface::DEFAULT_VARIANT)
 {
     return $this->getItem(sprintf('%s::projection.%s', $aggregate_root_type->getPrefix(), StringToolkit::asSnakeCase($variant)));
 }