Designer:Web Components/Natural Language

From FlexRule Wiki
Jump to: navigation, search

The Natural Language editor is a web component based on JavaScript and HTML DOM which simply allows you to integrate the authoring experience into your web application. You can apply your own style by overriding its CSS configuration.

Download

Download and install FlexRule Designer from http://download.flexrule.com and in the Samples folder you will see the project and libraries for WebComponents.

Natural Language

The NL editor allows you to write business rules and logic in a smart text editor

FlexRule Natural Language Editor.png

This smart editor for Natural Language:

  1. Builds colorful text from your rules based on different tokens depending on their types (i.e., values, operators, terms, etc.)
  2. Fully understands and integrates the references Business Glossaries
  3. Understands Logic calling, definition and parameterization
  4. Provides pop-ups to suggest terms, logic and expressions

API

Loading

// Creates a natural language editor
// return: reference to the NL editor
toNaturalLanguage(config)
 
// Load the NL content to editor
// content: string content of the NL in XML format
loadNaturalLanguage(content)
 
 
// Lists references glossaries
// return: an array of string
getGlossaries()

toNaturalLanguage

config is a JSON object that has:

  • size
size

Set the size of NL editor.

toNaturalLanguage(size: { width: 630, height: 500 })

Glossary

// Lists references glossaries
// return: an array of string
getGlossaries()
 
// Loads the glossary into NL editor to apply glossary token coloring logic
// content: string content of a glossary in XML format
loadGlossary(content)

Generate Model

// Generates the XML representation of the Natural Language 
getNaturalLanguage()

Parameters

Visit Signature of rules in web editors using JavaScript

More

  1. Decision Table
  2. Flow and Workflow
  3. Natural Language