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.
Before we interact with the Drools Server, it should be deployed into a servlet container, and of course it should be started.
Carry out the following steps in order to learn how to interact programmatically with the Drools Server using Java:
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>...