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 Item | Description |
|---|---|
| ProductStateDetection | Switch for product state detection during normal production |
| ProductStateDetectionOfInspection | Switch for product state detection during inspection |
| ProductStateDetectionOfCrossLine | Switch for cross-line product state detection |
Input Variables
| Variable Name | Constant | Type | Description |
|---|---|---|---|
| SerialNumber | FlowItemCollection.SerialNumber | string | Product Serial Number |
| ProductModel | FlowItemCollection.ProductModel | AssociationProductModel | Product Model Information |
| HasRepairMark | FlowItemCollection.HasRepairMark | bool | Whether it is a repair mark |
| HasInspectionMark | FlowItemCollection.HasInspectionMark | bool | Whether it is an inspection mark |
Output Variables
| Variable Name | Constant | Type | Description |
|---|---|---|---|
| Inbound_ResultVariable_Value | FlowItemCollection.InboundResultValue | string | Inbound Result (when detection fails) |
| Inbound_Description_Value | FlowItemCollection.InboundDescriptionValue | string | Inbound 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 Scenario | Inbound Result | Description |
|---|---|---|
| Product State Detection Failed | ProductNG | Product state does not allow inbound |
| Cross-Line Detection Failed | ProductNG | Cross-line state does not allow inbound |
| Cross-Line Detection Exception | ProductNG | Exception occurred during detection |
Notes
- Function Enable: Product state detection function needs to be enabled in process configuration.
- Process Configuration: Detection rules must be configured for Product Model, Recipe, Process combination in "Process Settings".
- Repair Handling: Repair mark is passed to checker to decide whether to release.
- Inspection Mode: Inspection mode uses independent configuration items.
- Cross-Line Detection: Cross-line detection is independent of normal detection and can be enabled separately.