Station Process Flow

ops station process-flow

The Station Process Flow defines how stations connect to form a production pipeline. Jobs automatically advance through stations based on these connections.

Connection Model

Connections are stored in ops_station_connections as directed edges:

ColumnTypeDescription
idUUID (PK)Auto-generated
from_station_idUUID (FK)Source station
to_station_idUUID (FK)Destination station
connection_typeVARCHAR(50)'feeds_into' (default) or 'rework'

Constraints:

  • UNIQUE(from_station_id, to_station_id) — no duplicate connections
  • CHECK(from_station_id != to_station_id) — no self-loops

Connection Types

TypeMeaning
feeds_intoNormal forward flow. Used for Job Auto-Advancement.
reworkReturn path for defective items. Does NOT trigger auto-advancement.

Process Flow Visualization

Stations have canvas positions stored in ops_station_positions:

ColumnTypeDescription
station_idUUID (FK, unique)One position per station
x / yNUMERICCanvas coordinates
width / heightNUMERICNode dimensions (defaults: 120 x 80)

The process flow is rendered in the Schematic Builder feature at /oee/process-flow. Users can:

  • Drag and drop stations to position them on a canvas
  • Draw connections between stations
  • View active jobs at each station as badges on the nodes

Auto-Advancement Logic

When a job completes at a station, the complete_ops_job() function checks connections:

flowchart TD
    A[Job completes at Station A] --> B{How many 'feeds_into' connections?}
    B -->|0| D[Mark job as 'completed']
    B -->|Exactly 1| C[Auto-advance to Station B]
    B -->|2+| F[Prompt operator to select destination]
    C --> E[Job becomes 'pending' at Station B]
    C --> G[New station_history entry created]
    F --> H{Operator selects?}
    H -->|Yes| E
    H -->|No| I[Job enters 'queued' state at current station]

See Job Auto-Advancement for the detailed logic.

SQL Functions

  • create_ops_station_connection() / get_ops_station_connections()
  • update_ops_station_connection() / delete_ops_station_connection()
  • get_ops_station_positions() / upsert_ops_station_positions()

Codebase Paths

  • Connections table: database/sql_scripts/tables/ops_station_connections.sql
  • Positions table: database/sql_scripts/tables/ops_station_positions.sql
  • Connection functions: database/sql_scripts/functions/ops/ops_station_functions.sql
  • Position functions: database/sql_scripts/functions/ops/ops_station_position_functions.sql
  • Frontend: frontend/src/app/features/schematic-builder/
  • Backend positions endpoint: backend/endpoints/schematic.ts

See Also