Process Flow
The Process Flow is a visual diagram that shows how stations and machines connect to form a production pipeline. It is rendered by the Schematic Builder feature at /oee/process-flow.
Two Levels of Process Flow
The system has two connection models that operate at different levels:
Station Connections (ops_station_connections)
Station connections define the job routing logic. When a job completes at a station, the system checks station connections to determine where the job goes next. These connections drive Job Auto-Advancement.
| Column | Type | Description |
|---|---|---|
from_station_id | UUID (FK) | Source station |
to_station_id | UUID (FK) | Destination station |
connection_type | VARCHAR(20) | 'feeds_into' or 'rework' |
label | VARCHAR(100) | Optional display label |
exit_side | VARCHAR(10) | Arrow exit edge override |
entry_side | VARCHAR(10) | Arrow entry edge override |
sort_order | INTEGER | Ordering for multiple outbound connections |
Station connection types:
| Type | Purpose | Triggers Auto-Advance? |
|---|---|---|
feeds_into | Normal forward production flow | Yes (if exactly 1 connection) |
rework | Return path for defective items | No |
Equipment Connections (oee_equipment_connections)
Equipment connections define the machine-level flow within or across stations. These are used for the schematic visualization and batch routing between machines.
| Column | Type | Description |
|---|---|---|
from_equipment_id | UUID (FK) | Source machine |
to_equipment_id | UUID (FK) | Destination machine |
connection_type | VARCHAR(20) | 'feeds_into', 'parallel', 'optional', or 'feedback' |
label | VARCHAR(100) | Optional display label |
exit_side | VARCHAR(10) | Arrow exit edge override |
entry_side | VARCHAR(10) | Arrow entry edge override |
sort_order | INTEGER | Ordering for multiple outbound connections |
Equipment connection types:
| Type | Purpose |
|---|---|
feeds_into | Normal forward flow between machines |
parallel | Machines that run in parallel |
optional | Optional path (machine can be skipped) |
feedback | Return path (similar to rework at station level) |
Connection Properties
Both station and equipment connections share these optional properties:
Exit/Entry Side
Controls which edge of the node the arrow connects to. Values: 'left', 'right', 'top', 'bottom', or NULL (auto-calculated).
When set to NULL, the system calculates the optimal attachment point based on the relative positions of the two nodes. Manual overrides are useful when the auto-calculated path creates visual clutter.
Label
An optional text label displayed on the connection line. Useful for annotating what flows between stations (e.g., “QC Pass”, “Reject”).
Sort Order
Controls the ordering when a node has multiple outbound connections. Lower numbers appear first.
Schematic Builder
The schematic builder is the visual editor for the process flow diagram. It uses ngx-graph for rendering with a custom manual layout engine that respects saved positions.
Node Rendering
Each machine node on the schematic displays:
- Machine name and code
- Current state as a color-coded background (green = running, red = down, gray = idle, blue = planned downtime, orange = scheduled)
- Active batch count — number of batches currently running on the machine
- Batch badges — display the product code/name for each active batch on the node
- Queue count — number of batches waiting in the machine’s queue
- Rolling 7-day OEE percentage
Canvas Interaction
Users can:
- Drag nodes to position machines on the canvas
- Resize nodes via corner/edge handles (min 100x70, max 500x400 pixels)
- Draw connections between machines by clicking source then destination
- Delete connections via a button at the connection midpoint
- Zoom and pan the canvas
- Fit to view to auto-center all nodes
Node Positions
Machine positions are stored in oee_machine_positions (for equipment) or ops_station_positions (for stations):
| Column | Type | Description |
|---|---|---|
equipment_id / station_id | UUID (FK, unique) | One position per node |
x_position / y_position | NUMERIC | Canvas coordinates |
node_width / node_height | NUMERIC | Node dimensions in pixels |
Positions are saved automatically when the user moves or resizes nodes.
Grid System
The canvas uses a grid system with 100 pixels per grid unit. Nodes snap to grid positions for clean alignment.
Live State on the Schematic
The schematic updates to reflect the current state of stations and machines:
- Running (green) — at least one batch has active time entries (someone clocked in)
- Idle (gray) — batches exist but no active time entries (nobody clocked in)
- Down (red) — active downtime event with reason
- Planned (blue) — queued batches waiting to be started
Station Batch-Item Interactions
Clicking a batch-item on a station node triggers different actions based on the batch’s derived status. See Batch Status on Process Flow for the full diagram.
| Batch Status | Click Action |
|---|---|
| RUNNING | Opens Complete Job modal |
| IDLE (no time entries ever) | Opens Start Job modal |
| IDLE (has closed time entries) | Offers Resume or Complete |
| COMPLETED | Opens routing flow (Route Job → Start Job on next station) |
Context Actions
Clicking a station or equipment node opens an action panel with:
- Start Batch — begin a new batch (requires selecting a product)
- Complete Batch — finish the current batch, clock everyone out
- Route Job — route a completed batch to the next station
- Log Downtime — record a downtime event
- Log Incident — record an incident
Codebase Paths
- Equipment connections table:
database/sql_scripts/tables/oee_equipment_connections.sql - Station connections table:
database/sql_scripts/tables/ops_station_connections.sql - Equipment positions table:
database/sql_scripts/tables/oee_machine_positions.sql - Station positions table:
database/sql_scripts/tables/ops_station_positions.sql - Schematic models:
frontend/src/app/features/schematic-builder/models/schematic.model.ts - Schematic canvas:
frontend/src/app/features/schematic-builder/components/schematic-canvas/ - Schematic service:
frontend/src/app/features/schematic-builder/services/schematic.service.ts - Backend endpoints:
backend/endpoints/schematic.ts
See Also
- Batch Status on Process Flow — how batch status is derived and what happens on click
- Batches — batch lifecycle, starting and completing
- Station Process Flow — station-level connections and job auto-advancement logic
- Job Auto-Advancement
- Machines
- Events
- Station