Understanding Traceability
Traceability answers three critical questions:-
What went into this? (Inputs / Genealogy)
- Which raw material batches were consumed
- Which upstream production batches were used
- Material suppliers and batch numbers
-
How was it made? (Process)
- Production orders executed
- Machines and operators involved
- Process parameters and quality results
- Shifts and dates of production
-
Where did it go? (Outputs / Usage)
- Which downstream products consumed this batch
- Customer shipments and invoice numbers
- Current location and status
Traceability Architecture
PROD-SYS implements bidirectional traceability:Key Traceability Tables
| Table | Purpose |
|---|---|
lotes | Production batch master records |
consumo_lote_telar | Fabric weaving consumption (Telares using Extrusor output) |
registros_trabajo | Production records linking orders, machines, shifts |
lineas_ejecucion | Execution context (order + process + machine) |
bitacoras | Shift logs capturing time and operator context |
muestras | Quality test results by batch |
historial_estado_lote | Batch status changes and approvals |
Tracing a Batch
Navigate to Control → Trazabilidad.Enter Batch Code
Input the código_lote you want to trace:
- Standard format:
{codigo_orden}-{correlativo}(e.g., “2000145-001”) - Laminado format:
{codigo_rollo}-L{correlativo}(e.g., “2000145-001-L1”) - Product serial numbers (future enhancement)
View Complete Chain
The traceability view displays:Batch Details
- Código_lote and internal ID
- Production order (codigo_orden)
- Source process
- Production date and shift
- Current status (activo, pausado, cerrado)
- Raw material batches consumed
- Supplier information
- Material specifications
- Receiving dates and quantities
- Machine used (from linea_ejecucion)
- Operator and inspector (from bitacora)
- Process parameters recorded
- Quality test results (from muestras)
- Which batches consumed this material
- Destination orders and processes
- Quantities used by shift
- Customer shipments (future)
- All status transitions
- Approval timestamps
- Comments and justifications
- User attribution
Process-Specific Traceability
Extrusor PP (Process 1)
Inputs tracked:- Raw polymer batches (supplier + batch number)
- Additives and colorants (from mezcla data)
- Recycled material (regrind %)
- Extruder machine ID
- Barrel temperature zones (T1-T6)
- Screw RPM and pressure
- Output rate (kg/hr)
- Melt flow index (MFI) from quality samples
- Pellet batches (lote codes)
- Weight per batch
- Packaging (bulk bags, gaylords)
Telares (Process 2)
Inputs tracked:- Extrusor PP batches consumed (via consumo_lote_telar)
- Yarn specifications
- Loom setup parameters
- Weaving machine (T-01, T-02, etc.)
- Fabric width (ancho cm)
- Linear meters produced
- Operator per shift
- Resistance and weight tests
- Fabric roll batches (lote codes)
- Roll length and weight
- Quality grade
Laminado (Process 3)
Inputs tracked:- Telares fabric rolls (input lote codes)
- Lamination film supplier and batch
- Adhesive batch number
- Lamination machine
- Temperature and speed settings
- Bond strength (from quality samples)
- Linear meters laminated
- Laminated roll batches (format: -L)
- Roll dimensions
- Peel strength test results
Imprenta (Process 4)
Inputs tracked:- Laminado rolls consumed
- Ink batch numbers by color
- Print plate identification
- Printing press ID
- Print registration (mm)
- Color density readings
- Print count (thousands)
- Printed material batches
- Customer artwork version
- Color proofing results
Conversión (Processes 5, 7, 9)
Inputs tracked:- Printed material batches (from Imprenta)
- Accessory components (handles, valves, zippers)
- Thread/stitching material batches
- Converting/sewing machines
- Cutting die identification
- Stitch density and strength
- Unit count produced
- Finished goods batches
- Packaging configuration (units per box/pallet)
- Customer order linkage
Traceability Queries
Forward Trace (Where Did It Go?)
Starting from a raw material or intermediate batch, find all downstream products:Follow to Next Process
For each consumption record:
- Find the registro_trabajo_id
- Get the linea_ejecucion (order + process + machine)
- Identify output batches from that registro
Recurse Downstream
Repeat for each output batch until reaching finished goods or customer shipments.
Backward Trace (Where Did It Come From?)
Starting from a finished product, find all source materials:Quality Integration
Traceability includes complete quality context:Quality Samples
For each batch, view linked quality samples:Rejected Batches
If quality samples show rejections:- Batch status changes to “pausado”
- Historial records rejection reason
- Downstream usage is blocked
- Traceability query highlights the rejection:
- Shows rejection timestamp
- Links to corrective action (if documented)
- Indicates disposition (rework, scrap, conditional release)
Recall Simulation
In a recall scenario:Backward Trace to Root Cause
Query backward to identify all source materials and processes involved.
Identify Potentially Affected Batches
If root cause is a specific raw material batch:
- Find all production runs using that material
- Query forward from that batch to all finished goods
Generate Recall List
System produces:
- All finished goods batches affected
- Customer shipments containing those batches
- Quantities by customer and shipment date
- Current inventory locations
Audit Trail Integration
Every traceability record has audit context:Who, What, When
- Production: Username from bitacora.inspector or registro_trabajo.usuario_modificacion
- Quality: Username from muestras.usuario_modificacion
- Status changes: Username from historial_estado_lote.changed_by
- Timestamps: All operations recorded in UTC
Viewing Audit Details
In traceability view:- Click on any batch or production record
- View “Audit Trail” tab
- See all CRUD operations:
- CREATE: Initial batch generation
- UPDATE: Data corrections or additions
- STATUS_CHANGE: Quality approvals or holds
- DELETE: (Not allowed - soft deletes only)
Material Balance Verification
Use traceability to validate material usage:Query Production by Process
For each process:
- Sum all output quantities (from registros_trabajo.cantidad_producida)
- Sum all input consumption (from consumo_lote tables)
Calculate Material Efficiency
- Expected yield (from process specifications)
- Reported waste (from registros_trabajo.merma_kg)
Traceability Reports
Batch Genealogy Report
For regulatory compliance, generate PDF report:Best Practices
Record batch consumption immediately during production, not retrospectively
Validate traceability chains before customer shipments
Maintain consistent batch numbering across all processes
Link quality samples to batches, not just orders
Document all batch status changes with detailed comments
Perform periodic material balance audits to validate traceability
Test recall procedures quarterly with simulated scenarios
Troubleshooting
Batch Shows No Inputs
Issue: Forward trace finds batch but no source materials- Consumption may not have been recorded during production
- Check if process contract supports consumption tracking
- Review shift log to verify production was recorded correctly
- Add missing consumo_lote records if data is available
Batch Shows No Outputs
Issue: Backward trace shows batch created but never consumed- Batch may still be in inventory (not yet used)
- Could indicate production planning issue (excess inventory)
- Verify batch estado (may be pausado or cerrado)
- Check if downstream process is active
Material Balance Doesn’t Match
Issue: Input quantities don’t align with output quantities- Check for unreported waste (merma_kg in registros_trabajo)
- Verify unit conversions (kg vs. m² vs. MIL vs. UND)
- Look for quality rejections that removed material from production
- Investigate data entry errors in cantidad_producida
Traceability Query Times Out
Issue: Large traceability chains cause slow queries- Optimize database indexes on lote_id, registro_trabajo_id
- Limit tree depth (e.g., 5 levels max)
- Cache frequently accessed genealogies
- Use asynchronous query with progress indicator
Future Enhancements
Planned traceability improvements:- Graphical Genealogy View: Interactive tree/graph visualization
- Customer Shipment Integration: Link batches to invoices and shipping docs
- Material Certificates: Attach supplier COAs and test reports to batches
- Barcode/QR Integration: Scan batch labels to query traceability
- Real-Time Alerts: Notify when related batches are held or recalled
- Blockchain Pilot: Immutable traceability records for export customers
Related Topics
- Quality Batches - Managing batch lifecycle and status
- Shift Logs - Recording production that generates traceability
- Production Orders - Orders that batches fulfill
- Incidents - Tracking quality issues by batch