📖 This is a static documentation page. Open the interactive version with live canvas demos →

Branching & Logic

Flow diagrams become powerful when they include conditional routing — splitting the material path based on decisions, running parallel paths, and merging results. Three node types control this: Decision, Gateway, and Merge.

Decision Node

A Decision node is a conditional branch point. Material arrives on the input port and leaves through one of several output ports based on a condition.

How Decisions Work

  • Each output port represents one possible outcome (e.g. "Pass", "Fail", "Rework")
  • Ports can have a role of "condition" — indicating that the edge leaving this port is conditional
  • The condition itself is expressed through the port label or the edge logic
  • Only one output path is taken per entity

Typical Decision Patterns

  • Quality Gate — after a Functional Scan, route conforming parts forward and non-conforming parts to rework or scrap
  • Size Classification — sort parts into bins by measurement range
  • Priority Routing — direct urgent orders to a fast-track path

Gateway Node

A Gateway splits flow into multiple simultaneous paths. Unlike a Decision (which picks one), a Gateway activates all output paths.

When to Use Gateways

  • Parallel Processing — a part needs both machining and surface treatment, and the order doesn't matter
  • Redundant Inspection — route copies of the data to multiple quality checks at once
  • Kitting — split a batch into sub-assemblies that proceed along different lines

Merge Node

A Merge converges multiple incoming paths into a single outgoing path.

When to Use Merges

  • After a Gateway that split flow into parallel paths — Merge waits for all paths to complete
  • After a Decision where multiple conditions lead to the same downstream operation
  • At the end of rework loops — merge the reworked parts back into the main line

Edge Logic

Every flow edge (the connection between two nodes) can carry logic properties:

  • Time Cost — how long traversal takes (in milliseconds). Models transport time, queue wait, or handling delay
  • Cost Record — an accounting code and monetary amount. Tracks the financial cost of this routing step
  • Quality Impact — marks how the material's quality state changes after traversal (e.g. from "undef" to "normal" after passing inspection)
  • Characteristic Impact — records measurement data acquired during traversal

Edge logic is optional. Simple flow diagrams may use edges purely as connectors with no logic attached.


Port Roles

Ports are the connection points on nodes. Each port has a direction (input or output) and an optional role:

  • flow — standard material flow
  • condition — conditional output (used on Decision nodes)
  • merge — convergence input (used on Merge nodes)
  • trigger — event-driven activation
  • result — output carrying a measurement or status value

The role determines how the node processes material arriving at or departing from that port.


Item Quality at Each Node

Every flow node carries an ItemQuality field with seven levels:

  • writeOff — scrap / total loss
  • bad — non-conforming, requires disposition
  • undef — quality state not yet determined
  • common — acceptable baseline
  • normal — meets specification
  • good — exceeds specification
  • AAA — premium / certified

The quality level at a node represents the expected state of material at that routing stage. Combined with edge quality impact, this creates a traceable quality progression through the flow.


Combining Branching Patterns

Complex routes layer these primitives:

  • Decision → branch paths → Merge — conditional detour with guaranteed reunion
  • Gateway → parallel paths → Merge — parallel work with synchronisation point
  • Decision → one path loops back — rework cycle (fail → rework → re-inspect → decision again)
  • Nested decisions — multi-stage classification (first by size, then by quality within each size category)

The flow engine traces entities through these patterns, maintaining the entity's history, quality flags, and characteristics at every step.