BusLogicDemoVaadin is a simple project that demonstrates the use of ABL's transactional business logic engine with the Vaadin framework. This page explains how to install and run the demo, which includes the runtime jar. Visit the downloads page to obtain the full product, with documentation and samples.
BusLogicDemoVaadin uses the same database schema, and the same business logic, as the basic AutoBusLogic. However, unlike the basic demo, which is built using straight JSP, this demo is built entirely using Vaadin as the GUI framework.
The project can be downloaded as a ZIP'ed file.
Once you have the file, you'll want to extract it, which will result in a directory named BusLogicDemoVaadin. This directory is a Vaadin project that can be imported into Eclipse, or any other IDE. We'll focus on Eclipse here, but the process should be similar in other environments.
Before doing this, you'll want to make sure that you have the Vaadin Studio plugin installed, since it does make life easier. It is available from the Vaadin web site.
You will also require JDK 1.5 or later. This demo does not work with JDK 1.4 or earlier.
To load the project into Eclipse (typically in a new workspace):
At that point, you should see a screen similar to:
The demo is a simplistic (but not trivial) order management application. In this application, you can:
Whenever you edit something (e.g. change the customer's credit limit, add an item to an order, change an item's quantity, etc...), the transactional business logic fires when the transaction is committed. If it succeeds, the GUI is then notified to refresh whatever data has been changed.
Once you are in the demo, we suggest you try the following:
If you check the "Paid" checkbox for an order, you will notice that the customer's balance will decrease by the amount of the order. That's because only unpaid orders count towards a customer's balance.
If you change a customer's credit limit to be less than the balance, you will get a constraint violation, and the transaction will be rolled back.
Again, you will see adjustments rolled up to customer. You can try a very large quantity to fire the Credit Limit Exceeded constraint.
While this may all seem simple, there is actually quite a bit going on here. In this particular case, the following rules are involved:
Notice that we never specifically invoked any of these rules. They were invoked automatically as part of the commit process. And they were invoked in the correct order, because the logic engine understands the dependencies between them.
This means that the application doesn't have to know (or care) about the rules, and can just focus on the task at hand (allowing the user to manipulate data), rather than worry about enforcing the underlying business logic.