Eric D. Schabell: JBoss BPM Suite Quick Guide - Weight Watching with a Realtime Decision Server

Wednesday, May 20, 2015

JBoss BPM Suite Quick Guide - Weight Watching with a Realtime Decision Server

(This article is based on work originally done by Stefano Picozzi, an Architect a Red Hat located in Sydney, Australia.)

Previously we wrote an extensive introduction to the new feature found in JBoss BPM Suite 6.1 called the Realtime Decision Server.

We covered the architecture, the usage and supplied you with a very simple decision table (spreadsheet) based rule set for giving out financial loans.

Rule Execution Server architecture.
This project was then deployed as a Realtime Decision Server for your applications to query where we provide some example RestAPI calls for you to test, leaving the actual integration into your eventual applications as an exercise for the reader.

The project

To make this as easy as possible for you to get started, we have put together a complete and easy to use Weightwatcher Realtime Decision Server demo project.

In this project you will find a step-by-step description that helps you to make use of your very own Realtime Decision Server.

To setup the project you just follow these simple instructions:

  1. Download and unzip.
  2. Add products to installs directory.
  3. Run 'init.sh' or 'init.bat' file.
  4. Start JBoss Server by running ./target/jboss-eap-6.4/bin/standalone.sh
  5. Login to http://localhost:8080/business-central
- login for admin and analyst roles (u:erics / p:jbossbrms1!)

Now you can note if the Realtime Decision Server is running at:


To make use of the Realtime Decision Server you will need a rule based project to deploy and this is a quick outline describing how you will get started.
  • us the provided rule project or create a new project in business central
  • create a model or import existing model
  • create simple rule using the model that you have created
  • build and deploy your project

Realtime Decision Server

DevServer created.
The following outline walks you through the process of deploying your rule project into a rule execution server so that applications can consume the provided RestAPI.

It is based on the Weightwatcher Realtime Decision Server demo project from JBoss Demo Central.
Container creation.
  • select Deploy -> Rule Deployments from business-central 
  • click Register to register your server and key in the following server information
    • Endpoint: http://localhost:8080/kie-server/services/rest/server/
    • Name: DevServer
    • Username:  erics
    • Password: jbossbrms1!
  • click connect, your server should be created
  • click + symbol at right most corner on your server
  • you’ll get a pop-up screen to create container for your rule project
    • Name: container-weightwatchers1.0
    • groupid - artifactId - version
      • you search search business central if you can't remember this information, click select button to import automatically from found item
  • container created for your rule project and exposed as a REST service that can be consumed from your application
  • select the server DevServer and click on Start in the top right corner
Container deployed and started.
You can now access this project to test with any REST client.

In our Weightwatcher Realtime Decision Server demo project we walk you through the Firefox browser RESTClient extension usage, but it is easy enough to replicate with other clients like SoapUI.

You can also view the endpoint as shown in your server which is in my case: 

http://localhost:8080/kie-server/services/rest/server/containers/container-weightwatchers1.0

The output in our case was:

<response type="SUCCESS" msg="Info for container container-weightwatchers1.0">
     <kie-container container-id="container-weightwatchers1.0" status="STARTED">
           <release-id>
               <artifact-id>weightwatchers</artifact-id>
               <group-id>com.redhat.demos</group-id>
               <version>1.0</version>
           </release-id>
           <resolved-release-id>
               <artifact-id>weightwatchers</artifact-id>
               <group-id>com.redhat.demos</group-id>
               <version>1.0</version>
           </resolved-release-id>
           <scanner status="DISPOSED"/>
     </kie-container>
</response>

With a proper XML request you can access the rule packages you expose in this manner from your applications over REST.

Looking to Automate your business?
See the detailed instructions in the Weightwatchers Realtime Decision Server demo project for exactly how to interact with the rules deployed on your server.


(*The Realtime Decision Server can be deployed along with the entire JBoss BPM Suite or with the JBoss BRMS product. While we reference only JBoss BPM Suite in this article, it can be taken to mean either product.)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.