Servoy and Drools Rules Engine

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Servoy and Drools Rules Engine

Postby rossent » Fri Dec 09, 2011 10:55 am

Hi all,

Has anyone tried to use the Drools Rules engine with Servoy? I am interested to know if we can use directly the JSRecord, JSFoundset and JSRelation in the rules (without having to write any Java classes) to access their properties.
For example, if we have an order table, can we use in the drools rule something like:

Code: Select all
<rule-set name="cheese rules"
    xmlns="http://drools.org/rules"
    xmlns:java="http://drools.org/semantics/java">

    <rule name="Order Discount">
      <parameter identifier="order">
        <class>com.servoy.j2db.dataprocessing.IRecord</class>
      </parameter>
      <java:condition>order.getValue("total_amount") > 1000</java:condition>
      <java:consequence>
         order.setValue("discount_percent", 15.5);
      </java:consequence>
    </rule>

</rule-set>
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

Return to How To

Who is online

Users browsing this forum: No registered users and 8 guests