18.8. Creating a New Rule

Procedure 18.3. Task

  1. Create an empty text .drl file.
  2. Copy and paste your rule into it.
  3. Save and exit.
  4. Alternatively, use the Rules Wizard to create a rule but pressing Ctrl+N or by choosing it from the toolbar.
  5. The wizard will ask for some basic options for generating a rule resource. 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. (That is, it establishes a namespace for grouping related rules.)
  6. Select the options that suit you and click Finish.
Result

You now have a rule skeleton which you can expand upon.