-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Workflow] Added explaination on context in events and initial marking #14678
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
Changes from 5 commits
82a94f7
a3fd749
85ae576
c0062ea
3e7f249
1bd334a
3ec9197
a4fce22
7b0d118
d6480bb
a8961ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 workflow, you can call ``getMarking``:: | ||||||
|
If you want to initiate your workflow, you can call ``getMarking``:: | |
If you want to initiate your workflow, you can call ``getMarking()`` method:: |
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.
And I'm not super confortable with this sentence. What does mean "initiate your workflow"?
I do understand what you want to say, but for new comers, it could be confusing.
What about something like
When the object enter the workflow for the first time, the workflow will initialize the
property
with theinitial_place
.
If you want to have always a valid marking in your database, you can use thegetMarking()
method to initialize the object property with the initial place::
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.
I'm not sure I understand this sentence : When the object enter the workflow for the first time, the workflow will initialize the property with the initial_place.
And instead of initial_place
, I think we should use initial_marking
as in the configuration : https://symfony.com/doc/current/workflow.html#configuration
So, I would say :
If the property of your object is null and you want to set it with the
initial_marking
in the configuration, you can call thegetMarking()
method to initialize le object property::
WDYT ?
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.
you are right about initial marking :) I used the old name, sorry.
You sentence is correct, let's go for it.
Minor detail:
- in the configuration
+ from the configuration
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.
DONE !
If it's ok for you, I let you resolve the conversation and maybe... merge the PR ?
Uh oh!
There was an error while loading. Please reload this page.