Drools6.0

Drools: Decision Tables and MVEL – Quirk? Feature? Consequence?

drinkingrules I had a very interesting experience today with Drools Decision Tables and MVEL. My Decision Table has a consequence that refers to $person.name – using MVEL. It compiled, it ran and it worked. But, I had a setup.drl File in the same rule package as the Decision Table, and in that setup.drl I set …

Drools: Decision Tables and MVEL – Quirk? Feature? Consequence? Read More »

Drools 6.x Decision Table Example

Creating the Project Open Eclipse New -> Maven Project (simple project) Simple Project Group Id: com.skills421.examples.drools Artifact Id: Drools6.xDecisionTableExample Finish Structure pom.xml Facts Fact.java Person.java RuleResponse.java RuleRunner RuleRunnerException.java RuleRunner.java Rules Setup.drl DrinkingRules.xls drinkingrules Main Main.java kmodule.xml kmodule.xml Output

Drools 6.x Basic Example

Creating the Project Open Eclipse New -> Maven Project (simple project) Simple Project Group Id: com.skills421.examples.drools Artifact Id: Drools6.xExample Finish Structure pom.xml Rule Runner src/main/java com.skills421.examples.drools.controller.RuleRunner RuleRunnerException src/main/java com.skills421.examples.drools.exceptions.RuleRunnerException Fact src/main/java com.skills421.examples.drools.facts.Fact RuleResponse src/main/java com.skills421.examples.drools.facts.RuleResponse Person src/main/java com.skills421.examples.drools.facts.Person Rules src/main/resources/com/skills421/examples/drools/people DrinkingRules.drl kmodule.xml src/main/resources/META-INF kmodule.xml Main src/main/java com.skills421.examples.drools.Main Output

Drools6.0 Basic Example

This post has been updated to the very latest Drools6.x – the new post can be found here: Drools6.x Basic Example Creating the Project Open Eclipse (Kepler) New -> Maven Project Simple Project Group Id: com.skills421.examples.drools Artifact Id: Drools6.0Example Finish pom.xml [code language=”xml”] <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.skills421.examples.drools</groupId> <artifactId>Drools6.0Example</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.drools</groupId> <artifactId>drools-compiler</artifactId> <version>6.0.0.CR1</version> …

Drools6.0 Basic Example Read More »