Model, Replay, Simulate: A BPMN Trainer for the Seminar Room
Model, Replay, Simulate: A BPMN Trainer for the Seminar Room
- Media: 21 screenshots and 3 videos generated by Playwright, listed in media/readme.md
The application UI and the video captions are German. All screenshots and videos come from automated end-to-end runs (
npm run media), so they show the application exactly as tested.
Why another BPMN tool?
Students learn BPMN notation quickly. Understanding how a process behaves takes longer: what an exclusive gateway really decides, why a parallel join waits, and what happens when one hundred applications arrive and only one person can check them.
bpmnsim combines a BPMN editor, a token replay and a resource-constrained calculation simulation in one browser application. This post walks through a typical seminar sequence, from the first diagram to a scenario comparison.
1. Modelling: the editor
The editor is based on bpmn-js. New loads a starter diagram; the context pad appends tasks, gateways and events directly at the selected element.
The editor with the starter diagram: start event, task, end event.
The context pad of a selected task: append elements, connect, change the type, or delete.
Video: modelling best practice
▶ editing-best-practice.webm (about 1:45, German captions)
The video builds a small order process step by step and shows nine practices:
- Name the start event as a state: “Bestellung eingegangen”.
- Name tasks as object + verb: “Bestellung prüfen”.
- Phrase the gateway as a question: “Ware verfügbar?”.
- Label every outgoing branch (ja / nein).
- End every path in a named end state.
- Enlarge tasks so long names stay readable.
- Make responsibilities visible with a pool and lanes. In the simulation, lanes become resources.
- Check the model by playing every path with the replay.
- Save the model as a
.bpmnfile.
2. Example processes
Six example diagrams cover the core patterns from introductory courses. The four new examples are in e2e/fixtures/examples.
| Pattern | Screenshot |
|---|---|
| Linear sequence (01-linear.bpmn) | ![]() |
| Exclusive decision, XOR (02-xor-decision.bpmn) | ![]() |
| Parallel split/join, AND (03-parallel.bpmn) | ![]() |
| University application with lanes (04-lanes-university.bpmn) | ![]() |
| Simple two-lane process (lanes.bpmn) | ![]() |
| Request/response collaboration (diag_req_resp.bpmn) | ![]() |
The collaboration example is useful for discussing pools and message flows. The simulator does not execute message flows, however: each pool runs on its own tokens.
3. Understanding the process logic: token simulation
Replay: step by step, with your own decisions
In Replay mode a red token walks through the process. ▶ Play runs it automatically, and ⏭ Step advances it one hop at a time.
The red token after the first step.
At an exclusive gateway the replay stops. Numbered buttons mark the possible paths, and the student decides.
Path choice at “Unterlagen vollständig?”: 1 = ja, 2 = nein.
At a parallel gateway the token splits. The join waits until both tokens have arrived.
After the AND split, “Material bestellen” and “Team einplanen” run in parallel.
Animated token simulation (bpmn-js)
The Token Simulation switch at the top left enables the animated simulation from bpmn-js. Start events can be triggered, gateway paths can be fixed in advance, and a log records every step.
Simulation mode on: trigger buttons at the start event, path control at the gateway.
A token on its way, with the event log at the bottom left.
Video: token simulation
▶ token-simulation.webm (about 1:50, German captions)
The video shows:
- The replay on the XOR example, once with ▶ Play (path “ja”) and once with ⏭ Step (path “nein”).
- The AND split and AND join on the parallel example.
- The animated bpmn-js simulation with the gateway path set to “nein” and then back to “ja”.
- “Ein Fall” from the simulation view, which plays one random case according to the configured probabilities.
4. Calculating: the scenario simulation
In Stochastic mode bpmnsim simulates many cases at once. Each task has a duration and a cost, gateways have probabilities, and lanes become resource pools with a weekly working calendar (Monday to Friday). When a role is busy, cases queue.
The simulation view: results sidebar on the right, scenario tabs at the bottom.
Configuration: Szenario 1 (baseline)
The configuration has four tabs: Kosten (cost), Dauer (duration), Häufigkeit (frequency), and Ressourcen (resources).
| Kosten | Dauer |
|---|---|
![]() |
![]() |
| Häufigkeit | Ressourcen |
![]() |
![]() |
Szenario 2 is created with + as a copy of Szenario 1. Only the two values marked in bold below change.
Szenario 2: Verwaltung with 2 persons and 80 h/week.
| Parameter | Szenario 1 | Szenario 2 |
|---|---|---|
| Cases / arrival interval | 100, every 10 min | 100, every 10 min |
| “Unterlagen vollständig?” | 80 % ja / 20 % nein | 80 % ja / 20 % nein |
| Unterlagen prüfen | 25 min, €5 | 15 min, €5 |
| Unterlagen nachfordern | 10 min, €3 | 10 min, €3 |
| Bewerbung bewerten | 10 min, €8 | 10 min, €8 |
| Bescheid versenden | 5 min, €2 | 5 min, €2 |
| Verwaltung (role) | 1 person, 40 h/week, €30/h | 2 persons, 80 h/week, €30/h |
| Prüfungsausschuss (role) | 2 persons, 80 h/week, €50/h | 2 persons, 80 h/week, €50/h |
Weekly hours are the total for the role, not per person.
Results
Szenario 1: the Verwaltung tasks are marked red as the bottleneck. The badges count task executions.
Szenario 2: the same model with more capacity and a faster check.
The values in these screenshots:
| Metric | Szenario 1 | Szenario 2 |
|---|---|---|
| Cases (completed / started) | 100 / 100 | 100 / 100 |
| Cost | €4,009.33 | €3,493.33 |
| Total cycle time (sum over all cases) | 650d 18h 00m | 86d 16h 30m |
| Average cycle time | 6d 12h 10m | 0d 20h 48m |
| Resource consumption | 2d 22h 20m | 2d 05h 20m |
| Bottleneck | Verwaltung | Verwaltung |
Interpretation for the seminar:
- Average cycle time drops from more than six days to under one day, because applications no longer queue in front of a single person.
- Cost also falls, mainly because the faster check needs fewer paid working hours.
- Verwaltung remains the bottleneck, but at a much lower level. The next experiment is obvious: what if only the check gets faster, or only capacity grows?
Each run draws a new random seed, so the numbers vary slightly between runs. In this run 22 applications (Szenario 1) and 20 (Szenario 2) took the “nein” path. The test behind the screenshots asserts only that Szenario 2 has a shorter average cycle time and lower cost than Szenario 1.
Video: calculation simulation, Szenario 1 vs. Szenario 2
▶ calculation-simulation.webm (about 1:50, German captions)
The video:
- Opens the university application process.
- Enters all Szenario 1 values tab by tab.
- Runs the simulation and explains the bottleneck.
- Creates Szenario 2 and changes the check duration and Verwaltung capacity.
- Runs Szenario 2 and switches between the two scenario tabs.
- Ends with the Excel export.
The KPIs in the video come from their own runs and can differ slightly from the screenshots.
5. Classroom use
A 90-minute seminar session can follow exactly this sequence:
| Phase | Activity | Media |
|---|---|---|
| Modelling | Students model the application process themselves | Editing video, screenshots 01–08 |
| Logic | Play every path with the replay; explain XOR and AND | Token video, screenshots 09–13 |
| Baseline | Configure and simulate Szenario 1 | Screenshots 14–19 |
| Experiment | Each group tests one change in Szenario 2 | Screenshots 20–21, calculation video |
| Presentation | Present the Excel export and argue the recommendation | Calculation video (end) |
The learning goal is to argue with evidence, not just draw a nicer diagram: model → predict → simulate → compare → justify.
Limits worth knowing
- The simulator is a simplified teaching model. Inclusive, event-based and complex gateways are treated as exclusive choices, and message flows are not simulated.
- Arrivals use a fixed interval, and role calendars use simplified Monday-to-Friday working windows.
- The
.xlsexport is an Excel-readable HTML table. - Remote logging (Loki) is enabled by default and can include the full diagram XML. For courses, build with
VITE_LOKI_ENABLED=falseand use synthetic data.
More background on the use case and pitch: 2026-11-13-192143-bpmn-trainer-university-use-case.md.
Regenerating the media
npm run media # 21 screenshots + 3 videos → doc/media (about 6 minutes)
The specs are in e2e/media/; the scenario values are in scenarios.ts.









