Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A la découverte de Symfony/Workflow - AFUP 2018
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Grégoire Pineau
May 28, 2018
Programming
170
1
Share
A la découverte de Symfony/Workflow - AFUP 2018
Grégoire Pineau
May 28, 2018
More Decks by Grégoire Pineau
See All by Grégoire Pineau
Embeddings : Symfony AI en pratique
lyrixx
1
490
MCP - Symfony Live Paris - 2025
lyrixx
1
160
Castor - Le Task Runner PHP qui simplifie votre Workflow
lyrixx
2
780
Vos logs méritent mieux que la config par défaut
lyrixx
5
2k
Castor - Symfony Live 2024 - Paris
lyrixx
2
620
GitHub Actions - Automatisation de vos workflows
lyrixx
1
700
Doctrine, objet typé, et colonne JSON
lyrixx
6
4.9k
(Re) Découvrir les outils UNIX
lyrixx
5
2.3k
Symfony: Comment valider dynamiquement de la donnée
lyrixx
3
480
Other Decks in Programming
See All in Programming
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
310
感情を設計する
ichimichi
5
1.5k
Don't Prompt Harder, Structure Better
kitasuke
0
770
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
370
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
5k
CDK Deployのための ”反響定位”
watany
4
780
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
340
ハーネスエンジニアリングとは?
kinopeee
10
5.3k
実践CRDT
tamadeveloper
0
570
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
140
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
730
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
The Curse of the Amulet
leimatthew05
1
11k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Design in an AI World
tapps
1
200
Building an army of robots
kneath
306
46k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Color Theory Basics | Prateek | Gurzu
gurzu
0
290
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
370
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
270
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Transcript
Symfony/workflow PHP Tour 2018 - Montpellier 1
2
Grégoire Pineau / @lyrixx DevOps @JoliCode Core Contributeur @symfony 3
Quand ? 4
Contexte 5 La publication d’un article sur un site de
presse ne se fait pas en un clin d’oeil. L’article transite par différents acteurs, qui produisent, relisent, valident. Il y a un workflow précis.
Garantir la qualité Chacune des étapes est nécessaire et garantit
la qualité de l’article (véracité du propos, sourcing, soin de l’écriture et de la formulation…) Ce circuit de production et de publication est une analogie efficace de ce que l’on peut retrouver dans le code 6
7 Pourquoi ?
8
9 Hello Workflow ! • Sépare la logique business du
modèle • Rend le code plus : ◦ Réutilisable ◦ Maintenable ◦ Lisible
Hello Workflow ! Le composant a pour but de garantir
que l’article passe bien par toutes les étapes de validation. 10
Symfony/workflow 11
12 machine à État
États / Transitions 13 état a état b Transition T1
Graphe orienté 14 A B C D E T1 T2
T3 T4 T5
Définition 15
16 Un simple graphe
17 Définition
GraphViz Dumper 18
19 Graphviz Dumper
La classe workflow 20
La méthode Workflow :: can() 21
22 La méthode Workflow :: can()
La méthode Workflow :: apply() 23
24 La méthode Workflow :: apply()
Workflow :: getEnabledTransitions() 25
26 Workflow :: getEnabledTransitions()
Twig 27
Twig 28
Les events ? 29
Les events On a mis l’Event Dispatcher dans le Workflow
! Un event à chaque : • Sortie de place • Passage dans une transition • Arrivée dans une place • Activation d’une transition 30
31
Plus un autre : le Guard Event 32
Un réseau de Pétri 33
What ? “Un réseau de Petri est une machine à
état sous stéroïde” - Quelqu’un, un jour “Une machine à état est un subset des réseaux de Petri” - Carl Adam Petri, 1962 34
Places / Transitions 35 Transition T1 place A place B
Plusieurs Entrées Sorties 36 Transition place place place place
Tokens ! 37
38 Le chat de Schrödinger
Quelques exemples de workflow 39
Tout droit 40
En Boucle 41
Ou 42
Et / Tâches en parallèle 43
WHAT ? 44
Appliqué à un Article 45
Modélisation du flow d’un article 46
Le MArking 47
Le marking 48 Il représente “l’état” d’un objet dans le
workflow. C’est-à-dire toutes les places où il y a des tokens.
Marking / Avant 49
Marking / Après 50
Demo ? 51
Le marking Store 52
Le marking store 53 Le marking store est l’interface entre
le Composant Workflow et un POPO. Il convertit le marking en quelque chose de compréhensible par le POPO et vice versa.
Deux implémentations 54 • Single State Marking Store scalar column
in DB • Multiple State Marking Store “array” column in DB
Les metadata 55
Les métadonnées 56
Et dans Symfony ? 57
La définition - En YAML 58
La définition - En YAML - Places 59
La définition - En YAML - Transitions 60
La définition - En YAML - Le reste 61
Ça ressemble à quoi ? 62
Une vue 63
Un contrôleur 64
Et notre guard ? 65
Merci Questions ? 66