Book Image

Drools Developer's Cookbook

By : Lucas Amador
Book Image

Drools Developer's Cookbook

By: Lucas Amador

Overview of this book

<p>JBoss Drools is an open source business rules engine that provides agility and flexibility to your business logic. Drools 5 has evolved to provide a unified and integrated platform for business rules, business processes, event processing and automated planning. With this book in hand you will be able to use any of these modules and their specific features quickly and with ease.<br /><br />Drools Developer Cookbook will help you to apply the latest community features to your projects. You will learn about all the Drools modules - Guvnor, Fusion, Expert, and Planner - along with jBPM5 and integration capabilities. The straightforward recipes will help you to implement even more rules in your projects and take you to a new level with the Drools platform.<br /><br />This book teaches you how to create a more robust business rules implementation, starting with tips on how to write business rules manually, or by using the newest Guvnor rule editors. You will learn how your rules can be integrated with another framework to create a full solution and discover how to use complex features such as event processing. The recipes cover all of the Drools modules and will help you to solve problems with planning, remote execution, and much more.</p>
Table of Contents (16 chapters)
Drools Developer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using the REST interface to execute commands


In this recipe, you will see how to execute commands in the Drools Server using the RESTful interface . The interaction will be made using the Apache HTTP Client , but for more details you can continue reading through the recipe.

Getting ready

Before we interact with the Drools Server, it should be deployed into a servlet container, and of course it should be started.

How to do it...

Carry out the following steps in order to learn how to interact programmatically with the Drools Server using Java:

  1. As was said before, don't forget to add the XStream 1.4.1 library dependency into your project. If you are using Apache Maven you can add the following lines in your pom.xml dependencies configuration. Otherwise, you can download the binaries from http://xstream.codehaus.org/.

    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
      <version>1.4.1</version>
    </dependency&gt...