Creating a New Rule and Wizards

You can create a rule simple as an empty text ".drl" file, or use the wizard to do so. The wizard menu can be invoked with Control+N, or by choosing it from the toolbar, where there is a menu with the JBoss Drools icon.

Figure 7.4. The wizard menu

The wizard menu

The wizard will ask for some basic options for generating a rule resource. These are just hints - you can change your mind later. For storing rule files you would typically create a directory src/rules and create suitably named subdirectories. The package name is mandatory, and is similar to a package name in Java; i.e., it establishes a namespace for grouping related rules.

Figure 7.5. New rule wizard

New rule wizard

The result of this wizard is a rule skeleton, for you to expand. As with all wizards, they are an optional help - you don't have to use them if you don't want to.