9. Practical Example: Production Yield & Quality Monitoring
In real business scenarios, your data isn't usually entered manually one by one; it comes from ERPs, MES, or various reporting systems. To demonstrate MindLogic's power in complex business scenarios, we'll walk through a real-world industrial manufacturing case. We will teach you how to one-click import a multi-dimensional business report, and use simple formulas and scripts to build a quality control node capable of "automatic diagnostics, dynamic UI, and smart alerts".
Scenario Background
Imagine you are the Quality Control Director at a large electronics manufacturing plant. You've just exported a "Daily Production Line Status Report" from your MES system, which includes multiple process steps (SMT, Wave Soldering, AOI, Manual Review). This report contains not just "Total Input" and "Defect Count", but also multi-dimensional metrics like "Rework Count", "Equipment Temp", and "Status". Your goal is to: Build a QC Master Control Center to automatically calculate the overall yield rate, and if the yield falls below target or if equipment temperatures exceed safe limits, automatically trigger a red alert node and generate a detailed Markdown troubleshooting report.
Step 1: Download and One-Click Import Business Report (CSV)
Instead of creating nodes manually, MindLogic offers a powerful feature to import spreadsheets and automatically generate structured nodes.
- Download Realistic Example Report: Please download smc_quality_report_en.csv to your computer. (This report contains real-world data for 6 production lines, covering inputs, defects, equipment temps, and responsible managers.)
- One-Click Import: In the top menu bar, select File -> Import CSV, and select the file you just downloaded.
- Witness Auto-Modeling: You will see 6 neatly arranged nodes instantly generated on the canvas (e.g.,
SMT Line 1,Wave Soldering A, etc.).
If you select one of the nodes (for example, Wave Soldering A), you will notice in the Defined Attributes on the right panel that the system has automatically attached all the complex dimensions from the spreadsheet:
Total Input:8000Defect Count:300Rework Count:200Temperature:270.2Status:Temp HighManager:Master Wang
This means that your raw business ledger has been seamlessly transformed into logical inference nodes!
Step 2: Create Master Control Node & Formula Aggregation
Next, we need to "aggregate" these scattered production line data for analysis.
- Double-click above the canvas to create a new node, and name it
QC Master Center. - Draw connection lines from all 6 imported production line nodes, pointing them to
QC Master Center. - Select
QC Master Center. In the right panel under Output Expressions, we can use formulas to process multi-dimensional upstream data plant-wide:- Key:
Total Plant Input - Formula:
SUM(Total Input)(The engine will automatically sum all inputs, resulting in 66150) - Key:
Total Plant Defects - Formula:
SUM(Defect Count)(Resulting in 670) - Key:
Max Equip Temp - Formula:
MAX(Temperature)(Automatically finds the highest temperature across the plant: 270.2)
- Key:
At this point, we've implemented an automated calculation flow similar to a BI dashboard. Next, we will give its UI "business intuition".
Step 3: Implement "Dynamic Alerts" via Entity Scripts
At the very bottom of this node's properties, find the Entity Script input box. We will write a slightly more complex JavaScript logic to make the node dynamically change its appearance and issue a report when the "overall yield is below 99%" or "equipment temperature is too high".
Paste the following code into the script box:
// 1. Extract the metric data we just aggregated using formulas
let totalInput = node.outputs["Total Plant Input"];
let totalDefect = node.outputs["Total Plant Defects"];
let maxTemp = node.outputs["Max Equip Temp"];
// 2. Calculate the overall plant yield rate in the script (keep 2 decimal places)
let overallYield = 100 - (totalDefect / totalInput * 100);
node.outputs["Overall Yield"] = overallYield.toFixed(2) + "%";
// 3. Core alert logic evaluation
if (overallYield < 99.0 || maxTemp > 265) {
// 💥 State: Critical Alert (Low yield OR High equipment temp risk)
node.title = "🚨 Plant-Wide Quality Red Alert";
node.frameType = "hexagon"; // Change shape to a striking hexagon
node.symbolName = "xmark.octagon.fill"; // Change to an error icon
node.confidence = 1.0; // Max confidence, renders as a red warning
// Generate formatted Markdown halt warning report
node.contentType = "markdown";
node.outputs["markdownReport"] = `
# ⚠️ Emergency Quality Report
The current plant-wide overall yield is only **${overallYield.toFixed(2)}%** (Target: 99.0%).
Total defective products have reached **${totalDefect}** units!
> **Equipment High Temp Alert**: The highest equipment temperature detected in the plant reached **${maxTemp}℃**, presenting a safety hazard and risk of yield collapse!
> Please notify Master Wang and relevant managers to inspect the Wave Soldering area immediately!
`;
} else if (overallYield < 99.5) {
// ⚠️ State: General Warning
node.title = "⚠️ Yield Fluctuation Warning";
node.frameType = "diamond";
node.symbolName = "exclamationmark.triangle.fill";
node.confidence = 0.6; // Renders as a yellow warning
node.contentType = "markdown";
node.outputs["markdownReport"] = `## Quality Observation\nCurrent yield is **${overallYield.toFixed(2)}%**, showing a slight downward trend. Line supervisors please monitor closely.`;
} else {
// ✅ State: Normal
node.title = "✅ Production Excellent";
node.frameType = "roundedRectangle";
node.symbolName = "checkmark.shield.fill";
node.confidence = 0.1; // Renders as green/safe
node.contentType = "plainText";
}
Step 4: Experience the "Living Sandbox" Data Inference
Once you complete the above steps, you'll immediately see the QC Master Center node turn into a red hexagon. It automatically calculated that the plant yield is below 99%, discovered a high-temperature equipment at 270.2℃, and generated a Markdown report containing real calculation data.
Now, you can try running a few "what-if" simulations at the source:
- Resolve High Temp Hazard: Select
Wave Soldering A(as it has the highest temp), and change itsTemperaturefrom270.2to a normal250.0. - Reduce Defects: Simultaneously, reduce its
Defect Countto30, simulating the state after technical optimization. - Observe Results: The moment you press Enter, the overall yield metric instantly rises above 99.5%, the downstream
QC Master Centerautomatically reverts to a green shield icon, its title changes to "✅ Production Excellent", and that serious red alert report disappears.
Summary
Through this realistic scenario, we utilized MindLogic to achieve:
- Rapid Ingestion of Massive Multi-dimensional Data: No manual node creation; one CSV file imports a structured business ledger.
- Macro Metric Aggregation Across Nodes: Easily extract global key factors using formulas like
SUMandMAX. - Automated Response Based on Complex Logic: Combine multiple metrics (yield and temperature) in scripts for comprehensive judgments, dynamically manipulating the UI in milliseconds.
- Data-Driven Content Generation: Use template literals (
`) to dynamically inject real-time calculation variables into Markdown reports.
This is MindLogic—it not only helps clarify your thoughts but serves as your intelligent calculation engine and visual inference sandbox for business data.
