Skip to content

Added docs for Workflow component #6871

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

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d0701f0
Added docs for Workflow component
Nyholm Aug 12, 2016
91867c2
Moved images
Nyholm Aug 12, 2016
69bca59
Fixes
Nyholm Aug 12, 2016
f99fbb2
Fixes
Nyholm Aug 12, 2016
e797f0c
Syntax error
Nyholm Aug 12, 2016
5b2a029
Cleanup and minor fixes
Nyholm Aug 16, 2016
196baf9
Separated docs for component
Nyholm Aug 16, 2016
763950d
Updating docs to using symfony services
Nyholm Aug 16, 2016
cead2f7
Added docs about registry
Nyholm Aug 16, 2016
e0089c5
Added placeholders
Nyholm Aug 16, 2016
48de43d
Added note about state machines
Nyholm Aug 16, 2016
805b237
Added example with twig
Nyholm Aug 16, 2016
f57ec14
Show Twig function workflow_transitions
Nyholm Aug 16, 2016
03925ff
syntax fix
Nyholm Aug 16, 2016
e6bdee6
Some syntax fixes and a better "why do we need this"
Nyholm Nov 7, 2016
c7464c7
typos
Nyholm Nov 7, 2016
83d26c1
toctree fix
Nyholm Nov 7, 2016
6e7a35f
Fixed typos and comments
Nyholm Nov 8, 2016
4415466
Added usage example on the component
Nyholm Nov 8, 2016
866b25a
Added example how to dump with Symfony
Nyholm Nov 8, 2016
dceebec
Added examples of workflows
Nyholm Nov 8, 2016
b959f8a
Updated state machine with an example
Nyholm Nov 8, 2016
b45edf2
simplify job_application
Nyholm Nov 8, 2016
fefdb5f
syntax
Nyholm Nov 9, 2016
7f0f5b0
Added comment about the service name
Nyholm Nov 9, 2016
c681283
Updated accoding to feedback
Nyholm Nov 9, 2016
86ecf0a
Added PHP config
Nyholm Nov 9, 2016
d002a8b
Added xml and PHP config
Nyholm Nov 9, 2016
b0a8855
Added workflow under guides
Nyholm Nov 9, 2016
4e7cf11
Removed the *why workflows* from the usage page.
Nyholm Nov 9, 2016
3aa433d
Documented support for DefinitionBuilder
Nyholm Nov 9, 2016
4f277dc
fixed typo
Nyholm Nov 9, 2016
2511c21
Merge pull request #1 from Nyholm/workflow-definition-builder
Nyholm Nov 9, 2016
c9b1656
Updated to support changes in https://github.com/symfony/symfony/pull…
Nyholm Nov 9, 2016
2cc2934
Updated twig example
Nyholm Nov 9, 2016
47dc11d
show how to configure the DI extension config
Nyholm Nov 11, 2016
3250621
Fixed typos
Nyholm Nov 11, 2016
c0bd6da
Use imperative instead of past tense.
Nyholm Nov 11, 2016
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
Added examples of workflows
  • Loading branch information
Nyholm committed Nov 8, 2016
commit dceebec28cfd2737432028dd0052bf69d073651a
Binary file added _images/components/workflow/job_application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/components/workflow/simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 39 additions & 5 deletions workflow.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
Workflow
--------
========

A workflow is a model of a process in your application. It may be the process
of how a blog post goes from draft, review and publish. Another example is when
Copy link
Contributor

Choose a reason for hiding this comment

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

"drafted, reviewed and published"?

a user submitts a series of different forms to complete a task. Such processes are
a user submits a series of different forms to complete a task. Such processes are
best kept away from your models and should be defined in configuration.

A state machine is a subset of a workflow and its purpose is to hold a state of
your model. Both the workflow and state machine defines what actions (transitions)
are allowed on the model at each state.
A **definition** of a workflow consist of places and actions how to get from one
Copy link
Member

Choose a reason for hiding this comment

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

This sentence doesn't read nicely. I'm not a native, but I would do either "[...] places and actions to get from one place to another." or "[...] places and actions describing how to get from one place to another."

place to another. The actions are called **transistions**. A workflow does also
need to know each object's position in the workflow. That **marking store** writes
Copy link
Member

Choose a reason for hiding this comment

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

"That marking score [...]" -> "The marking store [...]"

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not see where I've written "score". It supposed to be "store" everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, sorry, typo from my side. I meant "That" should become "The".

to a property of object to remember the current place.
Copy link
Member

Choose a reason for hiding this comment

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

"[...] to a property of the object [...]"


.. note::

The terminology above is commonly used when discussing workflows and
`Petri nets`_

The workflow component does also support state machines. A state machine is a subset
Copy link
Member

Choose a reason for hiding this comment

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

"The Workflow component [...]"

Copy link
Contributor

@mickaelandrieu mickaelandrieu Nov 9, 2016

Choose a reason for hiding this comment

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

Also, this is not true anymore :) The Workflow component does support state machines !

Can we have a section about it with a minimalist sample please ?

I was looking an old subset of theses docs sorry :(

Copy link
Member

Choose a reason for hiding this comment

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

It says it does support state machines and it has an article about it, isn't it?

of a workflow and its purpose is to hold a state of your model. Read more about the
differences and specific features of state machine in :doc:`/workflow/state-machines`
Copy link
Member

Choose a reason for hiding this comment

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

missing final stop of this sentence.

Copy link
Member Author

Choose a reason for hiding this comment

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

Im only missing a period, right?

":doc:/workflow/state-machines" will be "Workflows as State Machines" right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Full stop, period, it's all the same :)


Examples
--------

The simples workflow looks like this. It contains two places and one transition.

.. image:: /_images/components/workflow/simple.png

Workflows could be more complicated when they describes a real business case. The
Copy link
Member

Choose a reason for hiding this comment

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

describe

workflow below descirbes the process to fill in a job application.
Copy link
Member

Choose a reason for hiding this comment

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

describes


.. image:: /_images/components/workflow/job_application.png

When you fill in a job application in this examplethere are 5 to 8 steps depending
on the what job you are applying for. Some jobs requires personality test, logic tests
Copy link
Member

Choose a reason for hiding this comment

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

require personality tests

and/or formal requirements to be answered by the user. Some jobs don't. We use the
``GuardEvent`` to decide what next steps that are allowed for a specific application.
Copy link
Member

Choose a reason for hiding this comment

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

We always avoid first person in the docs, please transform this to "The GuardEvent is used to decide what next steps are allowed for a specific application."


By defining a workflow like this we have an over view how the process looks like. We
do not have any of the process logic in our controllers, models or view. We can change
the order of the steps by changing configuration only.
Copy link
Member

Choose a reason for hiding this comment

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

And here are some more first person usages



Copy link
Member

Choose a reason for hiding this comment

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

two blank lines

.. toctree::
:maxdepth: 1
:glob:

workflow/*

.. _Petri nets: https://en.wikipedia.org/wiki/Petri_net