Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A la découverte de Symfony/Workflow - AFUP 2018
Search
Grégoire Pineau
May 28, 2018
Programming
200
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A la découverte de Symfony/Workflow - AFUP 2018
Grégoire Pineau
May 28, 2018
Transcript
66 slides
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
More Decks by Grégoire Pineau
See All by Grégoire Pineau
Embeddings : Symfony AI en pratique
lyrixx
1
680
MCP - Symfony Live Paris - 2025
lyrixx
1
210
Castor - Le Task Runner PHP qui simplifie votre Workflow
lyrixx
2
840
Vos logs méritent mieux que la config par défaut
lyrixx
5
2.1k
Castor - Symfony Live 2024 - Paris
lyrixx
2
680
GitHub Actions - Automatisation de vos workflows
lyrixx
1
750
Doctrine, objet typé, et colonne JSON
lyrixx
6
5k
(Re) Découvrir les outils UNIX
lyrixx
5
2.4k
Symfony: Comment valider dynamiquement de la donnée
lyrixx
3
520
Other Decks in Programming
See All in Programming
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
600
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
180
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
あなたはMCPの機能を、まだ知らない。
4geru
1
700
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
220
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
450
GraphQL の onError と Nullability のこれから
quramy
0
220
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
390
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
280
Ruby から Emacs を操作したい
phigasui
0
370
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
190
Crash Auto Pipelines
veronikapj
1
440
Featured
See All Featured
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
Ruling the World: When Life Gets Gamed
codingconduct
0
450
Writing Fast Ruby
sferik
630
63k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
640
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640
GitHub's CSS Performance
jonrohan
1033
470k
Six Lessons from altMBA
skipperchong
29
4.6k
A Soul's Torment
seathinner
9
3.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
A Modern Web Designer's Workflow
chriscoyier
699
190k
Amusing Abliteration
ianozsvald
1
400