Skip to content

[Workflow] Mention that the initial marking is configured, not set in code #18812

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

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Changes from all 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
5 changes: 5 additions & 0 deletions workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ The configured property will be used via its implemented getter/setter methods b
{
$this->currentPlace = $currentPlace;
}

// you don't need to set the initial marking in the constructor or any other method;
// this is configured in the workflow with the 'initial_marking' option
}

.. note::
Expand Down Expand Up @@ -225,6 +228,8 @@ what actions are allowed on a blog post::
use Symfony\Component\Workflow\Exception\LogicException;

$post = new BlogPost();
// you don't need to set the initial marking with code; this is configured
// in the workflow with the 'initial_marking' option

$workflow = $this->container->get('workflow.blog_publishing');
$workflow->can($post, 'publish'); // False
Expand Down