JBoss BRMS Weightwatcher Realtime Decision Server Demo

This demo project is a demonstration application of a stateless Realtime Decision Server based on JBoss BRMS and includes support for complex event processing (CEP) use cases based on a pseudo clock.

Examples provided include a (REST) client sending a time series of facts in the form of weight observations to the deployed Realtime Decision Server. The Realtime Decision Server then reasons over the inputs to derive CEP insights such as average weight, least weight and weight change of a rolling time window. These insights are returned to the calling client as facts.

Option 1 - Install on local machine

  1. Download and unzip.

  2. Add products to installs directory.

  3. Run 'init.sh' or 'init.bat' file. 'init.bat' must be run with Administrative privileges.

  4. Start JBoss BRMS 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!)
    
  6. Build and deploy version 1.0 of project, verify at 'Authoring -> Artifact repository' to see deployed weightwatchers-1.0.jar artifact.

  7. Open rule deployments perspective via menu Deploy -> Rules Deployments

  8. Add a new Container to the 'local-server-123' template:

  • Name: containerweightwatchers10

  • In the search field, enter weight and click the Search button to gathers all artifacts available, SELECT com.redhat.demos:weightwatchers:1.0 to auto-fill rest of fields

  • click on Finish

  1. The container is created. Click the Start button in the upper-right of the screen to start the container. The local-server-123@localhost:8080 instance should now be displayed as on of the KIE-Servers running the template and container.

  2. Click on the local-server-123@localhost:8080 button, this will show the GroupId, ArtifactId and Version of the artifact running in the container, as well as the URL of the REST API.

  3. Using Firefox + RESTClient you can see which server containers are available by accessing the following RESTful resource:

  1. You can view some more information provided by the RestAPI using GET methods:
  1. Now to use POST or PUT methods we need to add two headers to RESTClient for our requests:
  1. Query the Realtime Decision Server with weightwatcher rules by using POST method:
  1. To create or delete of containers via the RestAPI, you need to use the PUT an DELETE methods. See the product documentation's User Guide for details.

Option 2 - Generate containerized install

The following steps can be used to configure and run the demo in a container:

  1. Download and unzip.

  2. Add product installer to installs directory.

  3. Copy contents of support/docker directory to the project root.

  4. Build demo image.

    docker build -t jbossdemocentral/brms-weightwatcher-realtime-decision-server-demo .
    
  5. Start demo container.

    docker run -it -p 8080:8080 -p 9990:9990 jbossdemocentral/brms-weightwatcher-realtime-decision-server-demo
    
  6. Follow instructions from above starting at step 5 replacing localhost with <RH_CONTAINER_HOST> when applicable

Additional information can be found in the jbossdemocentral container developer repository

Notes

You will need some sort of Rest client, such as the RESTClient Firefox extension which is used in this demo (screenshots and videos). After installing RESTClient in Firefox, restart and open it under TOOLS menu.

Supporting Articles

Released versions

See the tagged releases for the following versions of the product:

  • v1.1 JBoss BRMS 6.2.0, JBoss EAP 6.4.4 and demo rule project to deploy as Realtime Decision Server

  • v1.0 JBoss BRMS 6.1 with demo rule project to deploy as Realtime Decision Server

Loan Project

Artifact Repo

Deployment View

Kie Server Endpoint

Register Server

Dev Server

Create Container

Container Details

Start Container

Started Container

Restapi Auth

Restapi Containers

Restapi Loan Container

Restapi Request Header

Restapi Loan Request

Restapi Loan Request Response