651.288.7000 info@intertech.com

The Purpose of this Post

This post is an example of an easy setup of Drools KIE WorkBench and KIE Server in one WildFly server instance.

Note 1: These notes use WildFly 8.2.1 for compatibility with Drools 6.4.0.  Adjust the paths accordingly for a different version.

Note 2: These instructions use Windows syntax for directories but the steps are the same for Linux.

Install WildFly

If you don’t have WildFly installed, these instructions may help.

There is no need to have WildFly running when installing and configuring KIE products.  If you have it running, ignore the errors until completing configuration.

KIE WorkBench

Download Drools KIE WorkBench 6.4.0

Copy the war file to C:\apps\wildfly-8.2.1.Final\standalone\deployments\ directory.  WildFly will auto deploy it when started (or nearly immediately if it is already running).

KIE Server

Download Drools KIE Server 6.4.0

Extract kie-server-6.4.0.Final-ee7.war from the zip.

Copy the war file to C:\apps\wildfly-8.2.1.Final\standalone\deployments\ directory.  WildFly will auto deploy it when started (or nearly immediately if it is already running).

Add Users

KIE WorkBench and KIE Server require roles for various privileges.  For our quick setup, create a user named “kieserver” with same word as password and roles for all privileges.

To do so, run this command in the WildFly bin directory:

Consider creating separate users – one for KIE Server and KIE WorkBench communication (as above) and one for each human user to author rules (the user ids).

Configure

While configuring the KIE products isn’t difficult, I’ve seen many people miss settings or have wrong values for settings and then struggle with what is wrong.  This is the key reason for this post – a nutshell of correct settings for a fast and simple setup.

One of the easier ways to configure apps in WildFly is using the conf files in the WildFly bin directory.  Add these config items towards the top of the C:\apps\wildfly-8.2.1.Final\bin\standalone.conf.bat file.

For clarity, I make a separate environment variables for each item.

KIE Server requires the full WildFly config:

Establish the user ids and passwords for KIE Server and KIE WorkBench communication.  For our quick setup, use the same user for both needs; use the user created earlier:

Establish the URLs for KIE WorkBench controller and KIE Server REST:

Establish the name of the KIE Server.  When creating a “server template” in KIE WorkBench, its name must match the name of a KIE Server id.  Also, the KIE WorkBench displays this name for the KIE Server when the KIE Server connects to the KIE WorkBench:

WildFly uses an environment variable named SERVER_OPTS for configuration options, so concatenate the individual environment variables into it:

(don’t forget to save the file!)

Run and Verify

Start (or restart) WildFly and monitor the log messages for errors.

Note: until the KIE WorkBench is fully started, the KIE Server cannot connect to it and it emits a 405 connection problem until it can.  This message stops once they are both running, if it doesn’t then you have a config issue.

If working correctly, this URL shows the KIE WorkBench login page: http://localhost:8080/kie-drools-wb-distribution-wars-6.4.0.Final-wildfly8/

Login with a user id and password created above.

If the login page does not appear, then review the WildFly server log and the deployment status files in the standalone dir.

This REST URL shows the KIE Server status: http://localhost:8080/kie-server-6.4.0.Final-ee7/services/rest/server/

This REST URL shows the KIE Server containers configured to it: http://localhost:8080/kie-server-6.4.0.Final-ee7/services/rest/server/containers

KIE WorkBench and KIE Server have many REST URLs to work with, so explore the Drools docs to see them.

Hopefully these steps helped your quick setup of the Drools KIE WorkBench and KIE Server.  Please let me know if I can expand on any of them for clarity.

 

Like What You've Read?

Subscribe to the Blog.

Every Friday we send that week's content from our Developers via email. Try it out!

Some ad blockers can block the form below.

You have Successfully Subscribed!

Pin It on Pinterest

Share This