Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This sample demonstrates a service for calculating Mortgage Insurance Premium (MIP) using business rules.
 

...

Sample Configuration

Table of Contents
maxLevel4
minLevel4


Sample Rule Definition

Rules

The mortgage insurance rate is 0.5 for MIP insurance and 1.5 for FHA loans.
Facts

There is one fact named Client. The result of the rule execution is Mortgage Insurance Premium.

 

Code Block
languagejava
package samples.MIPCalculate;

/**
 * Client fact
 */
public class Client {

    private String loanType;

    private double mortgageValue;

    private double downPayment;

    public String getLoanType() {
        return loanType;
    }

    public void setLoanType(String loanType) {
        this.loanType = loanType;
    }

    public double getMortgageValue() {
        return mortgageValue;
    }

    public void setMortgageValue(double mortgageValue) {
        this.mortgageValue = mortgageValue;
    }

    public double getDownPayment() {
        return downPayment;
    }

    public void setDownPayment(double downPayment) {
        this.downPayment = downPayment;
    }
}

package samples.MIPCalculate;

/**
 * MIP - Mortgage Insurance Premium
 */
public class MIP {

    private double annualMIP;

    public double getAnnualMIP() {
        return annualMIP;
    }

    public void setAnnualMIP(double annualMIP) {
        this.annualMIP = annualMIP;
    }
}

Rule Service Configuration (service.rsl)

An in-line rule set is used within the service.rsl file as follows.

...