-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added explaination on context in events and initial marking #13947
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@epitre Nice solution, which will indeed also solve the issue of the non-dispatched initial entered event. |
@epitre Perhaps you can also add a note about the initial marking option to make it clear it is optional and will default to the first place if not defined. |
it is explained here : https://github.com/symfony/symfony-docs/pull/13947/files#diff-c94d89e3669d4257383cfe5faf73e644R97 |
I was more referring to the config option Even if you do not instantiate the workflow by using Hope I am making sense? |
components/workflow.rst
Outdated
@@ -94,6 +94,16 @@ you can retrieve a workflow from it and use it as follows:: | ||
$workflow->can($blogPost, 'publish'); // True | ||
$workflow->getEnabledTransitions($blogPost); // $blogPost can perform transition "publish" or "reject" | ||
|
||
If you want to initiate your worflow, you can simply call ``getMarking``:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workflow
with k
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
This PR was merged into the 5.2-dev branch. Discussion ---------- [Workflow] Added Context to Workflow Event There's also a default context for the initial marking event. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #37421 | License | MIT | Doc PR | symfony/symfony-docs#13947 This time, I need context in the events, because, sometimes, the transition is automatic and sometimes, it is manual. I want to be able to make the difference. I figured using the context for that is a good idea. I hope you do too :) By the way, I believe it also fixes #37421 . I took @pluk77 request to be able to differentiate an initial marking by having a default context in that case Commits ------- bfe07dd Added Context to Workflow Event There's also a default context for the initial marking event.
This PR was merged into the 5.2-dev branch. Discussion ---------- [Workflow] Added Context to Workflow Event There's also a default context for the initial marking event. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #37421 | License | MIT | Doc PR | symfony/symfony-docs#13947 This time, I need context in the events, because, sometimes, the transition is automatic and sometimes, it is manual. I want to be able to make the difference. I figured using the context for that is a good idea. I hope you do too :) By the way, I believe it also fixes #37421 . I took @pluk77 request to be able to differentiate an initial marking by having a default context in that case Commits ------- bfe07dda83 Added Context to Workflow Event There's also a default context for the initial marking event.
FYI, The pull request has been merged |
This PR has been closed because the master has been removed. |
@nicolas-grekas I thought it was merge as said by @lyrixx ? Anyway, I made a new PR : #14678 |
I think @lyrixx meant that the feature has been merged on the code side (but not on the doc side.) |
No description provided.