IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Business rule management programming > Programming model
Exception Handling
Exceptions can occur when validation is called on an artifact or when an artifact is published. When a validation error occurs, the ValidationException is thrown with a list of problems. If there is a problem during publishing due to another transaction publishing the same artifacts, a ChangeConflictException is thrown. Anytime another transaction is detected as changing an artifact, the ChangeConflictException exception is thrown.
There is a SystemPropertyNotChangeableException which is thrown if a property which duplicates a system property name is attempted to be changed. System properties cannot be changed.
There is a ChangesNotAllowedException which is thrown if a set operation is attempted on an artifact as it is being published.
Figure 1. Class diagram for BusinessRuleManagementException and related classes
Business Rule Group problems
Problems which can occur when a business rule group is validated or an attempt to publish the business rule group is made and a portion of the business rule group is not valid.
Business Rule Group problems Exception Description ProblemBusRuleNotInAvailTargetList Problem that occurs when a rule is specified as the default business rule for an operation selection table but the rule artifact is not in the list of available targets for that operation. A valid business rule from the list of available targets on the operation should be specified to avoid this problem. ProblemDuplicatePropertyName This problem occurs when a property is attempted to be created which is a duplicate of a system or user-defined property on a business rule group. A unique property name should be used to avoid this problem. ProblemOperationContainsNoTargets Problem that occurs when an operation does not have a default rule destination or any scheduled rule destinations set. The operation should be set with at least one rule destination as either the default or at a scheduled time to avoid this problem. ProblemOverlappingRanges Problem that occurs when an operation selection record has a start date or end date which overlaps with the range of another operation selection record start date and end date. This overlap in date ranges prevents the business rule runtime from finding the correct rule destination to invoke. The start date or end date of the other operation selection records for an operation should be checked to ensure there is not an overlap to avoid this problem. ProblemStartDateAfterEndDate This problem occurs when the start date for an operation selection record is after the end date for that selection record. This problem can occur for any operation selection record except the default record which does not have a start date or end date. Specify a start date after the end date on an operation selection record to avoid this problem. ProblemTargetBusRuleNotSet Problem that occurs when an operation selection record has a rule specified which is not in the list of available target rules. A rule from the available target list should be specified to avoid this problem. ProblemTNSAndNameAlreadyInUse Problem that occurs when a new business rule is created with a target name space and name which is already in use by a rule set or decision table. A check is done on all rule sets and decision tables associated with the current business rule group as well as any rule artifact stored in the repository. A different target name space or name should be used to avoid this problem. ProblemWrongOperationForOpSelectionRecord Problem that occurs when a new operation selection record is added to an operation selection record list and the operation of the new record does not match the operation of the records in the list. A new operation should be created using the newOperationSelectionRecord method on the correct operation selection record list object to avoid this problem.
Rule set and Decision Table problems
Rule set and Decision Table problems Exception Description ProblemInvalidBooleanValue Problem that occurs when a parameter for a rule template in a rule set or an action value or condition value in decision table receives a different value than “true” or “false” for a parameter of type Boolean. Examples of incorrect parameter values would be “T” or “F”. Use values of “true” or “false” when working with a parameter of type Boolean to avoid this problem. ProblemParmNotDefinedInTemplate Problem that occurs when a value is specified for a template parameter and the parameter is not defined in the list of valid parameters for the template. The parameters should be checked before setting in the template. It can occur for RuleTemplate, TreeActionValueTemplate, or TreeConditionValueTemplate templates. ProblemParmValueListContainsUnexpectedValue Problem that occurs when valid parameters are passed with a template, however, there are too many parameters for the parameter. The number of parameters should be reduced. It can occur for RuleTemplate, TreeActionValueTemplate, or TreeConditionValueTemplate templates. ProblemRuleBlockContainsNoRules This problem occurs when all rules in a rule block in a rule set are removed and the rule set is attempted to be validated or published. The rule block in a rule set must have at least one rule. ProblemTemplateNotAssociatedWithRuleSet Problem that occurs when a rule is attempted to be added to a rule set and the rule was created with a template which is not defined with that rule set. When creating a new rule, a template which has been defined in the rule set should be used to avoid this problem. ProblemRuleNameAlreadyInUse Problem that occurs when a rule is attempted to be added to a rule block in a rule set and it has the same name as an existing rule in the rule block. The names of the rules should be checked beforeadding a new rule to avoid this problem. ProblemTemplateParameterNotSpecified This problem occurs when a parameter is not included when a template is updated for a rule in a rule set or action or condition value in a decision table. All parameters for a template should be specified to avoid this problem. ProblemTypeConversionError This problem occurs when a parameter for a template cannot be converted to the appropriate type All parameters are treated as string objects and then converted to the parameter type (boolean, byte, short, int, long, float, and double). If the parameter value string cannot be converted to the specified type for this parameter, then this error occurs. To avoid this problem, a string that can be converted to the parameter's type (boolean, byte, short, int, long, float, and double) should be specified. ProblemValueViolatesParmConstraints This problem occurs when a parameter is not within the enumeration or range of values which have been defined within the template for that parameter. This problem can occur for parameters restricted with enumerations or ranges in rule templates in a rule set or action value or condition value templates in a decision table. A value which is within the enumeration should be used to avoid this problem. ProblemInvalidActionValueTemplate Problem that occurs when a template instance is attempted to be set on the value definition in a tree action but the corresponding template is not available to that tree action. Use the correct template to create a value definition in a tree action in order to avoid this problem. ProblemInvalidConditionValueTemplate Problem that occurs when a template instance is attempted to be set on the condition definition in a case edge but the corresponding template is not available to that case edge. Use the correct template to create a condition definition in a case edge in order to avoid this problem. ProblemTreeActionIsNull This problem occurs when a new condition value is created and an action is not set with a template instance. Using a template from the ActionNode, create a new template instance and set it in the list of TreeActions.