In-House MRP - Operational Workflows & State Machines
End-to-end production lifecycle, scrap handling flow, and state transition tables for Manufacturing Orders and Routing Operations.
Operational Workflows & State Machines
The In-House Manufacturing domain executes production through clearly defined workflows and state transitions. Every Manufacturing Order and Routing Operation follows a controlled lifecycle that enforces business invariants and provides full traceability.
1. End-to-End Production Lifecycle
The following diagram illustrates the complete lifecycle of a Manufacturing Order from demand signal to closed, costed production.
flowchart TD
A[Demand Signal<br/>Sales Order / Forecast / Replenishment] --> B[Planned MO]
B --> C{Material & Capacity Check}
C -->|Available| D[Confirmed MO]
C -->|Shortage| E[Material Shortage / Awaiting Staging]
E -->|Reservation Complete| D
D --> F[Material Staged<br/>WMS Trigger: RawMaterialsRequested]
F --> G[Production In-Progress<br/>Floor Run & Time Logging]
G --> H{Routing Operation Complete?}
H -->|No| I[Next Operation]
I --> G
H -->|Yes| J[Inspection / QC]
J -->|Pass| K[Finished Goods Transfer<br/>GRN to Available Stock]
J -->|Fail| L[Scrap / Rework Decision]
L -->|Rework| M[Rework Work Order]
M --> G
L -->|Scrap| N[Scrap Bin / Variance Log]
K --> O[Costed & Closed]
N --> O
Lifecycle Stage Descriptions
| Stage | Description | Key Domain Event |
|---|---|---|
| Planned | MO created from demand signal; BOM and routing exploded. | ManufacturingOrderPlanned |
| Confirmed | Material and capacity availability validated; order authorized for execution. | ManufacturingOrderConfirmed |
| Material Staged | Components allocated or physically moved to production location. | RawMaterialsRequested |
| In Progress | First operation started; labor and machine time logged. | WorkOrderOperationStarted |
| Inspection / QC | Output inspected against quality specifications. | QualityInspectionCompleted |
| Finished Goods Transfer | Accepted output received into inventory as FG or WIP. | FinishedGoodsProduced |
| Costed & Closed | Costs finalized, variances calculated, ledger sealed. | ManufacturingOrderClosed |
2. Scrap & By-Product Handling Flow
Scrap, rework, by-products, and co-products are managed through a dedicated disposition workflow that preserves traceability and cost accuracy.
flowchart TD
A[Defect Detection<br/>During Operation or Inspection] --> B{Disposition Decision}
B -->|Reworkable| C[Quarantine Hold]
B -->|Non-Reworkable| D[Scrap Bin Assignment]
B -->|By-Product| E[By-Product Receipt]
C --> F[Rework Work Order Created]
F --> G[Rework Operation Executed]
G --> H{Re-Inspection}
H -->|Pass| I[Return to Production Flow]
H -->|Fail| D
D --> J[Scrap Quantity Logged]
J --> K[Cost Variance Recorded]
E --> L[By-Product Valuation & GRN]
K --> M[Order Closure]
L --> M
I --> M
Disposition Rules
| Disposition | Condition | Next Action |
|---|---|---|
| Accept | Output meets specification. | Transfer to next operation or finished goods. |
| Rework | Output can be corrected through additional processing. | Create rework work order; original quantity remains linked. |
| Scrap | Output cannot be economically corrected. | Move to scrap bin; log variance; deduct from expected yield. |
| By-Product / Co-Product | Secondary output intentionally produced. | Record receipt, valuation, and disposition separately from primary output. |
Scrap & Rework Cost Treatment
| Scenario | Cost Treatment |
|---|---|
| Normal Scrap (within scrap factor) | Cost absorbed into good output; no separate variance. |
| Excess Scrap (above scrap factor) | Recorded as material or operation variance; may require write-off. |
| Rework | Additional material, labor, and overhead costs attributed to the original order or a dedicated rework order. |
| By-Product | Valued at net realizable value or standard cost; credited to the producing order. |
| Co-Product | Production cost allocated between co-products based on a defined split ratio. |
3. Manufacturing Order State Transition Table
| Current State | Trigger / Event | Next State | Business Validation Rule |
|---|---|---|---|
| Draft | Planner creates MO from demand signal. | Planned | Item, BOM revision, routing, and quantity are valid. |
| Planned | Material and capacity availability confirmed. | Confirmed | All critical components have allocation or firm supply. |
| Planned | Material or capacity unavailable. | Awaiting Staging | Shortage must be resolved or order revised. |
| Awaiting Staging | Reservation complete; components available. | Confirmed | Allocation covers gross BOM requirements. |
| Confirmed | Material physically issued or staged. | Released | WMS confirms staging or GIN issued. |
| Released | First operation started on shop floor. | In Progress | Work center and operator assigned. |
| In Progress | Operation reports scrap or defect. | Awaiting Disposition | Disposition decision required before continuation. |
| Awaiting Disposition | Rework path authorized. | In Progress | Rework work order linked to original MO. |
| Awaiting Disposition | Scrap decision finalized. | In Progress | Scrap quantity logged and variance recorded. |
| In Progress | All operations complete; inspection passed. | Completed | Output quantity within tolerance; QC gate cleared. |
| Completed | GRN posted; costs finalized. | Closed | FMS acknowledges capitalization; no open labor/material corrections. |
| Completed | Quality failure discovered post-completion. | Rework Order Created | Original MO remains closed; correction via compensating order. |
| Any non-Closed state | Order cancelled by authorized actor. | Cancelled | No materials consumed, no operations started, or cancellation protocol followed. |
4. Routing Operation State Transition Table
| Current State | Trigger / Event | Next State | Business Validation Rule |
|---|---|---|---|
| Not Started | Prior operation completed or MO released. | Ready | Setup materials and tooling available. |
| Ready | Operator/machine starts setup. | Setting Up | Work center calendar valid; operator skill verified. |
| Setting Up | Setup complete; production run begins. | Running | Setup time logged; first-piece inspection optional. |
| Running | Operation paused (breakdown, material wait). | Paused | Reason code mandatory (downtime, no material, etc.). |
| Paused | Issue resolved. | Running | Resume time logged; downtime attributed. |
| Running | Operation output reported. | Awaiting Inspection | Mandatory if inspection flag set. |
| Awaiting Inspection | Inspection passed. | Completed | Accepted quantity released for next operation. |
| Awaiting Inspection | Inspection failed. | Awaiting Disposition | Rework or scrap decision required. |
| Awaiting Disposition | Rework authorized. | Ready | Operation re-enters at appropriate step. |
| Awaiting Disposition | Scrap finalized. | Completed | Scrap logged; accepted quantity adjusted. |
| Completed | Next operation started. | Closed | Quantity and time data sealed for the operation. |
5. Parallel Operation Workflow
When operations are configured for parallel execution, the strict sequential gate is relaxed while capacity and material constraints remain enforced.
flowchart LR
A[Operation 10<br/>Cutting] --> B[Operation 20<br/>Machining]
A -.->|Parallel Flag| C[Operation 25<br/>Deburring]
B --> D[Operation 30<br/>Assembly]
C --> D
Parallel Execution Rules
| Rule | Invariant |
|---|---|
| Overlap Definition | Parallel operations must declare the predecessor operation and the allowed overlap percentage or time window. |
| Material Gate | A parallel operation cannot start until its required materials are available, even if the predecessor has started. |
| Convergence Gate | The converging operation cannot start until all parallel branches have completed. |
| Capacity Check | Parallel scheduling must respect combined load on shared work centers or machines. |
6. Cancellation & Exception Handling
Not all production plans execute as intended. The domain supports controlled cancellation and exception paths.
| Exception | Handling Rule |
|---|---|
| Order Cancellation (no activity) | MO returns to cancelled state; reservations released; no cost impact. |
| Order Cancellation (partial activity) | Consumed materials and labor are costed as-is; remaining reservations released; closure reason recorded. |
| Material Substitution | Approved alternate item substituted via BOM revision or engineering waiver; original and substitute recorded. |
| Engineering Change Order (ECO) | Active MOs may continue on old BOM revision or be re-exploded per ECO policy; new MOs use latest revision. |
| Machine Breakdown | Operation paused; downtime event emitted to CMMS; MO rescheduled or reassigned. |
| Operator Absence | Operation reassigned to qualified replacement; labor ticket attributed to actual operator. |
These workflows and state machines ensure that every production run is executed, measured, and corrected through a consistent, auditable, and invariant-preserving process.