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

Added missing events description#7528

Guite wants to merge3 commits intosymfony:3.3fromGuite:workflow-events

Conversation

@Guite
Copy link
Contributor

This PR adds descriptions for all events dispatched by the workflow component.

Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@Guite thanks for your contribution!

Although I don't use the Workflow component, I've proposed some changes. The reason is that we must be extra careful when describing an event to explain exactly when it's triggered. That's why I used "just before" and "just after" in the description. Please tell me if I did it right. Thanks!

@Guite
Copy link
ContributorAuthor

@javiereguiluz looks fine for me, but should be reviewed by someone who is more experienced with the internals.

The following events are dispatched for all workflows:

* ``workflow.guard``: occurs just before starting a transition. It allows you to
prevent the transition by calling ``$event->setBlocked(true);`` as shown above.
Copy link
Contributor

@HeahDudeHeahDudeFeb 27, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It is also fired when testing available transitions.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@HeahDude added


* ``workflow.guard``: occurs just before starting a transition. It allows you to
prevent the transition by calling ``$event->setBlocked(true);`` as shown above.
* ``workflow.leave``: occurs just after an object has left it's current state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We should mention that all events give carries the subject and the transition.
Also I think we should clarify what state is available in the event:

* ``workflow.leave``: carries the marking with the initial places, occurs just before the transition.* ``workflow.transition``: carries the marking with the current places, occurs during the transition.* ``workflow.enter``: carries the marking with the new places, occurs just after the transition.

Actually while checking this I've openedsymfony/symfony#21793.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@HeahDude added

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks@Guite, I've made some other comments, but please wait for other members opinion before doing any changes, as we also need to see ifsymfony/symfony#21793 gets merged.

* ``workflow.transition``: occurs just before starting to transition to the new state.
* ``workflow.enter``: occurs just after the object has entered into the new state.
* ``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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

it's =>its.

To avoid confusion, maybe we should not use "initial" and say something like:
carries the marking with the places held before an object leaves it's current state.

* ``workflow.enter``: occurs just after the object has entered into the new state.
* ``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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

carries the marking with the places held just after leaving the previous state, and just before entering into the new state.

* ``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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This one needs no "correction", but to be consistent with others, what about:
carries the marking with the places held after the object has entered into the new state.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sosymfony/symfony#21793 is merged now and this should be reworded to:

carries the marking with the current places, occurs just before the object enters into the new places.

lyrixx added a commit to symfony/symfony that referenced this pull requestMar 8, 2017
…HeahDude)This PR was merged into the 3.2 branch.Discussion----------[Workflow] Fixed marking state on leave and enter events| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | ~| License       | MIT| Doc PR        | related tosymfony/symfony-docs#7528It seems weird to me to dispatch an event while the marking is not yet marked by the new places.The event is still "marked" by old places when leaving occurs, my guess is that the symmetry should be mirrored.Do you agree? Should I add a test?Commits-------175858a [Workflow] Fixed marking state on leave and enter events
@lyrixx
Copy link
Member

The PR has been merged.

And BTW, if you can add a note in the doc aboutsymfony/symfony#21925 it would be awesome !

@HeahDude
Copy link
Contributor

The change@lyrixx suggests should be done in another PR targeting master since this one needs to be merged in 3.2.

@HeahDudeHeahDude added this to the3.2 milestoneMar 9, 2017
@GuiteGuite changed the base branch frommaster to3.3August 4, 2017 14:01
@javiereguiluz
Copy link
Member

This is ready for the final review. Thanks!

@Guite
Copy link
ContributorAuthor

This is rebased for3.3 now.

Should I addentered andaccounce, too? (since these events have been introduced in 3.3, too, I think)

@xabbuh
Copy link
Member

I think this should be rearranged to fit with the existingUsing Events section.

@Guite
Copy link
ContributorAuthor

@xabbuh you are right.

I think this one can be closed, since the existing section covers the whole topic already.

@xabbuh
Copy link
Member

@Guite Thanks for the feedback. Closing then. If you want to add more information to the existing section, please feel free to create new PRs. :)

@xabbuhxabbuh closed thisAug 9, 2017
@GuiteGuite deleted the workflow-events branchAugust 9, 2017 12:54
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

+1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

6 participants

@Guite@lyrixx@HeahDude@javiereguiluz@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp