The decision
Find essential unpaid orders and create alerts.
The model uses the classic MySQL Sample Database. SQL can find customers with unpaid orders, but the business objective is to produce alerts for essential orders based on total ordered amount and unpaid amount.



Model the logic
Keep database selection separate from alert policy.
The UnpaidOrders DataSQL table selects records. Its glossary defines matching database attributes plus a Stats concept containing unpaid amount, unpaid ratio, and the resulting alerts.
DefineAlerts iterates over the selected orders, calculates decision variables, and invokes AddAlert. Supporting tables display the alerts and orchestrate the model.






Run and explore
Generate alerts directly from relational data.
Start MariaDB and run test.bat to read the database and produce alerts. Run explore.bat to view the decision diagram and debug the model rule by rule and record by record. Business logic can change without modifying DataSQL or writing additional code.


