Business Rules PDF Print E-mail

The Business Rules tab allows you to create new business rules, and view or edit existing business rules.

Types of Business Rules
Constant Value

Constant value rules compare constant values to parameter values, or assign constant values to parameters.

Validation One or more constant values are defined in the rule, which references a parameter. When the rule executes, if the parameter contains any of the constant values defined in the rule, True is returned, otherwise False is returned. This rule includes data type checking; the data type of the constant values is set within the rule.

Transformation One constant value is defined in the rule, which references a parameter. When executed, the rule sets the value of the parameter to the constant value defined within the rule. Any existing data contained by the parameter is overwritten.  

Database Table

There are two types of database table queries in Lexicon: standard, and Lexicon Query. 

Standard Query The user indicates what table is being queried, and the parameters taking part in the query, including those associated with the select and where clauses. When the rule is executed, Lexicon composes the SQL statement and executes it. This is the best way to handle simple queries, as there is less work and maintenance for the user.

Lexicon Query Instead of selecting parameters participating in the database query, the user is permitted to enter the entire query SQL on their own. Lexicon then executes exactly what the user typed in when the business rule is executed. This allows the user to use more complex SQL, including functions, joins, etc. A validation query must be count-based, and a transformation query
must be select-based.

Query debugging is up to the user. Lexicon Queries execute only what the user has typed in. As a result, the user is responsible for ensuring proper syntax, parameter names, column names, etc. are used. Lexicon Queries are great for instances when you already have a working SQL statement that you need to execute in Lexicon, and don't want to worry about modeling it over again.

Validation A COUNT query is run against a database table selected by the user. The WHERE clause is defined by the user; if column names are different from Lexicon parameter names, the user may indicate this in the rule. If the count returns one or more rows, the validation returns TRUE. Otherwise, the validation returns FALSE.

Transformation A SELECT statement is run against a database table selected by the user. The columns selected, as well as the WHERE clause, are all defined by the user. If a SQL exception occurs, or the select returns more than one row of data, an error is returned. Otherwise the indicated data is
selected into the indicated parameters. 

Java and PL/SQL

This rule type allows external code to be executed as a business rule in Lexicon.

Validation An external Java or PL/SQL method is executed. The method must return a Boolean value to be a valid Lexicon target (as a validation business rule).

Transformation An external Java or PL/SQL method is executed. The method may return nothing (void Java method or PL/SQL procedure), or a value to be assigned to a Lexicon-modeled parameter. PL/SQL procedures and functions may use IN, OUT, or IN/OUT variables.

Boolean Expression

In Lexicon, Boolean Expressions play the part of conditional statements. In its simplest form, a Boolean Expression is composed only of the statement condition. For example, a validation Boolean Expression may check two critical values, and indicate that a transaction is invalid if either of those two values are blank or null. The same Boolean Expression could be linked to a transformation rule that supplies default values to the two critical attributes so that anytime they were both found to be blank, they would be assigned the default values - now the Boolean Expression is a transformation
rule because it conditionally makes the assignment.

As in this example, consider a single conditional statement used in two ways:

Validation The Boolean statement executes; its result is the result for the validation rule. If the result is false, the error message associated with the Boolean expression is returned as the error.

Transformation The Boolean statement executes. If the result is TRUE, one or more transformation rules are executed. If the result is FALSE, no further action is taken, and no errors are returned.

Boolean Expression business rules are also known as Predicates in Lexicon. 

Lexicon Expression

Lexicon Expressions allow the user to input a single line of Java code to compile and execute at runtime as the business rule. This type of business rule is useful for performing simple calculations, data type conversions, etc. Instead of having to write your own separate method or code to perform the calculation, you make the calculation itself the business rule.

Validation The Java code input by the user must result in a Boolean value.

Transformation The Java code input by the user results in a value to be assigned to a parameter. The user indicates which parameter is assigned the result.

Business Rules and Requirements

Each business rule will correspond to a requirement, or a part of a requirement, depending on the granularity of the requirements. Each business rule does only a single thing: one database lookup, execution of one Java method, validation of a single value, etc. It may take multiple business
rules executing in a pre-defined order to fully implement a more complex or high-level requirement.

Because business rules operate on parameters, you will need to define your parameters before you can define business rules.

 


OpenLexicon.org | Home arrow Documentation arrow OpenLexicon Wizard Categories arrow Business Rules
Home
News
FAQ
Downloads
Installation
Getting Started
Documentation
Forums
Training
Links
Licences
Customers & Partners
Contact Us
Login
Username

Password

Remember me
Lost Password?
No account yet? Register