EnterEvent example

$this->dispatcher->dispatch($eventsprintf('workflow.%s.transition', $this->name));
        $this->dispatcher->dispatch($eventsprintf('workflow.%s.transition.%s', $this->name, $transition->getName()));

        return $event->getContext();
    }

    private function enter(object $subject, Transition $transition, Marking $marking, array $context): void
    {
        $places = $transition->getTos();

        if ($this->shouldDispatchEvent(WorkflowEvents::ENTER, $context)) {
            $event = new EnterEvent($subject$marking$transition$this$context);

            $this->dispatcher->dispatch($event, WorkflowEvents::ENTER);
            $this->dispatcher->dispatch($eventsprintf('workflow.%s.enter', $this->name));

            foreach ($places as $place) {
                $this->dispatcher->dispatch($eventsprintf('workflow.%s.enter.%s', $this->name, $place));
            }
        }

        foreach ($places as $place) {
            $marking->mark($place);
        }
Home | Imprint | This part of the site doesn't use cookies.