bpm.approvalFlow
Flux de validation multi-étapes (approuvé / en attente / rejeté) : chaque approbateur peut approuver ou rejeter l'étape en cours avec un commentaire.
S
Sophie Leroy
Demandeur
approved
K
Karim Benali
Manager
pending
C
Claire Moreau
DAF
pending
Validation du devis DV-2026-0481 : utilisez les boutons Approuver / Rejeter de l'étape en attente pour faire avancer le circuit.
Python
bpm.approval_flow(steps=[("Sophie Leroy", "Demandeur", "approved"), ("Karim Benali", "Manager", "pending"), ("Claire Moreau", "DAF", "pending")])| Prop | Type | Défaut | Requis | Description |
|---|---|---|---|---|
steps | { id, approver, role?, status, comment?, date?, avatar? }[] | — | Oui | Étapes du circuit. status ∈ pending | approved | rejected | skipped. |
onApprove | (stepId: string, comment?: string) => void | — | Non | Callback d'approbation de l'étape en attente ; affiche le bouton « Approuver ». |
onReject | (stepId: string, comment?: string) => void | — | Non | Callback de rejet de l'étape en attente ; affiche le bouton « Rejeter ». |
direction | "horizontal" | "vertical" | auto | Non | Orientation. Par défaut : horizontal si moins de 5 étapes, vertical sinon. |
showCommentInput | boolean | true | Non | Affiche le champ commentaire sous l'étape en attente (transmis aux callbacks). |
className | string | — | Non | Classes CSS additionnelles. |
Exemples
bpm.approval_flow(steps=[("Sophie Leroy", "Demandeur", "approved"), ("Karim Benali", "Manager", "pending"), ("Claire Moreau", "DAF", "pending")])bpm.approval_flow(
steps=[
{"id": "1", "approver": "Marie Dupont", "role": "Cheffe de projet", "status": "approved", "comment": "Budget conforme."},
{"id": "2", "approver": "Jean Martin", "role": "Direction", "status": "rejected", "comment": "Montant à revoir."},
],
direction="vertical",
)