Skip to main content
Version: Next

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 ItemDescription
ProductAutomaticRepairDefective Product Automatic Repair Function Switch

Input Variables​

Variable NameConstantTypeDescription
ProductAutomaticRepair_SerialNumberFlowItemCollection.ProductAutomaticRepairSerialNumberKeystringProduct Serial Number (Required)
ProductAutomaticRepair_JudgementFlowItemCollection.ProductAutomaticRepairJudgementKeystringJudgment Result Type (Required)
ProductAutomaticRepair_ReasonFlowItemCollection.ProductAutomaticRepairReasonKeystringUnqualified Reason (Optional)
ProductAutomaticRepair_SectionFlowItemCollection.ProductAutomaticRepairSectionKeystringJudgment Process (Optional)

Output Variables​

Variable NameConstantTypeDescription
ProductAutomaticRepair_ResultFlowItemCollection.ProductAutomaticRepairResultKeyintExecution Result: 0=Not Executed, 1=Success, 2=Failure
ProductAutomaticRepair_DescriptionFlowItemCollection.ProductAutomaticRepairDescriptionKeystringExecution Description/Error Info

Judgment Result Types​

Enum ValueNameDescription
1NG Product FlowProduct enters NG product handling flow
2Manual RepairProduct requires manual repair
3Equipment RepairProduct requires equipment repair
4Product ScrapProduct 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 ScenarioResult ValueError Message
Function Not Enabled2Recipe Distribution Disabled
Product Code Empty2Product code cannot be empty
Judgment Format Error2Judgment result format incorrect: 1=NG Flow, 2=Manual Repair, 3=Equipment Repair, 4=Scrap
Creation Failed2Specific error info
System Exception2Exception info

Notes​

  1. Function Enable: Needs to enable automatic repair function in process configuration.
  2. Product Code Required: Product serial number is a required parameter.
  3. Type Validation: Judgment result must be a valid enum value (1-4).
  4. Operator Record: System automatically records current operator info.
  5. Exception Handling: Exceptions during judgment creation are captured and recorded.
  6. Result Check: Recommended to check execution result in subsequent nodes.