MRP / In-House MRP

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

StageDescriptionKey Domain Event
PlannedMO created from demand signal; BOM and routing exploded.ManufacturingOrderPlanned
ConfirmedMaterial and capacity availability validated; order authorized for execution.ManufacturingOrderConfirmed
Material StagedComponents allocated or physically moved to production location.RawMaterialsRequested
In ProgressFirst operation started; labor and machine time logged.WorkOrderOperationStarted
Inspection / QCOutput inspected against quality specifications.QualityInspectionCompleted
Finished Goods TransferAccepted output received into inventory as FG or WIP.FinishedGoodsProduced
Costed & ClosedCosts 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

DispositionConditionNext Action
AcceptOutput meets specification.Transfer to next operation or finished goods.
ReworkOutput can be corrected through additional processing.Create rework work order; original quantity remains linked.
ScrapOutput cannot be economically corrected.Move to scrap bin; log variance; deduct from expected yield.
By-Product / Co-ProductSecondary output intentionally produced.Record receipt, valuation, and disposition separately from primary output.

Scrap & Rework Cost Treatment

ScenarioCost 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.
ReworkAdditional material, labor, and overhead costs attributed to the original order or a dedicated rework order.
By-ProductValued at net realizable value or standard cost; credited to the producing order.
Co-ProductProduction cost allocated between co-products based on a defined split ratio.

3. Manufacturing Order State Transition Table

Current StateTrigger / EventNext StateBusiness Validation Rule
DraftPlanner creates MO from demand signal.PlannedItem, BOM revision, routing, and quantity are valid.
PlannedMaterial and capacity availability confirmed.ConfirmedAll critical components have allocation or firm supply.
PlannedMaterial or capacity unavailable.Awaiting StagingShortage must be resolved or order revised.
Awaiting StagingReservation complete; components available.ConfirmedAllocation covers gross BOM requirements.
ConfirmedMaterial physically issued or staged.ReleasedWMS confirms staging or GIN issued.
ReleasedFirst operation started on shop floor.In ProgressWork center and operator assigned.
In ProgressOperation reports scrap or defect.Awaiting DispositionDisposition decision required before continuation.
Awaiting DispositionRework path authorized.In ProgressRework work order linked to original MO.
Awaiting DispositionScrap decision finalized.In ProgressScrap quantity logged and variance recorded.
In ProgressAll operations complete; inspection passed.CompletedOutput quantity within tolerance; QC gate cleared.
CompletedGRN posted; costs finalized.ClosedFMS acknowledges capitalization; no open labor/material corrections.
CompletedQuality failure discovered post-completion.Rework Order CreatedOriginal MO remains closed; correction via compensating order.
Any non-Closed stateOrder cancelled by authorized actor.CancelledNo materials consumed, no operations started, or cancellation protocol followed.

4. Routing Operation State Transition Table

Current StateTrigger / EventNext StateBusiness Validation Rule
Not StartedPrior operation completed or MO released.ReadySetup materials and tooling available.
ReadyOperator/machine starts setup.Setting UpWork center calendar valid; operator skill verified.
Setting UpSetup complete; production run begins.RunningSetup time logged; first-piece inspection optional.
RunningOperation paused (breakdown, material wait).PausedReason code mandatory (downtime, no material, etc.).
PausedIssue resolved.RunningResume time logged; downtime attributed.
RunningOperation output reported.Awaiting InspectionMandatory if inspection flag set.
Awaiting InspectionInspection passed.CompletedAccepted quantity released for next operation.
Awaiting InspectionInspection failed.Awaiting DispositionRework or scrap decision required.
Awaiting DispositionRework authorized.ReadyOperation re-enters at appropriate step.
Awaiting DispositionScrap finalized.CompletedScrap logged; accepted quantity adjusted.
CompletedNext operation started.ClosedQuantity 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

RuleInvariant
Overlap DefinitionParallel operations must declare the predecessor operation and the allowed overlap percentage or time window.
Material GateA parallel operation cannot start until its required materials are available, even if the predecessor has started.
Convergence GateThe converging operation cannot start until all parallel branches have completed.
Capacity CheckParallel 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.

ExceptionHandling 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 SubstitutionApproved 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 BreakdownOperation paused; downtime event emitted to CMMS; MO rescheduled or reassigned.
Operator AbsenceOperation 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.

Our Premium Sponsors

Obelaw is proudly open-source. Continued development, bug fixes, and community support are made possible by the generosity of our sponsors.

Sponsor Obelaw