Designer:Natural Language

From FlexRule Wiki
Jump to: navigation, search

FlexRule Designer > Authoring Basics > Building Natural Language Documents

Natural Language (NL)

NL is a way of modeling business rules and logic using business terminologies. The benefit of using Natural Language is that it hides all the technical complexity (i.e., expressions, method call, etc.) from users. Modeling logic and business rules in NL

  1. Define a business glossary.
  2. Define context of rules (given)
  3. Define your rules and logic (when section)
  4. Extend the rule using other logic (when sections)

Adding New NL

To add a new NL, you can simply select Natural Language in a Decision or Validation folder.

New-Nl Document.png

And here is a screenshot of your FlexRule Designer with an NL document opened:


Managing Glossaries

To add or remove glossaries, you can simply click on the Business Glossary in the toolbar:


And the following screen that allows you to manage references of glossaries for this NL file will be displayed:


To learn more about managing Glossaries please visit business glossaries.

Rule Context

By setting up the rule context, you pass information to the rule for execution. The Rule context can be defined by Input Parameters of the rule. A Natural Language rule can define input and output parameters in a Natural Language context section. When both Declaration and Natural Language context is used, the result will be the union of all of the parameters.

Logic Format

These are blocks of when-then-otherwise-end. To understand more about Natural Language please check here.

Entering Logic

There are two ways to ask for suggestions while entering rules:

  1. Pressing 'CTRL + Space' on keyboard
  2. Hovering the mouse on a Term

The editor then suggests the next step in a list, or shows you some information regarding a term or acceptable values.


Like other type of logic, validation is available on an NL document. It marks the problem with an error icon as well as listing the issue under the Message List window.



Debugging enables you to step into every line of your logic, execute that specific line and then check the values on the Parameter window in an NL document.


In order to start the debugging mode make sure you provide values for the input parameters as expected.

Please visit Debugging Instruction to understand more about debugging.

Learn more

To learn more about Natural Language please check here