Eric D. Schabell: Red Hat Cool Store - a Vaadin powered solution

Tuesday, July 19, 2016

Red Hat Cool Store - a Vaadin powered solution

Vaadin powered front end solution for the
Red Hat Cool Store demo project.
The Red Hat Cool Store has been one of the longest running demo projects of the many that I have put together. The initial release dates all the way back to April, 2013.

It has gone through many evolutions on the JBoss middleware product side over the years, but I thought it would be a good time to look back at what the project is and how we got here with Vaadin powering the front end of the solution.

Ruling retail with JBoss BRMS

JBoss Business Rules Management System (BRMS) is an industry leading Open Source rules, events and planning solution. I have a lot of material around the introduction to JBoss BRMS and even online workshops where you can build the Cool Store application from scratch in a self paced tutorial.

The background of what the Cool Store demo project is showcasing is based on a need to showcase the JBoss BRMS features in action for our customers, partners and interested parties. This project showcases the use of business logic externalized from an application, so that updates to the business logic do not require a new build & deployment cycle for your application.
Added item highlights checkout button.

The business logic is created within JBoss BRMS in the following artifacts:

  • domain model in the form of data objects
  • business rules in various forms:
    • guided rules
    • technical rules
    • decision table
  • domain specific language (DSL)
  • ruleflow (process)
This is all fronted by an online web shopping cart application that leverages a RestAPI interfacing with the JBoss BRMS rules engine. The online web shopping cart application has been implemented using the Vaadin framework, but more on that in a minute.
Clear the shopping cart pop-up.

The workflow to be demonstrated is that you can design, build and deploy an application. After this you have JBoss BRMS with runtime access to your business logic, allowing your business owners to change that logic and having that logic picked up by the next user of your application. 

Let's look at an example to review how this works.

The CoolStore application leverages the JBoss BRMS rules to calculate the shipping costs based on your rules in the projects decision table. When you add items to the shopping cart as shown in the screenshots in this article, the various shipping tiers in the decision table will determine the price to be paid for shipping.

New checkout displays an order receipt.
Now, without re-deploying the web application, you can adjust how much the ranges are and what the shipping for the shopping cart total order will be by tweaking this table, for example:
  • the price from Tier 2 based on value totaling between $26 - $50 is $4.99
  • you can fill your cart with over $25 of materials to validate
  • edit decision table and adjust it to $6.99 
  • save changes
  • build & deploy your cool store project
  • clear the shopping cart application
  • re-order the same materials and validate the charge to shipping is now $6.99
This is all shown in a video which is included in the project documentation and based on the initial Vaadin release 1.0. This brings us to the best part of this story, how open collaboration brings out the best in all of us.

Vaadin powered front end solution

The Vaadin web application was put together using one of the original Vaadin releases and never updated over the ensuing years. That all changed on November 2015 when Matti Tahvonen, Vaadin's Marketing Manager, reached out and offered to collaborate on updating the online shopping cart application to showcase the newest versions of Vaadin.
Add item to new shopping cart.

We met online, chatted about the changes that they could help me with and I met AMahdy AbdElAziz, who forked the project to bring it up to the current version of Vaadin 7.

This includes a few new UI features that we did not spend time on and a newer look and feel to the web application.

It is amazing to see the changes between Vaadin 1.0 and the current versions. Here is an overview of what was done by AMahdy AbdElAziz (first in a five part series), but the best way to find out the differences is to try it for yourself.

Get started with Red Hat Cool Store

Getting started is pretty easy as the project is in the same template you are used to getting from my JBoss Demo Central projects, providing you with the 3-step setup you expect from us:
  1. clone the project.
  2. download the products (JBoss EAP + BRMS)
  3. run the init script for automated setup.
The updates have not stopped and AMahdy continues to keep the front end up to date with Vaadin releases. We have also pushed the entire project into the Cloud, so if you want to experiment with the containerized versions of this demo project, check out Red Hat Demo Central for more information.

Keep your eyes on the project as it continues to evolve as a JBoss BRMS cornerstone in highlighting what you are able to achieve with rules, events, planning and an easy to use web framework like Vaadin.

(This post was cross post to Vaadin's blog here.)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.