Work with rules if you like to create more complex or technical rules. You can create and edit them in the provided Rules editor.
To create a rule inside a rule set, right-click the rule set in the My Rule Sets tree and select Create Rule.

Figure: Creating a Rule
The Rules view opens view displaying the following properties along with the Rules editor:
To edit a rule, double-click the rule node of the rule in the Outline. The Rule Editor view opens. You can add code or edit code directly in the Rule Editor.
The editor is based on the Ace editor and provides the following functionality for creating and editing technical rules:
To add code for technical rules you need to be familiar with the Drools Rules language. For details on this language, you can refer to according online documentation, e.g. http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch05.html.
In our Rules code editor, you do not need the declare section, as parameters are mapped via the Rule Set properties already. However you can use declarations for temporarily required parameters.
Note
For the time being you need to append _field to each variable in the
code. This is not implemented for auto-completion yet.
The toolbar provides the following functionality:
| Option | Icon | Description |
|---|---|---|
| Select Theme | ![]() ![]() |
Sets the editor theme (default = Chrome). |
| Select Font Size | ![]() ![]() |
Sets the editor font size (default = 12pt) |
| Line # | - | Enter the line number to go to in the code field. |
| Find | - | Text to search for. Search and Replace functionality |
| Go to Previous | ![]() |
Go to the previous hit in search. This icon is disabled on the first hit. |
| Go to Next | ![]() |
Find the next hit in search. |
| Replace | - | Value to replace hit(s) with. |
| Replace Current/Replace All | ![]() ![]() |
Replaces hits with value specified in Replace field. Click the drop arrow to change to the replace action to Replace Current or Replace All. To apply the selected replace action click the icon. |
When adding your rule, you can use the auto-completion functionality provided by the editor. Click Ctrl-Space to show proposals for code, variable or data type completion.
If code keywords exist for the letter or letter sequence you enter, the according proposals are given. Choose your keyword in the list to be added to your code.
If code snippets exist for the letter or letter sequence you enter, the according proposals are given. For example, in case you enter the letter r , the following keywords and snippets are offered:

Figure:
Choosing an auto-completion option
Choosing the snippet results in the following added code:

Figure: Snippet
added as code
Local variables that are defined for the Rule set are proposed for auto-completion.

Figure: Auto-completion provided for local variables
Auto-completion is provided for data parameters specified for the Rule Set.

Figure: Auto-completion provided for data
To delete a rule from a rule set right-click the rule in the My Rule Sets tree and select Delete.

Figure: Deleting a Rule
A confirmation dialog opens to confirm the deletion of the rule.

Figure:
Deletion Confirmation Dialog
All open views respective to the deleted Rule will be closed.
You can rename a rule by one of the following actions:
