Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added missing events description#7528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Guite wants to merge3 commits intosymfony:3.3fromGuite:workflow-events
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletionsworkflow/usage.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -222,6 +222,37 @@ could easily enable logging::
$subscriber = new AuditTrailListener($logger);
$dispatcher->addSubscriber($subscriber);

Available events
----------------

1. General events

The following events are dispatched for all workflows:

* ``workflow.guard``: occurs just before a transition is started and when testing which transitions are available. It allows you to define that the transition is not allowed by calling ``$event->setBlocked(true);`` as shown above.
* ``workflow.leave``: carries the marking with the initial places, occurs just after an object has left it's current state.
* ``workflow.transition``: carries the marking with the current places, occurs just before starting to transition to the new state.
* ``workflow.enter``: carries the marking with the new places, occurs just after the object has entered into the new state.

2. Workflow-specific events

All the previous events are also triggered for each workflow individually, so
you can react only to the events of a specific workflow:

* ``workflow.<workflow_name>.guard``
* ``workflow.<workflow_name>.leave``
* ``workflow.<workflow_name>.transition``
* ``workflow.<workflow_name>.enter``

3. Transition or state-specific events

You can even listen to some specific transitions or states for a specific workflow:

* ``workflow.<workflow_name>.guard.<transition_name>``
* ``workflow.<workflow_name>.leave.<state_name>``
* ``workflow.<workflow_name>.transition.<transition_name>``
* ``workflow.<workflow_name>.enter.<state_name>``

Usage in Twig
-------------

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp