-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
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: state3Event 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