JBoss BRMS – adding a declarative data model to the Customer Evaluation demo

Customer Evaluation with declarative model

Customer Evaluation with declarative model

Previously I posted a demo of Business Process Management (BPM) integration with rules, using the JBoss Business Rules Management System (BRMS) product. This demo provided a look at both the developers JBoss Developer Studio (JBDS) IDE project and then the business user side with the project also in the Business Rules Manager (BRM) web tooling.

The data model at that time was built using JBDS and is nothing more than Java objects, a Person object and a Request object to be precise. These are then put into a single Java archive (jar) file and importing into the BRM project.

Declarative models

Many customers are interested in using the declarative data model, which is the data model hosted in your rules repository. You will not create Java object classes, instead you create your model using the BRM tooling guided editor.

Our declarative model in knowledge base.

Using a declarative model has some benefits:

  • it reinforces that the model belongs to the knowledge base and not to the application.
  • the model lifecycle is separate from your applications.
  • your Java types can be enriched with rule specific annotations.
  • when using imported Java archive (jar) files, they must be kept synchronized between the rules and the applications that use them, a declarative model does not.

Using the declarative model example project

The Quick Start documentation covers how to use the project to demonstrate the declarative model, but for ease of getting started:

You server log should play out something a lot like this:

16:49:24,047 INFO  [stdout] (http-/127.0.0.1:8080-3) starting new transaction
16:49:26,555 INFO  [stdout] (http-/127.0.0.1:8080-3) Entering Initialize Node
16:49:26,556 INFO  [stdout] (http-/127.0.0.1:8080-3) There as no evaluation objects defined, adding default ones for demo purposes.
16:49:26,562 INFO  [stdout] (http-/127.0.0.1:8080-3) Leaving Initialize Node
16:49:26,565 INFO  [stdout] (http-/127.0.0.1:8080-3) Gateway: Qualify Age
16:49:26,565 INFO  [stdout] (http-/127.0.0.1:8080-3) Gateway: Qualify Age
16:49:26,567 INFO  [stdout] (http-/127.0.0.1:8080-3) Entering Adult Customer Node
16:49:26,568 INFO  [stdout] (http-/127.0.0.1:8080-3) Detected and reporting valid request
16:49:26,569 INFO  [stdout] (http-/127.0.0.1:8080-3) Set validRequest to: true
16:49:26,573 INFO  [stdout] (http-/127.0.0.1:8080-3) Leaving Adult Customer Node
16:49:26,573 INFO  [stdout] (http-/127.0.0.1:8080-3) Entering Finance Rules Node
16:49:26,585 INFO  [stdout] (http-/127.0.0.1:8080-3) Leaving Finance Rules Node.
16:49:26,585 INFO  [stdout] (http-/127.0.0.1:8080-3) Gateway: Decide Financial Status
16:49:26,585 INFO  [stdout] (http-/127.0.0.1:8080-3) Determined request is valid, heading to Rich Customer Node
16:49:26,588 INFO  [stdout] (http-/127.0.0.1:8080-3) Entering Rich Customer Node
16:49:26,588 INFO  [stdout] (http-/127.0.0.1:8080-3) Detected and reporting valid request
16:49:26,588 INFO  [stdout] (http-/127.0.0.1:8080-3) Customer has amount: 5000 in the bank.
16:49:26,589 INFO  [stdout] (http-/127.0.0.1:8080-3) Leaving Rich Customer Node
16:49:26,589 INFO  [stdout] (http-/127.0.0.1:8080-3) Process ended in End Rich Customer Node.

You can examine the different ways you need to interact with the declarative model by examining the process in the web designer:

  • Initialize script task shows how to interact with process context variables and load our model with data.
  • Gateways can be viewed by examining the exit transitions, they show interaction with the model.
  • Adult Customer script task shows how facts are inserted into working memory using our declarative model.
I hope this demo helps in your understanding of the different ways our data model can be implemented in JBoss BRMS BPM projects.

About Eric D. Schabell

Eric D. Schabell is the JBoss technology evangelist for Integration and BPM products at Red Hat. He is responsible for various outbound technical aspects of promoting JBoss Enterprise Middleware integration products and services. He has been working within software development since 1998 for many different enterprises. He helps out in the JBoss jBPM project focusing as lead on the jBPM Migration project. He has authored the e-book 'OpenShift Primer - get your code into the Cloud' as found on Amazon, iTunes, etc. Follow this blog at http://www.schabell.org.

View all posts by Eric D. Schabell

One Comment on “JBoss BRMS – adding a declarative data model to the Customer Evaluation demo”

  1. Greg Hermo Says:

    Hi Eric, thanks for sharing this! Haven’t tried this yet but looks like I will have to, soon. Any chance this could be used with Alfresco?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 104 other followers

%d bloggers like this: