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
- Define a business glossary.
- Define context of rules (given)
- Define your rules and logic (when section)
- 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.
And here is a screenshot of your FlexRule Designer with an NL document opened:
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.
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.
These are blocks of when-then-otherwise-end. To understand more about Natural Language please check here.
There are two ways to ask for suggestions while entering rules:
- Pressing 'CTRL + Space' on keyboard
- 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.
To learn more about Natural Language please check here