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

Automate processes using a state machine

6b6225db96d6fb4a34c6d50a9171d13f?s=47 Mark Sch.
October 09, 2020

Automate processes using a state machine

A talk for Cakefest 2020

6b6225db96d6fb4a34c6d50a9171d13f?s=128

Mark Sch.

October 09, 2020
Tweet

Transcript

  1. Automate processes using a state machine by Mark Scherer @dereuromark

    A talk for Cakefest 2020
  2. About me

  3. • CakePHP Core Developer • PHP Developer for 15+ years

    • Spryker Systems GmbH Tooling Expert and Release Manager • Open Source (!) github.com/dereuromark About me 3
  4. • (Shop) Software vendor with ~1000 packages • Atomic releasing:

    Mono repo vs Split repos • Multiple organizations, multiple PRs per RG • > 10000 releases in the last 5 years • More and more tooling and automation About Spryker 4
  5. State Machines

  6. • Finite-state machine • can be in exactly one of

    a finite number of states at any given time Why using them e.g. in PHP? • Workflows & Automation • Less if/else jungle => less bugs • Direct link of code to visual representation • Easy to maintain, grow and modify over time, even with more complex models What is a state machine 6
  7. Example 7 Terminology • States • Transitions • Events •

    Conditions • Commands
  8. • https://github.com/spryker/cakephp-statemachine ◦ CakePHP 3/4 plugin ◦ License: Open code,

    not open source at this time Jumping into code 8
  9. Let’s create one

  10. • Configurator • Order Management • Application in multiple steps

    • … Connect with • Queue system for asynchronous background tasks Creating a state machine 10
  11. Real life example

  12. • 1000 of repositories, up to 15 releases per day

    • different validations and constraints for major, minor and patch Real life example 12
  13. • Clearer workflow • More and more automated workflow •

    Validate each step before transitioning into the next one Real life goals 13
  14. Questions?

  15. Contact us spryker.com hello@spryker.com @sprysys +49 (30) 2084983 53 @dereuromark

    Thank you, and enjoy CakeFest