Natural Language

Print Friendly, PDF & Email

◷ Reading Time: 5 minutes

What is 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 the 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.

To add a new Decision Requirement Diagram document,

Document Types --> Business Logic --> Decision Requirement Diagram

Once you add a document, this will be the window.

Natural Language Properties

  1. Name: Name of Natural Language file
  2. Glossaries: Link Business Glossaries or Boxed Expressions
  3. Includes: List of referenced natural language models
  4. Variables Definition: List of input and output parameters
  5. Types Definition: List of types and functions

Toolbox

There will be no item in the toolbox.

Check How to Code in Natural Language to see how to write a code in NL.

Top Menu

At the top menu, you can see the following items.

  1. Find: Find terms in the file
  2. Business Glossary: Link Business Glossaries or Boxed Expressions
  3. Logic: When you click on any line in the file, it will show the logic name of the line
  4. Find a logic: Find a logic (by name) in the file
  5. Add a new logic: Add a new logic to the file
  6. Properties: properties of the document
  7. Compile to execution plan: Show the XML code of the document

Managing Glossaries

To add or remove glossaries, you can simply click on the Business Glossary in the top menu 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 the 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 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 of shows you some information regarding a term or acceptable values.

Mouse-hovering on a term, a hint is shown about the definition of the term.

Entering a generic value (i.e., string, number, etc.) and hint shows what type of value is expected.

Entering values when the term has some selectable options, a list will ask you to chose for the right option.

Debugging

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.

Video Description

Sample Natural Language

Download the sample Natural Language (Sample-Natural-Language.zip) using the attachment.

Updated on October 22, 2019

Article Attachments

Was this article helpful?

Related Articles