Skip to content

[Workflow][Profiler] No information from chainned transition #59748

@jbcr

Description

@jbcr

Symfony version(s) affected

6.4.18

Description

In the workflow profiler, I have information for calls can and apply about the transition to_state2 but no information about to_state3 transition.

How to reproduce

Workflow:

my_workflow:
  type: state_machine
  marking_store:
      type: method
      property: state
  supports:
    - MyClass
  places:
    - state1
    - state2
    - state3
  
  transitions:
    to_state2:
      from: state1
      to: state2
    to_state3:
      from: state2
      to: state3

Event listener/subscriber:

use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class ContinueToState3 implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            'workflow.my_workflow.completed.to_state2' => ['terminateOrder', \PHP_INT_MIN],
        ];
    }

    public function terminateOrder(Event $event): void
    {
        $workflow = $event->getWorkflow();
        $subject = $event->getSubject();
        if ($workflow->can($subject, 'to_state3')) {
            $workflow->apply($subject, 'to_state3');
        }
    }
}

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions