Skip to content

Examples ​

Each example shows its code next to the graph it renders. The graphs are rendered by the same renderer as the editor, in the Classic Light stylesheet in the light theme and in the Classic Dark stylesheet in the dark theme.

A start, an activity and an end ​

The smallest process: a start, one work step and an end, each linked to the next.

pml
START 'Order received' NEXT
ACTIVITY 'Pack order' NEXT
END 'Order shipped'
A start event linked to an activity linked to an end eventA start event linked to an activity linked to an end event

Implicit NEXT ​

A NEXT without a target links to the next node in the text.

pml
START 'Request in' NEXT
ACTIVITY 'Read request' NEXT
ACTIVITY 'Answer request' NEXT
END 'Request answered'
Four nodes in a row, each linked to the one below it in the codeFour nodes in a row, each linked to the one below it in the code

Explicit NEXT with labels ​

A string after a target labels its link. See Explicit identifiers.

pml
START 'Ticket opened' NEXT Triage
ACTIVITY Triage 'Triage ticket' NEXT Fix 'Bug' AND Answer 'Question'
ACTIVITY Fix 'Fix bug' NEXT Close
ACTIVITY Answer 'Answer question' NEXT Close
END Close 'Ticket closed'
A triage activity with two labelled links to a fix and an answer activity, both ending at one end eventA triage activity with two labelled links to a fix and an answer activity, both ending at one end event

A gateway with branches ​

A gateway branches into labelled links, and one branch rejoins the other.

pml
START 'Invoice received' NEXT
GATEWAY-EXCLUSIVE 'Amount above limit?' NEXT 'Ask approval' 'Yes' AND 'Pay invoice' 'No'
ACTIVITY 'Ask approval' NEXT 'Pay invoice'
ACTIVITY 'Pay invoice' NEXT
END 'Invoice paid'
An exclusive gateway with a Yes and a No branchAn exclusive gateway with a Yes and a No branch

A parallel split and join ​

A parallel gateway splits the flow into two steps, and a second one joins them.

pml
START 'Order confirmed' NEXT
GATEWAY-PARALLEL 'Split' NEXT 'Pack goods' AND 'Send invoice'
ACTIVITY 'Pack goods' NEXT 'Join'
ACTIVITY 'Send invoice' NEXT 'Join'
GATEWAY-PARALLEL 'Join' NEXT
END 'Order complete'
Two parallel gateways around two concurrent activitiesTwo parallel gateways around two concurrent activities

Lanes ​

Each LANE groups the nodes after it into a swimlane, and declaring a lane again returns to it.

pml
LANE Customer
START 'Need a quote' NEXT
ACTIVITY 'Request quote' NEXT
LANE Sales
ACTIVITY 'Prepare quote' NEXT
ACTIVITY 'Send quote' NEXT
LANE Customer
END 'Quote received'
Two swimlanes, Customer and Sales, with the flow crossing between themTwo swimlanes, Customer and Sales, with the flow crossing between them

Pools with a message flow ​

Two pools, each with its own flow, and a message flow between them.

pml
POOL Customer
START 'Wants a product' NEXT
ACTIVITY 'Place order' NEXT-MESSAGE 'Process order' 'Order form' NEXT
END 'Order placed'
POOL Shop
START 'Order arrives' NEXT
ACTIVITY 'Process order' NEXT
END 'Order processed'
Two pools linked by a dashed message flow labelled Order formTwo pools linked by a dashed message flow labelled Order form

Event types ​

Each event keyword draws its own marker.

pml
START 'Application sent' NEXT
EVENT-MESSAGE 'Confirmation received' NEXT
EVENT-TIMER 'Two weeks passed' NEXT
EVENT-CONDITIONAL 'Review complete' NEXT
EVENT-SIGNAL 'Decision published' NEXT
END 'Application closed'
A row of message, timer, conditional and signal events between a start and an endA row of message, timer, conditional and signal events between a start and an end

A terminate end ​

END-TERMINATE ends the whole process at once.

pml
START 'Payment started' NEXT
GATEWAY-EXCLUSIVE 'Card valid?' NEXT 'Charge card' 'Yes' AND 'Payment refused' 'No'
ACTIVITY 'Charge card' NEXT
END 'Payment done'
END-TERMINATE 'Payment refused'
A gateway leading to a normal end and to a terminate endA gateway leading to a normal end and to a terminate end

Attachments with associations ​

A database and a data object are associated with the steps that use them.

pml
START 'Order received' NEXT
ACTIVITY 'Check stock' NEXT
ACTIVITY 'Write invoice' NEXT
END 'Order handled'
DATABASE 'Stock' NEXT-ASSOCIATION 'Check stock'
DATA 'Invoice' NEXT-ASSOCIATION 'Write invoice'
Two activities, one associated with a stock database and one with an invoice data objectTwo activities, one associated with a stock database and one with an invoice data object

A text annotation ​

A TEXT line explains the node it links to.

pml
START 'Claim filed' NEXT
ACTIVITY 'Assess claim' NEXT
END 'Claim settled'
TEXT 'Within five working days' NEXT 'Assess claim'
A text annotation linked by a dotted line to an activityA text annotation linked by a dotted line to an activity

A complete small process ​

Lanes, a database, a gateway and two ends in one process.

pml
LANE Customer
START 'Order placed' NEXT
ACTIVITY 'Pay order' NEXT
LANE Shop
DATABASE 'Stock' NEXT 'Check stock'
ACTIVITY 'Check stock' NEXT
GATEWAY-EXCLUSIVE 'In stock?' NEXT 'Ship order' 'Yes' AND 'Refund order' 'No'
ACTIVITY 'Ship order' NEXT
END 'Order delivered'
ACTIVITY 'Refund order' NEXT
END 'Order refunded'
An order process over a Customer and a Shop lane with a stock check and two outcomesAn order process over a Customer and a Shop lane with a stock check and two outcomes