spring boot with drool decision tree example

Example 1: decision tree drools using spring boot

KieServices kieServices = KieServices.Factory.get();

Example 2: decision tree drools using spring boot

public class Customer {
    private CustomerType type;
 
    private int years;
 
    private int discount;
 
    // Standard getters and setters
 
    public enum CustomerType {
        INDIVIDUAL,
        BUSINESS;
    }
}

Example 3: decision tree drools using spring boot

Resource dt 
  = ResourceFactory
    .newClassPathResource("com/baeldung/drools/rules/Discount.xls",
      getClass());
 
KieFileSystem kieFileSystem = kieServices.newKieFileSystem().write(dt);

Tags:

Misc Example