Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SymfonyLive London 2016 - The Workflow Awakens

SymfonyLive London 2016 - The Workflow Awakens

It is common having to handle statuses or product states, either on e-commerce or editorial websites. To do that, you can use the classical -manual- way, or get help from libraries covering the basis.

In this talk, we will talk about the state machine concept and definition before considering its usage looking at existing open source libraries. Finally following the Symfony way, we will study the brand-new "Workflow" component.

Tugdual Saunier

September 16, 2016

More Decks by Tugdual Saunier

Other Decks in Technology


  1. 2 Tugdual Saunier @tucksaun Shipping guy.
 Loves Dev, Ops and

    automation. London, UK Blackfire.io/SensioLabs
  2. 6

  3. 11

  4. 19 On an editorial website, there are several kinds of

    people involved. Freelancers, journalists, spellcheckers, chief editor, publication director, … An article is not published that easily. Context
  5. 20 For example, an article must be validated by a

    journalist and a spellchecker. Otherwise, the article can not be published. Rules exist
  6. 21 The component responsibili﬚ is to ensure the article properly

    goes by all validation steps. Welcome Workflow!
  7. Being able to handle article publication process There is a

    serie of steps that must be fulfilled Only some users can move from one step to the other Some steps can be done at the same time Define the specs 27
  8. State machine: https:/ /github.com/yohang/Finite https:/ /github.com/winzou/state-machine Petrinet https:/ /github.com/florianv/petrinet https:/

    /github.com/alterway/component-workflow Other https:/ /github.com/vespolina/workflow Overview 32
  9. 35 This is an extension of Petri networks. It looks

    like state machines. But with more features. Note: Symfony Workflow component does not implement all the specs. Workflow Net
  10. 61 The EventDispatcher has been plugged into the Workflow !

    Events are dispatched each time: • a place is leſt • a transition is fired • a place is reached Events
  11. 64 It is always recommended to first draw your workflow

    on paper first to try it beforehand. Definition - By Hand