Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Incorporate feedback from @lyrixx
  • Loading branch information
pbowyer committed Apr 7, 2019
commit 6cac400bfb9e87fc37e9cc6ee04d8a8548fd187b
38 changes: 19 additions & 19 deletions workflow/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ like this:
audit_trail:
enabled: true
marking_store:
type: 'method'
arguments:
- false
- 'currentPlace'
# Method will become the default value in Symfony 5.0
type: method
property: currentPlace
supports:
- App\Entity\BlogPost
initial_places: [draft]
initial_marking: [draft]
places:
- draft
- review
Expand Down Expand Up @@ -81,10 +80,9 @@ like this:
<framework:workflow name="blog_publishing" type="workflow">
<framework:audit-trail enabled="true"/>

<framework:marking-store type="method">
<framework:argument>false</framework:argument>
<framework:argument>currentPlace</framework:argument>
</framework:marking-store>
<framework:initial-marking>draft</framework:initial-marking>
<!-- Method will become the default value in Symfony 5.0 -->
<framework:marking-store type="method" property="state" />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't use XML config, can someone please provide the initial_places code for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to add it in the code doc.
Here is the final ref

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe I've done this correctly!

<framework:support>App\Entity\BlogPost</framework:support>

Expand Down Expand Up @@ -129,14 +127,12 @@ like this:
'enabled' => true
],
'marking_store' => [
// Method will become the default value in Symfony 5.0
'type' => 'method',
'arguments' => [
false,
'currentPlace',
],
'property' => 'currentPlace',
],
'supports' => ['App\Entity\BlogPost'],
'initial_places' => ['draft'],
'initial_marking' => ['draft'],
'places' => [
'draft',
'review',
Expand Down Expand Up @@ -174,14 +170,18 @@ As configured, the following property is used by the marking store::
.. note::

The Workflow Component supports workflows that can be in one or multiple places
(states) at the same time. To restrict a workflow to a single state, set the first
argument to ``true`` when defining the ``marking_store``.
(states) at the same time.

If the subject can be in only on state: use a state machine. In that case, the
property (named ``marking`` by default) will be a string.

If the subject can be in many places: use a workflow. In that case, the property will be an array.

.. tip::

The ``type`` (default value ``method``) and ``arguments`` (default
values ``false`` and ``marking``) attributes of the ``marking_store`` option are optional.
If omitted, their default values will be used.
The ``type`` (default value ``method``) and ``property`` (default
value ``marking``) attributes of the ``marking_store`` option are optional.
If omitted, the default values will be used.

.. tip::

Expand Down