Skip to main content
Version: Next

Product State Detection

Introduction​

ProductStateDetectionActivity is a MES-specific product state detection node used to check if the product's current state allows it to enter the current process during inbound. This node supports normal product state detection and cross-line product state detection, verifying if the product has completed prerequisite processes or is in NG state.

Configuration Items​

This node is controlled via process configuration and flow context variables, no direct property configuration is needed.

Process Configuration​

Configuration ItemDescription
ProductStateDetectionSwitch for product state detection during normal production
ProductStateDetectionOfInspectionSwitch for product state detection during inspection
ProductStateDetectionOfCrossLineSwitch for cross-line product state detection

Input Variables​

Variable NameConstantTypeDescription
SerialNumberFlowItemCollection.SerialNumberstringProduct Serial Number
ProductModelFlowItemCollection.ProductModelAssociationProductModelProduct Model Information
HasRepairMarkFlowItemCollection.HasRepairMarkboolWhether it is a repair mark
HasInspectionMarkFlowItemCollection.HasInspectionMarkboolWhether it is an inspection mark

Output Variables​

Variable NameConstantTypeDescription
Inbound_ResultVariable_ValueFlowItemCollection.InboundResultValuestringInbound Result (when detection fails)
Inbound_Description_ValueFlowItemCollection.InboundDescriptionValuestringInbound Exception Description (when detection fails)

Business Logic​

Execution Flow​

┌─────────────────────────────────────────────────────────────┐
│ ProductStateDetectionActivity │
├─────────────────────────────────────────────────────────────┤
│ 1. Check if function is enabled │
│ ├─ Inspection Mode → Check ProductStateDetectionOfInspection│
│ └─ Normal Mode → Check ProductStateDetection + CrossLine │
├─────────────────────────────────────────────────────────────┤
│ 2. Get data required for detection │
│ ├─ Product Model │
│ ├─ Serial Number │
│ ├─ Repair Mark │
│ └─ Material Parameters │
├─────────────────────────────────────────────────────────────┤
│ 3. Execute product state detection │
│ └─ Call IProductTraceChecker.ProductStateDetectionAsync │
├─────────────────────────────────────────────────────────────┤
│ 4. Execute cross-line detection (if enabled) │
│ └─ Call CrossProductionLineProductStateDetectionAsync │
├─────────────────────────────────────────────────────────────┤
│ 5. Process detection results │
│ ├─ All Passed → Continue Flow │
│ └─ Any Failed → Set Inbound Result and Exception Desc │
└─────────────────────────────────────────────────────────────┘

Detection Content​

Product state detection relies on ITraceCacheService to query trace cache data and verify if the product meets inbound conditions.

1. Prerequisite Process Completion Check​

Verifies if the product has completed necessary prerequisite processes. Configured in "Product State Detection Settings" of Process Configuration.

2. Product Quality State Check​

Verifies the quality judgment result of the product in prerequisite processes and the current process. Checks if the product was judged as NG in any previous process.

3. Repair State Handling​

Special detection logic for repair products. Identified by HasRepairMark. Repair products may re-enter completed processes.

4. Material Association State Check​

Verifies the state of associated materials (if material information is provided).

Usage Example​

Typical Inbound Flow​

┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│DuplicateCodeDetection│──▶│ProductStateDetection│──▶│MissingProcessDetection│
│ Duplicate Check │ │ State Detection │ │ Missing Process │
└──────────────────┘ └──────────────────┘ └──────────────────┘

Error Handling​

Error ScenarioInbound ResultDescription
Product State Detection FailedProductNGProduct state does not allow inbound
Cross-Line Detection FailedProductNGCross-line state does not allow inbound
Cross-Line Detection ExceptionProductNGException occurred during detection

Notes​

  1. Function Enable: Product state detection function needs to be enabled in process configuration.
  2. Process Configuration: Detection rules must be configured for Product Model, Recipe, Process combination in "Process Settings".
  3. Repair Handling: Repair mark is passed to checker to decide whether to release.
  4. Inspection Mode: Inspection mode uses independent configuration items.
  5. Cross-Line Detection: Cross-line detection is independent of normal detection and can be enabled separately.