Product Automatic Repair
Introduction
ProductAutomaticRepairActivity is a MES-specific automatic repair node for defective products, used to automatically create repair judgment records for products. This node can automatically create corresponding judgment records for products based on the configured judgment result type (NG Product Flow, Manual Repair, Equipment Repair, Product Scrap), realizing automated processing flow for defective products.
Configuration Items
This node is controlled via process configuration and flow context variables.
Process Configuration
| Configuration Item | Description |
|---|---|
| ProductAutomaticRepair | Defective Product Automatic Repair Function Switch |
Input Variables
| Variable Name | Constant | Type | Description |
|---|---|---|---|
| ProductAutomaticRepair_SerialNumber | FlowItemCollection.ProductAutomaticRepairSerialNumberKey | string | Product Serial Number (Required) |
| ProductAutomaticRepair_Judgement | FlowItemCollection.ProductAutomaticRepairJudgementKey | string | Judgment Result Type (Required) |
| ProductAutomaticRepair_Reason | FlowItemCollection.ProductAutomaticRepairReasonKey | string | Unqualified Reason (Optional) |
| ProductAutomaticRepair_Section | FlowItemCollection.ProductAutomaticRepairSectionKey | string | Judgment Process (Optional) |
Output Variables
| Variable Name | Constant | Type | Description |
|---|---|---|---|
| ProductAutomaticRepair_Result | FlowItemCollection.ProductAutomaticRepairResultKey | int | Execution Result: 0=Not Executed, 1=Success, 2=Failure |
| ProductAutomaticRepair_Description | FlowItemCollection.ProductAutomaticRepairDescriptionKey | string | Execution Description/Error Info |
Judgment Result Types
| Enum Value | Name | Description |
|---|---|---|
| 1 | NG Product Flow | Product enters NG product handling flow |
| 2 | Manual Repair | Product requires manual repair |
| 3 | Equipment Repair | Product requires equipment repair |
| 4 | Product Scrap | Product scrap handling |
Business Logic
Execution Flow
┌─────────────────────────────────────────────────────────────┐
│ ProductAutomaticRepairActivity │
├─────────────────────────────────────────────────────────────┤
│ EnterAsync - Initialization Phase │
│ ├─ Set Execution Result = 0 (Not Executed) │
│ └─ Clear Execution Description │
├─────────────────────────────────────────────────────────────┤
│ ProcessAsync - Processing Phase │
│ ├─ Check if function is enabled │
│ │ └─ Not Enabled → Set Result=2, return disabled desc │
│ ├─ Verify Product Code │
│ │ └─ Empty → Set Result=2, return error │
│ ├─ Verify Judgment Result Type │
│ │ └─ Invalid → Set Result=2, return error │
│ ├─ Create Judgment Record │
│ │ └─ Call IJudgmentProvider.CreateJudgementAsync │
│ └─ Set Execution Result │
│ ├─ Success → Result=1 │
│ └─ Failure → Result=2, record error info │
└─────────────────────────────────────────────────────────────┘
Usage Example
Basic Flow Configuration
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│QualificationJudgment│──▶│ProductAutomaticRepair│──▶│ Subsequent Node │
│ Qualification │ │ Auto Repair │ │ │
└──────────────────┘ └──────────────────┘ └──────────────────┘
Set Input Parameters
{
"Activities": [
{
"Name": "Set Product Code",
"Type": "VariableWriteActivity",
"VariableName": "ProductAutomaticRepair_SerialNumber",
"VariableValue": "SN123456789"
},
{
"Name": "Set Judgment Result",
"Type": "VariableWriteActivity",
"VariableName": "ProductAutomaticRepair_Judgement",
"VariableValue": "2"
},
{
"Name": "Set Unqualified Reason",
"Type": "VariableWriteActivity",
"VariableName": "ProductAutomaticRepair_Reason",
"VariableValue": "Appearance Defect"
},
{
"Name": "Auto Repair",
"Type": "ProductAutomaticRepairActivity"
}
]
}
Error Handling
| Error Scenario | Result Value | Error Message |
|---|---|---|
| Function Not Enabled | 2 | Recipe Distribution Disabled |
| Product Code Empty | 2 | Product code cannot be empty |
| Judgment Format Error | 2 | Judgment result format incorrect: 1=NG Flow, 2=Manual Repair, 3=Equipment Repair, 4=Scrap |
| Creation Failed | 2 | Specific error info |
| System Exception | 2 | Exception info |
Notes
- Function Enable: Needs to enable automatic repair function in process configuration.
- Product Code Required: Product serial number is a required parameter.
- Type Validation: Judgment result must be a valid enum value (1-4).
- Operator Record: System automatically records current operator info.
- Exception Handling: Exceptions during judgment creation are captured and recorded.
- Result Check: Recommended to check execution result in subsequent nodes.