Industry Use Cases Overview
This chapter collects 40 production use cases of the JQuick-Java rule engine in real industry systems, covering 9 industry domains including finance, government, manufacturing, healthcare, HR, IoT, marketing, campus, and property management, with 260 test cases in total, all verified on Oracle JDK 1.8.
Each case provides a complete, runnable six-file set: the request model, decision result model, rule interface, XML rule script, service orchestration layer, and JUnit tests. No fragments, no pseudocode — place the six files into a project following the package structure and run mvn test to reproduce every decision result shown in the documentation.
Source & version alignment
Section titled “Source & version alignment”The case code comes from the test project of the official JQuick-Java repository and stays in sync with this documentation site:
| Content | Repository path |
|---|---|
| Rule interfaces | src/test/java/com/github/paohaijiao/demo/ |
| Rule scripts (XML, 39 files) | src/test/resources/demo/ |
| Domain models (78 classes) | src/test/java/com/github/paohaijiao/demo/model/ |
| Orchestration services (39 classes) | src/test/java/com/github/paohaijiao/demo/service/ |
| Scenario overview | USE-CASES.md at the repository root |
- Cases 1–15 are production-grade templates: each contains a multi-dimensional rule set of 8–14 rule methods, a Service orchestration layer, and 6 groups of realistic business-shape tests.
- Cases 16–39 are 24 business samples built on the same six-file skeleton (6 test cases each).
- Case 40 is a standalone entry-point regression over a 49-item business requirement matrix: 25 directly covered entry points plus 1 cross-scenario dual-engine joint interception.
Unified project skeleton
Section titled “Unified project skeleton”All 39 business cases follow the same paradigm, making them cross-referable and copy-ready:
| Component | Quantity / convention | Responsibility |
|---|---|---|
Domain models (model/) |
Request model + decision result model, Lombok @Data |
Carry business fields and output details; rule interfaces stay decoupled from external DTOs |
Rule interface (XxxRules.java) |
2–14 methods | Each method does exactly one thing: scoring methods each own one dimension, decision methods only do mapping |
Rule script (demo/xxx.xml) |
One-to-one with the interface | Thresholds, tiers, coefficients, and routing are all externalized and support hot updates |
Orchestration service (service/XxxService.java) |
1 | Upfront hard validation / short-circuiting, multi-dimensional score aggregation and capping, chain wiring, detail assembly |
Tests (XxxServiceTest.java) |
6 groups of realistic business shapes | Cover normal pass, boundary tiers, one-vote veto, material anomalies, extreme-value capping, etc. |
Two repeatedly proven decision skeletons:
- Score-and-grade type: multiple dimensions score independently → the Service aggregates and clamps to 0–100 → the script maps the total to grades and handling actions.
- Hard-gate-first two-stage type: evaluate one-vote-veto / hard-condition sets first, then score and route; when a hard condition fails, scoring does not change the rejection outcome.
How to run
Section titled “How to run”Clone the repository locally, then run Maven commands at the project root. See Installation & dependencies for versions.
Run a single case (Case 1, credit risk admission, as an example):
mvn test -Dtest=RiskAdmissionServiceTestRun all 40 case entry points at once (260 test cases; must be comma-separated):
mvn test "-Dtest=RiskAdmissionServiceTest,ClaimAuditServiceTest,PostLoanWarningServiceTest,DynamicPricingServiceTest,TicketSlaServiceTest,PerformanceServiceTest,ReplenishmentServiceTest,TaxComplianceServiceTest,DeviceAlarmServiceTest,CouponServiceTest,SubsidyServiceTest,QualityInspectionServiceTest,MedicalReimbursementServiceTest,ResumeScreeningServiceTest,TransactionFraudServiceTest,CorporateLoanServiceTest,UnderwritingServiceTest,SupplierAdmissionServiceTest,InvestorSuitabilityServiceTest,TechProjectReviewServiceTest,CityQualificationServiceTest,SoeInvestmentServiceTest,TaxReliefServiceTest,LicenseAnnualReviewServiceTest,MemberLoyaltyServiceTest,CampaignFraudServiceTest,AfterSalesServiceTest,UserSegmentServiceTest,DistributionCommissionServiceTest,PresaleFinalPaymentServiceTest,IncomingMaterialServiceTest,WorkshopEnergyAlertServiceTest,HealthScreeningServiceTest,TriageServiceTest,SalaryAllowanceServiceTest,ApprovalRoutingServiceTest,BudgetAlertServiceTest,ScholarshipServiceTest,PropertyWaiverServiceTest,CoveredScenariosMatrixTest"Finance & insurance (8 cases)
Section titled “Finance & insurance (8 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 1 | Consumer credit risk admission | Financial risk control | 10 |
| 2 | Overdue warning & collection routing | Post-loan management | 10 |
| 3 | Insurance claim adjustment | Insurance | 10 |
| 15 | Bank card transaction anti-fraud | Real-time risk control | 12 |
| 16 | Smart corporate loan credit-line estimation | Financial risk control | 10 |
| 17 | Policy underwriting risk determination | Insurance | 9 |
| 18 | Supply-chain finance supplier admission rating | Supply-chain finance | 8 |
| 19 | Wealth-management investor suitability assessment | Financial compliance | 7 |
Government & tax (7 cases)
Section titled “Government & tax (7 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 8 | Tax compliance risk scoring | Tax compliance | 10 |
| 11 | Government talent subsidy eligibility review | Government & enterprise services | 10 |
| 20 | Tech project application pre-review scoring | Government & enterprise services | 7 |
| 21 | Multi-policy eligibility for residency / home / car purchase | Government & enterprise services | 8 |
| 22 | SOE project approval investment compliance check | State-owned asset supervision | 2 |
| 23 | Small-business tax relief / job-retention subsidy eligibility | Tax compliance | 4 |
| 24 | Industry license annual review compliance check | Government regulation | 9 |
Retail, e-commerce & marketing (8 cases)
Section titled “Retail, e-commerce & marketing (8 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 4 | Slow-moving inventory dynamic pricing | E-commerce & retail | 10 |
| 10 | Coupon issuance rules | Marketing | 11 |
| 25 | Membership tier growth-value upgrade/downgrade | E-commerce & retail | 5 |
| 26 | Order anti-brush risk control check | E-commerce risk control | 6 |
| 27 | After-sales refund / return / exchange eligibility | E-commerce & retail | 4 |
| 28 | User-profile tag dynamic segmentation | E-commerce user operations | 5 |
| 29 | Distribution commission / hierarchical profit sharing | E-commerce distribution | 6 |
| 30 | Presale final-payment eligibility / fulfillment check | E-commerce & retail | 4 |
Manufacturing, supply chain & IoT (5 cases)
Section titled “Manufacturing, supply chain & IoT (5 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 7 | Retail inventory replenishment suggestions | Supply chain | 10 |
| 9 | IoT device alarm grading | Internet of Things | 13 |
| 12 | Production-line quality inspection grading & handling | Manufacturing MES | 10 |
| 31 | Incoming-material acceptance standard dynamic adaptation | Manufacturing MES | 7 |
| 32 | Workshop energy-consumption anomaly detection & over-limit warning | Manufacturing energy | 5 |
Healthcare & medical insurance (3 cases)
Section titled “Healthcare & medical insurance (3 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 13 | Medical insurance reimbursement compliance check | Healthcare & medical insurance | 8 |
| 33 | Health-checkup indicator anomaly screening & risk tagging | Public health | 8 |
| 34 | Outpatient triage / emergency priority grading | Emergency care | 4 |
HR, OA, finance & education (7 cases)
Section titled “HR, OA, finance & education (7 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 5 | Ticket SLA grading & escalation | Operations & customer service | 10 |
| 6 | Performance grade & bonus coefficient | Human resources | 10 |
| 14 | Recruitment resume smart screening | HR SaaS | 14 |
| 35 | Salary & allowance auto-calculation | Human resources | 8 |
| 36 | Leave / overtime / business-trip approval routing | OA collaboration | 5 |
| 37 | Department budget compliance & overspend warning | Financial management | 5 |
| 38 | Campus scholarship / merit / grant eligibility assessment | Education & campus | 6 |
Property & cross-domain regression (2 cases)
Section titled “Property & cross-domain regression (2 cases)”| # | Case | Domain | Rule methods |
|---|---|---|---|
| 39 | Property fee / parking fee waiver eligibility | Property & community | 4 |
| 40 | 49-item requirement matrix regression & cross-scenario joint interception | Cross-domain regression | Reuses 1–15 |
Why these cases fit legacy-system modernization
Section titled “Why these cases fit legacy-system modernization”- Rules decoupled from code — no changes to the main program: thresholds, tiers, coefficients, and routing all live in XML. When migrating a legacy system you don’t need to rewrite core business logic; just replace scattered
if-elsedecision blocks with rule scripts piece by piece, and business / implementation staff can maintain and tune parameters afterwards on their own. - Java 8 baseline, no heavy dependencies: embeds directly into legacy systems still running on JDK 8 and domestic (Xinchuang) JDK environments, without forcing runtime upgrades or introducing platform-grade rule middleware.
- Lightweight embedding with ASM acceleration: works via interface dynamic proxies, with both reflection and runtime code-generation invokers available and concurrency-cached — no extra process overhead on high-frequency decision paths.
- Hot-updatable rules: after modifying the XML, rebuilding the proxy takes effect immediately with no recompilation or repackaging of the business system — ideal for government and finance scenarios with strict change approval and limited release windows.
- Traceable, auditable decision rationale: each scoring dimension is an independent rule method; combined with the score details and hit reasons assembled by the Service, the decision chain is naturally explainable, meeting audit requirements in risk control, medical insurance, tax, and similar scenarios.