Home News (12/11/08)new Start Here Getting Started Downloads Documentation Tutorials (12/07/08)new Tablets Structure Deployment Web Studio OpenL Basics Constrainernew Change Log References LGPL License Motivational Reading OpenL Apologia |
Table of Contents
OpenL Tablets Structure and SemanticsAlso see Decision Table Performance Optimization , Data Tables , TutorialDecision TableDecision Tables are the cornerstone of any Business Intelligence suite that at least pretends to be business user oriented. Just to prove this statement most of the Business Rules vendors recently included their own implementations of Decision Tables into their offerings. This document argues that Business Rules in essence always are decision tables, but may be it is a bit overstated. In any case we present to you here the best solution for integrating decision tables into your application Here is an implementation of decision table from HelloWorld.xls
On this picture you can easily see the main components of the Decision Tablet.
The first row is a header. It starts with a keyword The second row provides header for decision table columns. There is a simple naming convention for header columns: if header starts with a 'C' then it is a Condition, if it starts with an 'A' it is an Action. Since version 3.1.0.6 we introduced (optional) column Rule, where you can put Rule ID (each Decision Table row is a rule in some sense) . This column is optional and can be used for tracing and documentation purposes. Also it can anchor multi-row rule (in case of array parameters).
The third row contains code snippet that actually gets executed according to decision table logic. This code has a standard Java syntax, and therefore can be easily written by any
Java programmer.
As you can see, this code uses both parameter from the header The fourth row provides column parameter definitions. Each condition and action can have one or more parameters. The data in the columns will be converted into appropriate types using the following rules:
The fifth row contains Column Display Names or human readable columns descriptions. Everything below the fifth row is Decision Table data. This data is used as parameter values when code snippets are executed Expressions in Decision TableIn addition to literal data Decision Table supports expressions in table cells. Expressions should start with '='. Due to the fact that Excel expressions also start with '=', expression cells also should be entered as text fields (starting with apostrophe). For example, expressionx+5must be entered literally as '=x+5 Single '='in a cell is not considered an Expression. The alternative way of entering expressions is to put cell content in '{'... '}' brackets instead of using '='. Expression Type must be compatible with the column type. Decision Table Algorithm
Decision Table Rows (Rules) are executed from top to bottom.
In "classic" decision tables all rule rows are executed.
OpenL Tablets also provide the alternative way of execution by using
so-called Each Rule conditions are checked from left to right. This process stops after the first failure. If all Conditions are checked, all the Actions are being performed from left to right. Conditions and Actions with empty parameter cells are ignored. To see more examples of Decision Tables in action check OpenL Tablets Tutorial Also see Data Tables , Tutorial |