|
4 | 4 | How to Create and Use Workflows |
5 | 5 | =============================== |
6 | 6 |
|
7 | | -Before creating your first workflow, execute this command to install the |
8 | | -:doc:`Workflow component </components/workflow>` in your application: |
| 7 | +Installation |
| 8 | +------------ |
| 9 | + |
| 10 | +In applications using :doc:`Symfony Flex </setup/flex>`, run this command to |
| 11 | +install the workflow feature before using it: |
9 | 12 |
|
10 | 13 | .. code-block:: terminal |
11 | 14 |
|
12 | 15 | $ composer require workflow |
13 | 16 |
|
| 17 | +Creating a Workflow |
| 18 | +------------------- |
| 19 | + |
14 | 20 | A workflow is a process or a lifecycle that your objects go through. Each |
15 | 21 | step or stage in the process is called a *place*. You do also define *transitions* |
16 | 22 | to that describes the action to get from one place to another. |
@@ -163,9 +169,12 @@ like this: |
163 | 169 | value ``marking``) attributes of the ``marking_store`` option are optional. |
164 | 170 | If omitted, their default values will be used. |
165 | 171 |
|
166 | | -With this workflow named ``blog_publishing``, you can now decide what actions |
167 | | -are allowed on a blog post. For example, inside a controller of an application |
168 | | -using the :ref:`default services.yaml configuration <service-container-services-load-example>`, |
| 172 | +Using a Workflow |
| 173 | +---------------- |
| 174 | + |
| 175 | +Once the ``blog_publishing`` workflow has been created, you can now use it to |
| 176 | +decide what actions are allowed on a blog post. For example, inside a controller |
| 177 | +of an application using the :ref:`default services.yaml configuration <service-container-services-load-example>`, |
169 | 178 | you can get the workflow by injecting the Workflow registry service:: |
170 | 179 |
|
171 | 180 | // ... |
|
0 commit comments