JBoss BRMS 6.1 Realtime Decision Server (Rule Execution Server) & REST XML Payload

This is new in 6.1 and a very useful feature for exposing your rule as a service without having to write your own service implementation.  Previously one had the option of exposing it as s REST service using RESTEasy, the drools-camel component or other methods.  Now there is a built in mechanism to help expose the service while also being able to have some management capabilities.

This is exposed via the new kie-server webapp that is now installed with JBoss BRMS 6.1.

To get started you build & deploy your rule project, then register your rule server and add the container.  When you first start using it, the first question you may wonder is, what is the payload for this new rest service.  The message body is unique based on the facts used by the rules.  So what does an example XML payload look like?

<batch-execution>
<insert out-identifier="customer" return-object="true" entry-point="DEFAULT">
<com.redhat.test.brmstest.fact.Customer>
<accountCount>0</accountCount>
<firstName>John</firstName>
<lastName>Doe</lastName>
</com.redhat.test.brmstest.fact.Customer>
</insert>
<insert out-identifier="account" return-object="true" entry-point="DEFAULT">
<com.redhat.test.brmstest.fact.Account>
<balance>100.0</balance>
<customer reference="../../../insert/com.redhat.test.brmstest.fact.Customer"/>
<number>C-12345</number>
<type>CHECKING</type>
</com.redhat.test.brmstest.fact.Account>
</insert>
<fire-all-rules/>
</batch-execution>

I have included an example java class which generates the payload for you based on your fact model.  This is in the brms-rule-service project.  It uses the command based API of KIE.  At the moment only an XML payload is available.

My brms-example github project includes more details as well as more detailed instructions.

This is also available in the superset product JBoss BPM Suite 6.1


References:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.1/html/User_Guide/chap-The_Realtime_Decision_Server.html
https://opensourcebpm.wordpress.com/2015/03/30/jboss-brms-6-1-rule-execution-server/


comments powered by Disqus