About Samuel Santos

Java and Open Source evangelist, JUG leader and Web advocate for web standards and semantic technologies.

Running Drools 5.4.0 Final as a JBoss AS 7 module

Drools 5 introduces the Business Logic integration Platform which provides a unified and integrated platform for Rules, Workflow and Event Processing. It’s been designed from the ground up so that each aspect is a first class citizen, with no compromises.

Drools 5 has splitted up into 4 main sub projects:

  • Drools Guvnor (BRMS/BPMS)
  • Drools Expert (rule engine)
  • Drools Flow (process/workflow)
  • Drools Fusion (cep/temporal reasoning)

In this example we will focus on how we can use Drools Expert inside JBoss Application Server 7.

  1. We are using JBoss AS 7.1.1.Final which can be downloaded from the following link: http://www.jboss.org/jbossas/downloads.
  2. Download Drools 5.4.0.Final from the following link: http://www.jboss.org/drools/downloads.
  3. Extract the downloaded Drools drools-distribution-5.4.0.Final.zip (87.7 MB).
  4. Create a directory with the name org/drools/main inside the JBoss AS7 modules directory jboss-as-7.1.1.Final/modules.
  5. Copy all the binaries (JAR) files from drools-distribution-5.4.0.Final/binaries and paste them inside the jboss-as-7.1.1.Final/modules/org/drools/main.
  6. Create a file module.xml inside jboss-as-7.1.1.Final/modules/org/drools/main as the following:
    <?xml version='1.0' encoding='UTF-8'?>
    <module xmlns='urn:jboss:module:1.1' name='org.drools'>
      <resources>
        <resource-root path='antlr-2.7.7.jar'/>
        <resource-root path='antlr-3.3.jar'/>
        <resource-root path='antlr-runtime-3.3.jar'/>
        <resource-root path='bcmail-jdk14-138.jar'/>
        <resource-root path='bcprov-jdk14-138.jar'/>
        <resource-root path='dom4j-1.6.1.jar'/>
        <resource-root path='drools-clips-5.4.0.Final.jar'/>
        <resource-root path='drools-compiler-5.4.0.Final.jar'/>
        <resource-root path='drools-core-5.4.0.Final.jar'/>
        <resource-root path='drools-decisiontables-5.4.0.Final.jar'/>
        <resource-root path='droolsjbpm-introduction-docs-5.4.0.Final.jdocbook'/>
        <resource-root path='drools-jsr94-5.4.0.Final.jar'/>
        <resource-root path='drools-persistence-jpa-5.4.0.Final.jar'/>
        <resource-root path='drools-templates-5.4.0.Final.jar'/>
        <resource-root path='drools-verifier-5.4.0.Final.jar'/>
        <resource-root path='ecj-3.5.1.jar'/>
        <resource-root path='guava-r06.jar'/>
        <resource-root path='hibernate-jpa-2.0-api-1.0.1.Final.jar'/>
        <resource-root path='itext-2.1.2.jar'/>
        <resource-root path='javassist-3.14.0-GA.jar'/>
        <resource-root path='jsr94-1.1.jar'/>
        <resource-root path='jta-1.1.jar'/>
        <resource-root path='jxl-2.6.10.jar'/>
        <resource-root path='knowledge-api-5.4.0.Final.jar'/>
        <resource-root path='knowledge-internal-api-5.4.0.Final.jar'/>
        <resource-root path='log4j-1.2.14.jar'/>
        <resource-root path='mvel2-2.1.0.drools16.jar'/>
        <resource-root path='protobuf-java-2.4.1.jar'/>
        <resource-root path='slf4j-api-1.6.4.jar'/>
        <resource-root path='stringtemplate-3.2.1.jar'/>
        <resource-root path='xml-apis-1.3.04.jar'/>
        <resource-root path='xmlpull-1.1.3.1.jar'/>
        <resource-root path='xpp3_min-1.1.4c.jar'/>
        <resource-root path='xstream-1.4.1.jar'/>
      </resources>
    </module>
  7. Make sure that your WAR file has the right dependencies defined inside the META-INF/MANIFEST.MF as the following:
    Dependencies: org.drools

    Where org.drools is the name of the module which we created in previous steps.

 
Related Posts

 
Reference: Running Drools 5.4.0 Final as a JBoss AS 7 module from our JCG partner Samuel Santos at the Samaxes blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


8 − = seven



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close