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.

Related Whitepaper:

Java Application Development on Linux

Linux is the fastest-growing Java development platform because it saves money and time by serving as a platform for both development and deployment. But developers face significant platform-specific challenges when managing and deploying Java applications in a controlled production environment.

This is the hands-on guide to the full Java application development lifecycle on Linux. It demonstrates the platform, tools, and application development by showing realistic, easy-to-follow examples. After a simple command-line application introduces basic tools, this program leads readers through business-logic object analysis, database design, Java servlet UIs, Java Server Pages (JSP) UIs, Swing GUIs, and Standard Widget Toolkit (SWT) GUIs. Scaling up to the enterprise level provides the opportunity to use both the JBoss Application Server and the Apache Geronimo Application Servers, and Enterprise JavaBeans (EJB).

Get it Now!  

Leave a Reply


4 + three =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use
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.

Sign up for our Newsletter

15,153 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books