In this chapter, we'll start writing our first set of rules in Drools. We'll go through some basics needed to write and execute rules. We'll learn the necessary keywords of the Drools rule language.
But before all this, we'll have to set up our development environment. If you haven't already done so, please refer to Appendix A on development environment setup.
We'll now write our first Drools rule. Let's say that we have an
Account bean that has one property called
balance. For every
Account bean, in which the balance is less than
100, we'll write a message to the standard output as follows:
package droolsbook; rule "basic rule" when Account( balance < 100 ) // condition then System.out.println("Account balance is ...