TIBCO EBX®
Rules Portfolio Add-on Documentation > User Guide
Navigation modeRules Portfolio Add-on Documentation > User Guide

Quick rules configuration

Rules configuration overview

This section describes how to configure the most common types of rules as highlighted in the table below. These configurations do not use all properties available to adapt rule behavior just the most common ones.

Use case

Context

Data set execution

Result

Rule implemented using Java without conditions of execution

No

No

The Java-implemented rule executes on any data set without any conditions.

Rule implemented using a script without conditions of execution

No

No

The script-based rule executes on any data set without any conditions.

Rule executed on a data set

No

Yes

The rule is executed on a data set only without any additional conditions.

Rule executed on a data set with an execution condition implemented using Java

Yes

Yes

The rule is executed on a data set only with a condition of execution. The condition is defined by a rule which is implemented by Java.

Rule executed on a data set with an execution condition implemented using a script

Yes

Yes

The rule is executed on a data set only with a condition of execution. The condition is defined by a rule which is implemented by Script.

Java implementation without execution conditions

This type of rule executes on any data set without any execution conditions. The rule cannot execute unless its 'Active' property is set to 'Yes'. The following rule example basically says "One class has no more than 10 students".

Step 1: Creation of the "Rule definition" (see screen-shot below).

/Step1_Creation_Of_The_Rule_Definition_1.png

The 'Code', 'Name' and 'Description' properties describe the rule from a business point of view. While the 'Implementation type' property specifies how you define the rule. If it is set to 'Use Script', the 'Script' tab displays and you can implement the rule using Scripting Language. If you set the property to 'Use Java implementation' the 'Java Implementation' tab displays and you can use a predefined rule. The 'Active' property allows you to deactivate the rule if necessary.

For a Java-implemented rule, you can define an unlimited number of rule definitions with different configurations. The "Property data" parameter published by the implemented rule makes its adaptation possible.

The configuration of a Java implementation is shown below and uses the 'Test 03: One class has no more than 10 students' rule.

/Step1_Creation_Of_The_Rule_Definition_2.png

Step 2: Creation of the "Rule execution"

A "Rule execution" declares the conditions that permit a defined rule or set of rules to execute. To create a "Rule execution":

/Step2_Creation_Of_The_Rule_Definition.png

Script implementation without execution

This type of rule executes on any data set without any execution condition. The rule cannot execute unless you set its 'Active' property to 'Yes'. This rule example basically says "One class has no more than 10 students".

Step 1: Creation of the "Rule definition" (see screen-shot below).

/Script_Implementation_Without_Execution_1.png

The content of script code is shown below:

/Script_Implementation_Without_Execution_2.png

The Rule definition is based on the script that you enter in the 'Script' tab. In this example, the rule statement "One class has no more than 10 students" is represented by the scripting code shown above.

Other properties in this rule are the same as properties of first example except the 'Use script' field is set to 'Yes'.

Step 2: Creation of the "Rule execution"

/Script_Implementation_Without_Execution_3.png

Refer to the first example for information on the "Rule execution" creation.

Rule executed on a data set

This type of rule is executed on a data set only and without any other execution conditions. The 'Active' property must be set to 'Yes' otherwise it cannot be executed.

The following example states "One class has no more than 10 students".

Step 1: Creation of the "Rule definition"

/Rule_Executed_On_A_Dataset.png

The configuration of Java implementation is shown below:

/Step1_Creation_Of_The_Rule_Definition_2.png

Refer to the first example for information on creating the "Rule definition".

Step 2: Creation of the "Rule execution"

/Step2_Creation_Of_The_Rules_Execution.png

A "Rule execution" is created to declare the conditions that allow the defined rule's execution. In this example, only the 'Data set execution' property is used to limit the rule execution. The 'Execution context' property is set to 'No context' because there is no condition of execution.

Java implementation requiring execution conditions

This type of rule executes on any data set if certain execution conditions are valid. The rule's 'Active' property must be set to 'Yes' otherwise its execution is not permitted.

The following rule example states: "When the score is greater than 100, the system will auto correct to 100".

Step 1: Creation of the "Rule definition"

/Java_Implementation_Requiring_Execution_Conditions.png

The configuration of Java implementation is shown below:

/Java_Implementation_Requiring_Execution_Conditions_2.png

Step 2: Creation of the "Rule execution"

/Java_Implementation_Requiring_Execution_Conditions_3.png

A "Rule execution" declares the conditions that allow the defined rule's execution. In this example, an execution context and data set execution are defined together to limit the rule execution. Additionally, the condition of execution is implemented using Java so the 'Execution context' property is set to 'Use java implementation'. The image below shows the configuration set in the 'Java implementation' tab.

/Java_Implementation_Requiring_Execution_Conditions_4.png

Script implementation requiring execution conditions

This type of rule is executed for a specific data set if certain execution conditions are valid. The rule's 'Active' property must be set to 'Yes' otherwise execution is not permitted.

The rule example states "When score is greater than 100, the system will auto correct to 100".

Step 1: Creation of the "Rule definition"

/Script_Implementation_Requiring_Execution_Conditions_1.png

The content of Script code is shown below:

/Script_Implementation_Requiring_Execution_Conditions_2.png

Refer to the first example for information on the "Rule definition" creation.

Step 2: Create the "Rule execution" to declare conditions that allow the rule's execution. In the example shown below an execution context and data set execution limit rule execution. Additionally, notice the 'Execution context' property is set to 'Use script'.

/Script_Implementation_Requiring_Execution_Condition_3.png

The image below shows the configuration in the 'Script tab.

/Script_Implementation_Requiring_Execution_Conditions_2.png

Creating new rules with predefined assertions

Certain situations can lend themselves to using pre-built assertion rules to create new rules. These pre-built rules are script-based and alleviate the need to hand-code Java. The following lists the available pre-built assertion rules:

For example, to check if field (F) in a table (T) is empty, configure the following rule execution:

/Creating_New_Rules_With_Predefined_Assertions.png

During execution, when the condition of execution is validated (the table field is empty), the rule executes and returns a value of 'False' which logs an error in the validation report. If the field is not empty, then the rule is not executed and no error is logged.

You can extend this type of configuration using a script to implement any execution context.