Allowing users to edit business rules on the web is important in modern systems. Most of the applications that are built nowadays include some web interface functionality. So in this modern era, from a business agility standpoint, it is critical to let users define business rules and apply new changes on the web without requiring application code changes nor the compilation of source code! In one of our posts regarding business policy modeling and implementation, we used decision table modeling. And if you use any web technologies for your application, you need to enable an ability to author the policy and business rules via a web interface.

In this post, we are going to extend a sample application in order to edit business rules using the web interface, as well as applying policy changes with a single click.

When you run the sample application, it allows you to enter the values below. Then by pressing the “I Feel Lucky” button, a passenger’s eligibility for the discount program will be checked:

edit business rules on web

Based on the discount policy below, you can see the reason for a 100% discount:

edit business rules on web

Now let’s say the policy changes, and the new one states ”Children less than 2 years of age traveling to the USA are eligible for a 65% discount”. To apply the change you can simply click on the red link “Edit Policy Decision Definition” and the policy decision table will be opened:

edit business rules on web

Click on the “New Rule” button and add the following values:

edit business rules on web

Now, press “Save Changes” at the top of the page, then switch back to the application and press the “I Feel Lucky!” button again:

edit business rules on web

Congratulations! You just applied and deployed your new policy without changing a single line of your application!

Conclusion

  • Applying business rules requires neither application code changes nor compilation
  • Deploying a new policy can be achieved on the web with simply a few clicks
  • JavaScript web components enable business rules authoring within your web applications.

Last updated September 22nd, 2020 at 11:28 am, Published August 25th, 2016 at 11:28 am