Skip to content

Commit c029eae

Browse files
noniagriconomieOskarStark
authored andcommitted
[Workflow] config doc
1 parent 775f22b commit c029eae

File tree

6 files changed

+195
-158
lines changed

6 files changed

+195
-158
lines changed
181 Bytes
Loading

components/workflow.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,19 @@ are trying to use it with::
7676
Usage
7777
-----
7878

79-
When you have configured a ``Registry`` with your workflows, you may use it as follows::
79+
When you have configured a ``Registry`` with your workflows,
80+
you can retreive a workflow from it and use it as follows::
8081

8182
// ...
83+
// Consider that $post is in state "draft" by default
8284
$post = new BlogPost();
8385
$workflow = $registry->get($post);
8486

8587
$workflow->can($post, 'publish'); // False
8688
$workflow->can($post, 'to_review'); // True
8789

88-
$workflow->apply($post, 'to_review');
90+
$workflow->apply($post, 'to_review'); // $post is now in state "review"
91+
8992
$workflow->can($post, 'publish'); // True
9093
$workflow->getEnabledTransitions($post); // ['publish', 'reject']
9194

reference/configuration/framework.rst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ Configuration
233233
* :ref:`name <reference-workflows-name>`
234234

235235
* `audit_trail`_
236-
* `initial_place`_
236+
* `initial_marking`_
237237
* `marking_store`_
238+
* `metadata`_
238239
* `places`_
239240
* `supports`_
240241
* `support_strategy`_
@@ -2657,12 +2658,12 @@ audit_trail
26572658
If set to ``true``, the :class:`Symfony\\Component\\Workflow\\EventListener\\AuditTrailListener`
26582659
will be enabled.
26592660

2660-
initial_place
2661-
"""""""""""""
2661+
initial_marking
2662+
"""""""""""""""
26622663

2663-
**type**: ``string`` **default**: ``null``
2664+
**type**: ``string`` | ``array``
26642665

2665-
One of the ``places`` or ``null``. If not null and the supported object is not
2666+
One of the ``places`` or ``empty``. If not null and the supported object is not
26662667
already initialized via the workflow, this place will be set.
26672668

26682669
marking_store
@@ -2674,8 +2675,16 @@ Each marking store can define any of these options:
26742675

26752676
* ``arguments`` (**type**: ``array``)
26762677
* ``service`` (**type**: ``string``)
2677-
* ``type`` (**type**: ``string`` **possible values**: ``'multiple_state'`` or
2678-
``'single_state'``)
2678+
* ``type`` (**type**: ``string`` **allow value**: ``'method'``)
2679+
2680+
metadata
2681+
""""""""
2682+
2683+
**type**: ``array``
2684+
2685+
Metadata available for the workflow configuration.
2686+
Note that ``places`` and ``transitions`` can also have their own
2687+
``metadata`` entry.
26792688

26802689
places
26812690
""""""

0 commit comments

Comments
 (0)