Slide 1

Slide 1 text

Automate processes using a state machine by Mark Scherer @dereuromark A talk for Cakefest 2020

Slide 2

Slide 2 text

About me

Slide 3

Slide 3 text

● CakePHP Core Developer ● PHP Developer for 15+ years ● Spryker Systems GmbH Tooling Expert and Release Manager ● Open Source (!) github.com/dereuromark About me 3

Slide 4

Slide 4 text

● (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

Slide 5

Slide 5 text

State Machines

Slide 6

Slide 6 text

● 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

Slide 7

Slide 7 text

Example 7 Terminology ● States ● Transitions ● Events ● Conditions ● Commands

Slide 8

Slide 8 text

● https://github.com/spryker/cakephp-statemachine ○ CakePHP 3/4 plugin ○ License: Open code, not open source at this time Jumping into code 8

Slide 9

Slide 9 text

Let’s create one

Slide 10

Slide 10 text

● Configurator ● Order Management ● Application in multiple steps ● … Connect with ● Queue system for asynchronous background tasks Creating a state machine 10

Slide 11

Slide 11 text

Real life example

Slide 12

Slide 12 text

● 1000 of repositories, up to 15 releases per day ● different validations and constraints for major, minor and patch Real life example 12

Slide 13

Slide 13 text

● Clearer workflow ● More and more automated workflow ● Validate each step before transitioning into the next one Real life goals 13

Slide 14

Slide 14 text

Questions?

Slide 15

Slide 15 text

Contact us spryker.com [email protected] @sprysys +49 (30) 2084983 53 @dereuromark Thank you, and enjoy CakeFest