Batches
A batch is a production run on a piece of equipment. Every batch is linked to a product and tracked as a job event in oee_machine_events with details in oee_batch_details.
Starting a Batch
To start a batch, the operator selects an equipment node on the Process Flow and chooses “Start Batch.” Required and optional fields:
| Field | Required | Description |
|---|---|---|
| Product | Yes | Dropdown of active products for the site |
| Target Quantity | No | Auto-populated from product.default_quantity; operator can override |
| Work Order | No | Free-text reference to external work order |
| Batch Number | No | Auto-generated sequentially, or manual entry |
| Start Time | No | Defaults to now; can be backdated |
Target Quantity Fallback Chain
When target quantity is not explicitly provided:
product.default_quantity(from the selected product’s configuration)equipment.default_target_quantity(from the equipment’s settings)NULL(no target set)
Batch Lifecycle
stateDiagram-v2 [*] --> running: Start Batch running --> completed: Complete Batch running --> aborted: Abort Batch completed --> resolved: Routed to next station
| State | Trigger | Records |
|---|---|---|
running | Operator starts batch | start_ts, product_id, target_quantity |
completed | Operator completes batch | end_ts, good_parts, scrap_parts, total_parts |
aborted | Operator aborts batch | end_ts, abort_reason_id, partial counts |
resolved | Batch started at next station | me.resolved = TRUE — batch disappears from source station |
Display Status on Process Flow
On the Process Flow, batch-items derive their display status from actual data rather than the stored bd.status column. See Batch Status on Process Flow for the full derivation logic, click behavior, and routing flow.
Completing a Batch
The operator records:
- Good parts — parts that passed quality checks
- Scrap parts — parts that failed (categorized by Scrap Reason)
- Total parts — calculated as good + scrap
Aborting a Batch
Requires selecting an abort reason (from the Abort taxonomy). Aborted batches are excluded from Quality calculations but included in Availability and Performance.
Product Info Across the UI
Product information propagates throughout the application wherever batches are displayed:
| Location | What’s Shown |
|---|---|
| Event Log table | Product column (code + name) for batch events |
| Batch History page | Product name column |
| Process Flow | Batch badges show product code/name |
| Production Line cards | Product info on equipment cards |
| CSV Export | product_name and product_code columns |
| View/Edit Event modals | Product displayed (editable in inline edit mode) |
| Batch History Timeline | Product info in timeline tooltips |
Database
oee_machine_events (primary record)
Standard event fields: id, organization_id, site_id, machine_id, event_type = 'job', start_ts, end_ts, duration_minutes, notes, created_by, completed_by.
oee_batch_details (detail record)
| Column | Type | Description |
|---|---|---|
id | UUID | PK |
event_id | UUID | FK to oee_machine_events |
batch_number | VARCHAR | Auto-generated or manual |
work_order | VARCHAR | External reference |
product_id | UUID | FK to ops_products (required) |
target_quantity | INTEGER | Target production count |
good_parts | INTEGER | Parts passing QC |
scrap_parts | INTEGER | Parts failing QC |
total_parts | INTEGER | good + scrap |
status | VARCHAR | running, completed, aborted |
abort_reason_id | UUID | FK to abort reasons (if aborted) |
scrap_reason_id | UUID | FK to scrap reasons |
See Also
- Batch Status on Process Flow — derived status, click behavior, routing flow
- Events — all event types (downtime, incidents, jobs)
- Product Hierarchy — product and product family management
- OEE Job — glossary entry for jobs/batches
- Analytics — batch-related analytics and charts
- Process Flow — starting batches from the schematic