IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Create business rules > Create a rule set
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.
For example, suppose you have a rule set which calculates the interest rate for a loan, given the loan amount.
It may look like this:
- Rule 1: primeRate = 5
- Rule 2: if amount < 1000 rate = primeRate;
- Rule 3: if amount >= 1000 rate = primeRate + 1
- Rule 4: if amount >= 5000 rate = primeRate + 2
In this situation, the behavior of the rule set will change significantly if you reorder the rules, and may even break. Caution should be taken when you reorder these rules in the web client, and the logic must be correct before you publish the changes. The best practice is to make the modifications in the tooling environment, test them, and then copy those changes to the runtime system.
That being said, it is more likely that new rules will be added using a template in the web client. Caution should be taken to make sure that the new rule is inserted correctly in the rule set. If the web user is skilled, they may be able to position the new rule correctly. If not, you can take these precautions to avoid error:
- Add a comment to the rule set which describes the general structure of the rule set, so that it is easier for the web user to make changes to it.
- Add comments to each template which clearly describe where the template instance should be located within the rule set. You can do this by referencing existing rules in the rule set, and indicating that the template should be placed before or after them.
- Keep the rule set simple. If possible, limit the actual decision count in the rule set to one. In other words, make one decision, not many.
- Use the default pattern. In this pattern, we suggest you assign the default value at the start, and then put the special case rules later. Your web users will come to learn this pattern.
- Structure your special case rules so that they are mutually independent.
For example, the rule set above would be more robust if rules 2 through 4 had the following form:
- if amount >= min and amount < max rate = primeRate + someValue
This rule could also be converted into a template which has plug-gable values for each parameter in yellow.
- If it is difficult to create mutually exclusive rules, then you should order the special case rules in ascending or descending order. This gives the web user a pattern which is easy to follow.