Token Game in Activity Diagrams
About this app
Tokens move tick by tick through the UML activity diagrams of the slides: at a diamond they take one path (tap a condition), at a fork they split, at a join they wait for all parts (“1 of 2”). Running actions show their duration, swimlanes count handoffs. Six examples from the order process to the complaint case, plus four error models: a diamond instead of a bar leads to deadlock or a premature end.
Token semantics
A UML activity diagram describes a process made of actions and control nodes. Its meaning can be explained with tokens moving along the edges. A diamond decision node sends the token down exactly one path, depending on a guard. A diamond merge node passes an arriving token on immediately. A fork bar splits the token onto several parallel paths. A join bar waits until a token has arrived from every incoming path, then passes one on. When a token reaches the final node, the whole activity ends.
What the app shows
Tokens move tick by tick through diagrams like those in the lecture slides. At a diamond the flow stops until you tap a guard; at a fork tokens split, at a join they wait, shown as “1 of 2”. Running actions show their duration, and swimlanes count hand-offs between lanes. Six examples range from an order process with a reminder loop to a complaint process. Counters show ticks, tokens and hand-offs.
Play through the faults
Four faulty models each change one node: a diamond instead of a fork bar, a missing join, a join instead of a merge, and in the complaint process a diamond instead of a join. Play them first and watch the effect: sometimes a token waits for a second one that never comes (deadlock), sometimes the activity ends while an action is still running. The solution then explains why diamond and bar are not variants of the same symbol.
Frequently asked questions
- What is the difference between a diamond and a bar in an activity diagram?
- The diamond stands for decision or merge: a token takes exactly one path, or is passed on immediately. The bar stands for fork or join: it splits the token onto parallel paths, or waits until all paths have arrived.
- How do token semantics work in UML?
- Tokens move along the edges of an activity diagram and show which actions can currently run. An action starts when tokens are present at its inputs. Control nodes such as fork and join determine how tokens are split, passed on or collected.
- When does a deadlock occur in an activity diagram?
- A deadlock occurs when a join bar waits for a token that never arrives, for example because a diamond earlier opened only one path. The flow cannot continue and never reaches the final node.
- Which examples does the app include?
- Six diagrams, including four sequential actions, a decision, a reminder loop, fork and join, swimlanes with hand-offs, and a complaint process. Plus four faulty models to play through.
Subject: Software engineering
More from Software engineering
- Class Diagram and Code in Sync
- Tests as a Safety Net
- Trust, but Verify
- Waterfall or Agile?
- WIP Limit and Lead Time
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps