Over a million developers have joined DZone.

Using Business Rules in Your Bluemix Applications Without Hardcoding Them

· Cloud Zone

Download the Essential Cloud Buyer’s Guide to learn important factors to consider before selecting a provider as well as buying criteria to help you make the best decision for your infrastructure needs, brought to you in partnership with Internap.

IBM Bluemix provides a service to define business rules external to your application code. This allows changing rules more dynamically without having to recompile and redeploy the complete application.

There is plenty of documentation available that I won't repeat here: Business Rules documentation, developerWorks articles and samples and tutorials. Below is just a quick summary for what this service can be used and how to leverage it in Bluemix.

The example I'm using is from an article Build a hotel booking application which provides a detailed description how the service works. In this scenario a business rule is defined to determine the pricing of a hotel based on the date of the booking offering early booking discounts or last-minute offers. With the business rules service this can be done without low level programming skills using a Rule Designer plugin in Eclipse.

After the service has been created in Bluemix, you can get your connections settings.

In Eclipse you need to use these settings when deploying the rule to Bluemix from your IDE.

After the rule has been deployed to Bluemix, you can execute it via REST APIs. There is a Java sample that shows how to do this. You can also invoke the rule and receive the results in a Node-RED flow. Check out the sample flow. The dashboard of the service also provides an easy way to test the service.

The Cloud Zone is brought to you in partnership with Internap. Read Bare-Metal Cloud 101 to learn about bare-metal cloud and how it has emerged as a way to complement virtualized services.

cloud,ibm,business rules,paas,cloud platforms,ibm bluemix,eclipse

Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}