Tuesday, June 16, 2009

Create business rule groups

Component Implementation

Websphere Integration Developer v612

Create business rule groups

Business rules complement business processes and state machines. If there is condition with a variable, for example, a business rule can change the value in that variable at run time. Created by a visual programming language, a business rule makes a decision based on context. The decision can be simple or complex. Business rules are nonprocedural and the rules can be changed independently of an application.

Creating a rule group

A rule group is a container for business rules (ruleset or decision table business rules).  It also controls the timing and implementation of these business rules.
  1. In the workbench, switch to the business integration perspective.
  2. From the main menu, click File > New > Rule Group.
  3. In the New Rule Group window, specify a module (or create one if necessary by clicking New), a folder and a name for the new rule group, and click Next.
  4. In the select an interface window, browse to an existing interface or click New to create one. If you create a new interface here, you will have to create an operation using the interface editor before you can use it in the rule group.
 
This creates a rule group, and launches it in a new editor. Click any of the topics listed below to configure your new rule group.
  1. Rule group editor
    A rule group controls the timing and implementation of business rules.
  2. Specifying the rule logic for a rule group
    The rule logic is either a rule set or a decision table that is implemented at the appropriate time by the rule group. The rule logic is the destination of the rule group.
  3. Scheduling rules using the rule group editor
    The rule group editor can be used to schedule the running of a specific rule for a specific date and time.
  4. Customizing algorithms for date and time selection
    When you want to specialize the date and time selection criteria, you can create your own custom algorithm.
  5. Using rule set names in a rule group
    Each operation in a rule group contains a rule logic table, which maps a set of date ranges to a destination rule set or decision table. To avoid confusion, it is always a good practice to use rule set and decision table names which are unique within the operation. If the same name is used twice, it is more difficult to see that there are actually two different destinations.

Creating a rule set

A rule set captures decision-making business logic in the form of a series of if-then statements.
  1. In the workbench, switch to the business integration perspective.
  2. From the main menu, click File > New > Rule Set.
  3. In the New Rule Set window, specify a module (or create one if necessary by clicking New), a folder and a name for the new rule set, and click Next.
  4. In the select an interface and operation window, browse to an existing rule group, or click New to create one. If necessary, use the drop down lists to select a different interface and operation.
  5. Click Finish.
This creates a rule set, and launches it in a new editor. Click any of the topics listed below to configure your new rule set.
  1. Rule set editor
    A rule set captures decision-making business logic in the form of a series of if-then statements.
  2. Adding a variable to a rule set
    Variables store the data that are used by a rule set.
  3. Creating an if-then rule in the rule set editor
    An if-then rule determines what action to run according to the condition of the incoming message.
  4. Creating an action rule in the rule set editor
    An action rule determines what action to run no matter what the incoming message is.
  5. Creating rule set templates
    Use a rule set template to define the implementation and parameters for an if-then or action rule. This template can then be used to create new instances of the same rule using different parameters.
  6. Creating a new rule from a template in the rule set editor
    Rules can be created from existing templates. In this way, you can create a similar rule without having to redefine the implementation, and by making changes to the parameters within the constraints specified.
  7. Letting a Web user override the default values in a rule set
    In a rule set, there are often situations where you want to allow a Web user to override the default output value as programmed. To capture this in a rule set, use the following approach.
  8. Structuring an ordered rule set for modification
    In some rule sets, there may be a tight dependency between the rules and their order of processing. This is the nature of sequential execution. Here are some suggestions on how to plan for possible changes to an ordered rule set.
  9. Calling one rule set from another one
    Currently, you cannot call one rule set from another directly, you can only call out to operations which exist in another component. To work around this, separate the rule sets into two distinct rule groups, and then invoke one from the other.

Creating a decision table

A decision table captures multi-conditional decision-making business logic in tabular format.
  1. In the workbench, switch to the business integration perspective.
  2. From the main menu, click File > New > Decision Table.
  3. In the New Decision Table window, specify a module (or create one if necessary by clicking New), a folder and a name for the new decision table, and click Next.
  4. In the select an interface and operation window, browse to an existing rule group, or click New to create one. If necessary, use the drop down lists to select a different interface and operation.
  5. If you want to configure the layout of the decision table, click Next.
  6. In the Decision Table layout window, use the settings to determine how the decision table will appear in the editor. The preview shows what the table will look like.
  7. Click Finish.
This creates a decision table, and launches it in a new editor. Click any of the topics listed below to configure your new decision table.
  1. Decision table editor
    A decision table captures multi-conditional decision-making business logic in tabular format.
  2. Working with conditions in a decision table
    A condition is an evaluation of the incoming message that looks for a specific value.
  3. Configuring actions in a decision table
    An action is an operation that is executed when the appropriate conditions are met.
  4. Working with initialization action rules
    An initialization action rule automatically performs an operation of some kind when data is first being passed to a decision table.
  5. Using an otherwise condition
    An otherwise condition is used in a decision table for situations when the specified conditions will not be met. The otherwise condition cause a rule to fire when no other evaluation can be resolved.
  6. Changing the layout of your decision table
    Some decision tables are easier to understand if you change their orientation.
  7. Creating decision table templates
    Use a template to define the implementation and parameters for either a condition or an action value in a decision table. This template can then be used to create new cells with the same format, but with different parameter values.
  8. Using templates in your decision table
    The individual cells of your decision table can be populated with an existing template for the value. In this way, you can create a similar expression without having to redefine the implementation, and by making changes to the parameters within the constraints specified.
  9. Editing a decision table template
    This topic provides instructions on how to make changes to an existing templates.

Related links

 


No comments: