Versions Compared

Key

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

...

This guide demonstrates a service for getting quotations, which uses business rules for creating quotations.
 

Sample Configuration

Table of Contents
maxLevel4
minLevel4

Sample Rule Definition

Rules

Rule 1: If the customer has bronze status, then the item costs five dollars.

Rule 2 : If the customer has silver status, then the item costs four dollars.

Rule 3 : If the customer has gold status, then the item costs three dollars.

Facts

There is a fact named A customer made a get quote request. Quotation is used to capture the result of the rules execution.

Code Block
languagejava
 package samples.userguide;

 package samples.quotation;

 /**
  * Customer fact
 */
 public class Customer {

    private String status;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
 }

 package samples.quotation;

 /**
  * Quotation result
 */
 public class Quotation {

    private int price;

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
            this.price = price;
    }
 }


 Rule Service Configuration (service.rsl)

...