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.
-
Add products to installs directory.
-
Run 'init.sh' or 'init.bat' file. 'init.bat' must be run with Administrative privileges.
-
Start JBoss BRMS Server by running ./target/jboss-eap-6.4/bin/standalone.sh
-
Login to http://localhost:8080/business-central
- login for admin and analyst roles (u:erics / p:jbossbrms1!)
-
Build and deploy version 1.0 of project, verify at 'Authoring -> Artifact repository' to see deployed weightwatchers-1.0.jar artifact.
-
Open rule deployments perspective via menu Deploy -> Rules Deployments
-
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
-
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.
-
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.
-
Using Firefox + RESTClient you can see which server containers are available by accessing the following RESTful resource:
-
Add auth credentials in menu Authentication - Basic Authentication: Username: erics Password: jbossbrms1!
-
Method: GET
-
URL: http://localhost:8080/kie-server/services/rest/server/containers
-
it will show container = containerweightwatchers10, meaning our container is available via the provided RestAPI
- You can view some more information provided by the RestAPI using GET methods:
- Now to use POST or PUT methods we need to add two headers to RESTClient for our requests:
-
http://localhost:8080/kie-server/services/rest/server/containers/instances/containerweightwatchers10
-
in menu Headers -> Custom Header
-
Name: Content-Type; Value: application/xml
-
Name: X-KIE-ContentType; Value: xstream
- Query the Realtime Decision Server with weightwatcher rules by using POST method:
-
http://localhost:8080/kie-server/services/rest/server/containers/instances/containerweightwatchers10
-
The body of the message can be found in the support/weightwatchers-query.xml file. Copy the content of this file into the Body section of RESTClient.
- 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.
The following steps can be used to configure and run the demo in a container:
-
Add product installer to installs directory.
-
Copy contents of support/docker directory to the project root.
-
Build demo image.
docker build -t jbossdemocentral/brms-weightwatcher-realtime-decision-server-demo .
-
Start demo container.
docker run -it -p 8080:8080 -p 9990:9990 jbossdemocentral/brms-weightwatcher-realtime-decision-server-demo
-
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
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.
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