File tree Expand file tree Collapse file tree 6 files changed +195
-158
lines changed
_images/components/workflow Expand file tree Collapse file tree 6 files changed +195
-158
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,19 @@ are trying to use it with::
76
76
Usage
77
77
-----
78
78
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::
80
81
81
82
// ...
83
+ // Consider that $post is in state "draft" by default
82
84
$post = new BlogPost();
83
85
$workflow = $registry->get($post);
84
86
85
87
$workflow->can($post, 'publish'); // False
86
88
$workflow->can($post, 'to_review'); // True
87
89
88
- $workflow->apply($post, 'to_review');
90
+ $workflow->apply($post, 'to_review'); // $post is now in state "review"
91
+
89
92
$workflow->can($post, 'publish'); // True
90
93
$workflow->getEnabledTransitions($post); // ['publish', 'reject']
91
94
Original file line number Diff line number Diff line change @@ -233,8 +233,9 @@ Configuration
233
233
* :ref: `name <reference-workflows-name >`
234
234
235
235
* `audit_trail `_
236
- * `initial_place `_
236
+ * `initial_marking `_
237
237
* `marking_store `_
238
+ * `metadata `_
238
239
* `places `_
239
240
* `supports `_
240
241
* `support_strategy `_
@@ -2657,12 +2658,12 @@ audit_trail
2657
2658
If set to ``true ``, the :class: `Symfony\\ Component\\ Workflow\\ EventListener\\ AuditTrailListener `
2658
2659
will be enabled.
2659
2660
2660
- initial_place
2661
- """""""""""""
2661
+ initial_marking
2662
+ """""""""""""""
2662
2663
2663
- **type **: ``string `` ** default **: ``null ``
2664
+ **type **: ``string `` | ``array ``
2664
2665
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
2666
2667
already initialized via the workflow, this place will be set.
2667
2668
2668
2669
marking_store
@@ -2674,8 +2675,16 @@ Each marking store can define any of these options:
2674
2675
2675
2676
* ``arguments `` (**type **: ``array ``)
2676
2677
* ``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.
2679
2688
2680
2689
places
2681
2690
""""""
You can’t perform that action at this time.
0 commit comments