Problem/Motivation
Currently, transitions in this module are triggered automatically without a granular way to programmatically restrict their applicability based on custom business logic. This limits flexibility in real-world workflows where automated transitions should only occur under specific conditions.
Example use case
Automatically transition an order to "Completed" only if the order total is over $0 and there are no pending shipments.
Proposed resolution
Introduce an Automator API allowing developers to define logic that determines whether a transition is allowed, forbidden, or neutral (i.e., not handled). The result is conceptually similar to a Guard, but applied to automated transitions only.
Key details:
A new TransitionAutomatorInterface will define a method such as allowed
Automators return one of three possible outcomes:
Allowed
Forbidden
Neutral (fallback/default if the automator is not concerned with this transition)
Multiple automators can be defined and tagged; the system will evaluate them in sequence or in aggregate.
If any automator returns Forbidden, the transition is skipped.
If at least one returns Allowed and none are Forbidden, the transition proceeds.
If all return Neutral, the transition proceeds by default (configurable).
This would allow fine-grained, reusable control over transition logic.