- Deprecate
Event::getWorkflow()method
- Add method
getEnabledTransition()toWorkflowInterface - Automatically register places from transitions
- Add support for workflows that need to store many tokens in the marking
- Add method
getName()in event classes to build event names in subscribers
- Require explicit argument when calling
Definition::setInitialPlaces() GuardEvent::getContext()method has been removed. Method was not supposed to be called within guard event listeners as it always returned an empty array anyway.- Remove
GuardEvent::getContext()method without replacement
- Add
with-metadataoption to theworkflow:dumpcommand to include places, transitions and workflow's metadata into dumped graph - Add support for storing marking in a property
- Add a profiler
- Add support for multiline descriptions in PlantUML diagrams
- Add PHP attributes to register listeners and guards
- Deprecate
GuardEvent::getContext()method that will be removed in 7.0 - Revert: Mark
Symfony\Component\Workflow\Registryas internal - Add
WorkflowGuardListenerPass(moved fromFrameworkBundle)
- Mark
Symfony\Component\Workflow\Registryas internal - Deprecate calling
Definition::setInitialPlaces()without arguments
- Remove
InvalidTokenConfigurationException
- Add support for getting updated context after a transition
- Deprecate
InvalidTokenConfigurationException - Added
MermaidDumperto dump Workflow graphs in the Mermaid.js flowchart format
- Added
Workflow::getEnabledTransition()to easily retrieve a specific transition object - Added context to the event dispatched
- Dispatch an event when the subject enters in the workflow for the very first time
- Added a default context to the previous event
- Added support for specifying which events should be dispatched when calling
workflow->apply()
- Added context to
TransitionExceptionand its child classes whenever they are thrown inWorkflow::apply() - Added
Registry::has()to check if a workflow exists - Added support for
$context[Workflow::DISABLE_ANNOUNCE_EVENT] = truewhen callingworkflow->apply()to not fire the announce event
- Added argument
$contexttoMarkingStoreInterface::setMarking()
- Marked all dispatched event classes as
@final
-
Trigger
enteredevent for subject entering in the Workflow for the first time. -
Added a context to
Workflow::apply(). TheMethodMarkingStorecould be used to leverage this feature. -
The
TransitionEventis able to modify the context. -
Add style to transitions by declaring metadata:
use Symfony\Component\Workflow\Definition; use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
$transitionsMetadata = new \SplObjectStorage(); $transitionsMetadata[$transition] = [ 'color' => 'Red', 'arrow_color' => '#00ff00', ]; $inMemoryMetadataStore = new InMemoryMetadataStore([], [], $transitionsMetadata);
return new Definition($places, $transitions, null, $inMemoryMetadataStore);
-
Dispatch
GuardEventonworkflow.guard -
Dispatch
LeaveEventonworkflow.leave -
Dispatch
TransitionEventonworkflow.transition -
Dispatch
EnterEventonworkflow.enter -
Dispatch
EnteredEventonworkflow.entered -
Dispatch
CompletedEventonworkflow.completed -
Dispatch
AnnounceEventonworkflow.announce -
Added support for many
initialPlaces -
Deprecated
DefinitionBuilder::setInitialPlace()method, useDefinitionBuilder::setInitialPlaces()instead. -
Deprecated the
MultipleStateMarkingStoreclass, use theMethodMarkingStoreinstead. -
Deprecated the
SingleStateMarkingStoreclass, use theMethodMarkingStoreinstead.
- Deprecated the
DefinitionBuilder::reset()method, use theclear()one instead. - Deprecated the usage of
add(Workflow $workflow, $supportStrategy)inWorkflow/Registry, useaddWorkflow(WorkflowInterface, $supportStrategy)instead. - Deprecated the usage of
SupportStrategyInterface, useWorkflowSupportStrategyInterfaceinstead. - The
Workflowclass now implementsWorkflowInterface. - Deprecated the class
ClassInstanceSupportStrategyin favor of the classInstanceOfSupportStrategy. - Added TransitionBlockers as a way to pass around reasons why exactly transitions can't be made.
- Added a
MetadataStore. - Added
Registry::allto return all the workflows associated with the specific subject.
- Removed class name support in
WorkflowRegistry::add()as second parameter.
- Added guard
is_valid()method support. - Added support for
Event::getWorkflowName()for "announce" events. - Added
workflow.completedevents which are fired after a transition is completed.
- Added support for expressions to guard transitions and added an
is_granted()function that can be used in these expressions to use the authorization checker. - The
DefinitionBuilderclass now provides a fluent interface. - The
AuditTrailListenernow includes the workflow name in its log entries. - Added
workflow.enteredevents which is fired after the marking has been set. - Deprecated class name support in
WorkflowRegistry::add()as second parameter. Wrap the class name in an instance of ClassInstanceSupportStrategy instead. - Added support for
Event::getWorkflowName(). - Added
SupportStrategyInterfaceto allow custom strategies to decide whether or not a workflow supports a subject. - Added
ValidateWorkflowPass.