Just after the XML-Schema definitions come the Java objects we
reference in our rules. These objects can come from any Java
library as required.

Next comes our functions, which can incorporate standard Java
code. In this case, we incorporate a logging function to help us
see what is going on.

After that comes our rule set, consisting of one or more
rules.

Each rule can take parameters (the StockOffer
class), one or more conditions that need to be fulfilled, and a
consequence that is carried out if and when the conditions are
met.

Having modified and compiled our code, we run the JUnit test
simulations again. This time, the business rules are called, our
logic evaluates correctly, and our tests pass, as seen in Figure 3.
Congratulations--you've just built your first rule-based
application!