http://www.drools.org/
I always develop a very simple example, which recommends some products for ganeder and age. I describe drools sample. Apache web application prompts ganeder and age, and executes drools to display the recommendation result. For example, if gender is male and age is greater than 20 and age is less than 29, then recommends products A and products B. I also put this kind of business rules into Excel and Excel macro generates drools syntax. So, what business people need to do is simply meintain Excel spredsheets. Decision table is one of the most powerful tools for business rules and easy for business people to develop, add, remove and manage business rules.
A simple recommendatio sample:
<rules xmlns="http://drools.org/rules">
<semantics module="org.drools.semantics.java"/>
<rule-set name="Recommendation Rules"
<rule name="over 20">
<parameter identifier="recommendation">
<java:class type="recommendation.Recommendation"/>
</parameter>
<>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 1 ))
</java:condition>
</condition>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 2 ))
</java:condition>
</condition>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 3 ))
</java:condition>
</condition>
<>
<condition>
<java:condition>recommendation.getAge() >= 20</java:condition>
</condition>
<>
<consequence>
<java:consequence>
System.err.println( "** over 20" );
recommendation.setSS( "ProductA" );
System.err.println( recommendation.getSS());
recommendation.setCheckStatus(1);
System.err.println( recommendation.getCheckStatus());
modifyObject( recommendation);
</java:consequence>
</consequence>
</rule>
<rule name="between 20 and 30">
<parameter identifier="recommendation">
<java:class type="recommendation.Recommendation"/>
</parameter>
<>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 2 ))
</java:condition>
</condition>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 3 ))
</java:condition>
</condition>
<>
<condition>
<java:condition>recommendation.getAge() >= 20</java:condition>
</condition>
<condition>
<java:condition>recommendation.getAge() <30
I always develop a very simple example, which recommends some products for ganeder and age. I describe drools sample. Apache web application prompts ganeder and age, and executes drools to display the recommendation result. For example, if gender is male and age is greater than 20 and age is less than 29, then recommends products A and products B. I also put this kind of business rules into Excel and Excel macro generates drools syntax. So, what business people need to do is simply meintain Excel spredsheets. Decision table is one of the most powerful tools for business rules and easy for business people to develop, add, remove and manage business rules.
A simple recommendatio sample:
<rules xmlns="http://drools.org/rules">
<semantics module="org.drools.semantics.java"/>
<rule-set name="Recommendation Rules"
<rule name="over 20">
<parameter identifier="recommendation">
<java:class type="recommendation.Recommendation"/>
</parameter>
<>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 1 ))
</java:condition>
</condition>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 2 ))
</java:condition>
</condition>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 3 ))
</java:condition>
</condition>
<>
<condition>
<java:condition>recommendation.getAge() >= 20</java:condition>
</condition>
<>
<consequence>
<java:consequence>
System.err.println( "** over 20" );
recommendation.setSS( "ProductA" );
System.err.println( recommendation.getSS());
recommendation.setCheckStatus(1);
System.err.println( recommendation.getCheckStatus());
modifyObject( recommendation);
</java:consequence>
</consequence>
</rule>
<rule name="between 20 and 30">
<parameter identifier="recommendation">
<java:class type="recommendation.Recommendation"/>
</parameter>
<>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 2 ))
</java:condition>
</condition>
<condition>
<java:condition>
!(recommendation.getCheckStatus().equals( 3 ))
</java:condition>
</condition>
<>
<condition>
<java:condition>recommendation.getAge() >= 20</java:condition>
</condition>
<condition>
<java:condition>recommendation.getAge() <30