Release Notes
Abstract
This document describes various problems and solutions that relate to business rules for case management in IBM Business Automation Workflow and IBM Cloud Pak for Business Automation.
Content
Symptom: In calculations involving integers, if the result of the calculation is a float value, the decimal places might be removed even though the assigned variable is a float value. For example, a rule has the following variables:
- Int1 and Int2 (Integers)
- Float1 (Float)
then
set the Float1 of CaseType1 to (the Int1 of CaseType1 * the Int2 of CaseType1) / 10;
If Int1=10 and Int2=10, Float1 is correctly set to 10. But if Int1=7 and Int2=7, Float1 is set to 4 instead of 4.9 because the decimal places are truncated.
Cause: The IBM Operational Decision Manager embedded rules that are integrated with Case Manager Builder expect that the first value in the expression is a float value.
Resolution: Modify the rule so that the first value in the expression is a float value. For example, multiply the expression by 1.0 so that a float value is returned, as shown in the following modified rule:
then
set the Float1 of CaseType1 to 1.0 * (the Int1 of CaseType1 * the Int2 of CaseType1) / 10;
Rule execution fails with null pointer exception when you use variables with null values in conditions
Symptom: A rule does not run and a null pointer exception such as the following message is written in the system log files..Caused by: ilog.rules.engine.IlrUserRuntimeException: null
at call to 'mainRuleflow flow task body'
at call to 'execute'
at ilog.rules.engine.sequential.IlrWorkingMemoryTupleIterator.iterate(IlrWorkingMemoryTupleIterator.java:124)
at ilog.rules.engine.sequential.IlrSEQBaseExecTask.executeBodyOnWorkingMemory(IlrSEQBaseExecTask.java:161)
at ilog.rules.engine.sequential.IlrSEQBaseExecTask.executeBody(IlrSEQBaseExecTask.java:123)
at ilog.rules.engine.sequential.IlrSEQBaseExecTask.runBody(IlrSEQBaseExecTask.java:80)
at ilog.rules.inset.IlrExecRuleTask.executeJITRules(IlrExecRuleTask.java:257)
at ilog.rules.inset.IlrExecRuleTask.execute(IlrExecRuleTask.java:244)
at ilog.rules.inset.IlrExecTask.run(IlrExecTask.java:108)
at ilog.rules.engine.IlrTaskEngine.execute(IlrTaskEngine.java:629)
at ilog.rules.inset.IlrExecTaskInstance.execute(IlrExecTaskInstance.java:110)
at ilog.rules.engine.IlrTaskEngine.executeItem(IlrTaskEngine.java:461)
at ilog.rules.engine.IlrTaskEngine.executeSubFlow(IlrTaskEngine.java:273)
at ilog.rules.inset.IlrExecFlowTask.execute(IlrExecFlowTask.java:66)
at ilog.rules.inset.IlrExecTask.run(IlrExecTask.java:108)
at ilog.rules.engine.IlrTaskEngine.execute(IlrTaskEngine.java:629)
at ilog.rules.inset.IlrExecTaskInstance.execute(IlrExecTaskInstance.java:110)
at ilog.rules.engine.IlrTaskEngine.executeItem(IlrTaskEngine.java:461)
at ilog.rules.engine.IlrTaskEngine.startMainFlow(IlrTaskEngine.java:297)
at ilog.rules.engine.IlrTaskEngine.executeMainFlow(IlrTaskEngine.java:250)
at ilog.rules.engine.IlrContext.execute(IlrContext.java:3993)
at ilog.rules.engine.IlrContext.execute(IlrContext.java:2697)
at com.ibm.rules.res.xu.engine.cre.internal.CREManager.performExecute(CREManager.java:161)
Cause: Values were not set for one or more case properties that are retrieved in the rule.
In the following rule, Str1 and Str2 are string case properties in the CaseType1 case type. If no value was set for Str1 before the rule runs, the rule fails.
if
the Str1 of CaseType1 contains "Hello"
then
set the Str2 of CaseType1 to "Hello World";
In the following rule, DT1 and DT2 are datetime case properties in the CaseType1 case type. If no value was set for DT1 before the rule runs, the rule fails.
if
the DT1 of CaseType1 is in April
then
set the DT2 of CaseType1 to 1/1/2013;
In the following rule, Float1 and Float2 are float case properties in the CaseType1 case type. If no value was set for Float1 before the rule runs, the rule fails.
if
the Float1 of CaseType1 is between 1.1 and 99.9
then
set the Float2 of CaseType1 to 101.99;
In the following rule, Int1 and Int2 are integer case properties in the CaseType1 case type. If no value was set for Int1 before the rule runs, the rule fails.
if
the Int1 of CaseType1 is more than 30
then
set the Int2 of CaseType1 to 100;
Resolution: Use defensive programming techniques to ensure that values are set for all case properties whose values are retrieved in a business rule. For example, you can add conditions to check for null values for string and datetime properties. Alternatively, you can declare variables in the definitions section of the rule and add conditions to check for null values.
For string values, you can include a check for null values:
if
the Str1 of CaseType1 is not null and the Str1 of CaseType1 contains "Hello"
then
set the Str2 of CaseType1 to "Hello World";
For datetime values, you can include a check for null values:
if
the DT1 of CaseType1 is not null and the DT1 of CaseType1 is in April
then
set the DT2 of CaseType1 to 8/1/2013;
For float values, you can declare a variable that is assigned the number of the float value and then add a condition to check that a value is set for the property.
definitions
set 'FloatVar1' to a number in { the Float1 of CaseType1 };
if
FloatVar1 is between 1.1 and 99.9
then
set the Float2 of CaseType1 to 100.1;
For integer values, you can declare a variable that is assigned the number of the integer and then add a condition to check that a value is set for the property.
definitions
set 'IntVar1' to a number in { the Int1 of CaseType1 };
if
IntVar1 is more than 30
then
set the Int2 of CaseType1 to 100;
Similar names for single-value and multi-value case properties are not displayed in the completion menu
Symptom: If a case type has similar names for a single-value and multi-value property, only one of the two names is displayed in the completion menu.Cause: The rules integration in Case Manager Builder appends the letter “s” to the display name for multi-value properties. If there is a single-value property with a similar name, only one of the two properties is displayed in the completion menu. For example, a case type has a single value integer property “Samples”, and a multi-value integer property “Sample”. Because the rules integration in Case Manager Builder appends an “s” to the display name for multi-value properties, the display name for the multi-value integer property is “Samples”. Only one of the two properties is displayed as “Samples” in the completion menu.
Resolution: When you specify display names for properties, ensure that single-value and multi-value property display names will not be the same after an “s” is appended to the display name of the multi-value property.
Avoid special characters in property display names
Symptom: If property display names include special characters such as double quotes (“), braces {}, brackets [], asterisks (*), or parentheses (), the syntax checker in the rules editor and the rule validation reports errors.Cause: Operational Decision Manager APIs are used to build the vocabulary for the rules, and some of the special characters are considered as delimiters and rule grammar elements.
Resolution: Avoid special characters in property display names.
Languages that have specific gender notations are represented with a common gender notation in the rule editor and completion menu
Symptom: If a rule refers to case type properties that have gender specific display names, a common gender representation is used in the rule editor. For example, in French, if there is a case property with a display name “Personne”, the rule editor shows “le Personne” instead of “la Personne”.Cause: The embedded rules integration does not support genders in the vocabulary.
Resolution: To ensure that the rule is syntactically correct, use the completion menu to specify the gender notation for properties.
Some menus and buttons appear in English for bidirectional languages such as Arabic and Hebrew.
Symptom: For bidirectional languages such as Arabic and Hebrew, some of the menus in the rule editor are displayed in English instead of the bidirectional language. For example, the completion menu options are displayed in English.Cause: Arabic and Hebrew support is available only for grammars and vocabulary.
Resolution: Wherever support is not available for Arabic and Hebrew translation, the options appear in English.
Arrays cannot be assigned values in definitions for data types other than strings
Symptom: When arrays are assigned values in the definitions section of a rule, the rule execution fails and the following error message is written in the SystemOut.log file:Caused by: com.ibm.rules.res.xu.internal.XUException: GBRXU0436E: The ruleset parsing process failed.
at com.ibm.rules.res.xu.ruleset.IlrRulesetParsingWork.run(IlrRulesetParsingWork.java:97)
... 1 more
Caused by: com.ibm.rules.res.xu.engine.cre.internal.RulesetParseException: GBRXU0014E: The parsing of the ruleset /TOS03_cmicmint4vm14_NG048/3.0/NG048_CaseType1_Rule1/1.0 failed 'IRL/NG048$_$CaseType1$_$Rule1.irl', line 8: error: A method 'populateCollection(java.lang.Object[], java.util.Collection)' of class 'ilog.rules.brl.IlrCollectionUtil' cannot be applied to the parameters (boolean[ ],java.util.Vector).
at com.ibm.rules.res.xu.engine.cre.internal.RulesetParser.createRulesetParseException(RulesetParser.java:131)
at com.ibm.rules.res.xu.engine.cre.internal.RulesetParser.parseArchive(RulesetParser.java:83)
at ilog.rules.res.xu.ruleset.factory.internal.IlrXURulesetFactory.createCRERuleset(IlrXURulesetFactory.java:316)
at ilog.rules.res.xu.ruleset.factory.internal.IlrXURulesetFactory.createRuleset(IlrXURulesetFactory.java:116)
at com.ibm.rules.res.xu.ruleset.IlrRulesetParsingWork.run(IlrRulesetParsingWork.java:91)
... 1 more
When datetime arrays are assigned values in the definitions section of a rule, the rule execution fails and the following error message is written in the SystemOut.log file:
Caused by: ERROR RTERR019: in source ?, after line ?, before lines ?, Impossible to marshal the value of the field NG048_DT1_MultiValue
at ilog.rules.xml.IlrXmlErrorReporter.formatErrorException(IlrXmlErrorReporter.java:697)
at ilog.rules.xml.runtime.IlrXmlMarshaller.marshal(IlrXmlMarshaller.java:117)
at ilog.rules.xml.binding.IlrXmlDefaultDocumentDriver.writeObject(IlrXmlDefaultDocumentDriver.java:232)
at ilog.rules.res.xu.ruleset.xml.internal.IlrXMLObjectTransformer.toString(IlrXMLObjectTransformer.java:69)
at ilog.rules.res.xu.ruleset.xml.internal.IlrXMLObjectService.toString(IlrXMLObjectService.java:149)
at ilog.rules.res.xu.ruleset.xml.internal.IlrXMLObjectService.toMap(IlrXMLObjectService.java:85)
Cause: The Operational Decision Manager rules integration cannot handle array initialization and assignment in the definition section of a rule. For example, the following rules do not run.
In the following rule, Bool1_MultiValues is a multi-value Boolean case property in the CaseType1 case type:
definitions
set 'BoolArray' to {true, false};
then
set the Bool1_MultiValues of CaseType1 to BoolArray;
In the following rule, DT1_MultiValues is a multi-value datetime case property in the CaseType1 case type:
definitions
set DateArray to { 8/1/2013, 8/2/2013 };
then
set the DT1_MultiValues of CaseType1 to DateArray;
In the following rule, Int1_MultiValues is a multi-value integer case property in the CaseType1 case type:
definitions
set IntArray to { 101, 102 };
then
set the Int1_MultiValues of CaseType1 to IntArray;
Resolution: Do not initialize Boolean, datetime, integer, or float arrays in the definitions sections of business rules.
Business rules fail if they reference collections such as "system" that are not identifiable in the context of IBM Case Manager
Symptom: Business rules that reference a system collection might fail with the following error:Exception: com.ibm.rules.res.xu.engine.cre.internal.RulesetParseException: The parsing of the ruleset /TOS01_cmnewportvm19_NG107/13.0/NG107_SystemCaseType_BRPrint/1.0 failed 'IRL/BRPrint.irl', line 6: error: Undefined variable? this.
at com.ibm.rules.res.xu.engine.cre.internal.RulesetParser.createRulesetParseException(RulesetParser.java:131)
at com.ibm.rules.res.xu.engine.cre.internal.RulesetParser.parseArchive(RulesetParser.java:83)
at ilog.rules.res.xu.ruleset.factory.internal.IlrXURulesetFactory.createCRERuleset(IlrXURulesetFactory.java:316)
at ilog.rules.res.xu.ruleset.factory.internal.IlrXURulesetFactory.createRuleset(IlrXURulesetFactory.java:116)
at com.ibm.rules.res.xu.ruleset.IlrRulesetParsingWork.run(IlrRulesetParsingWork.java:91)
at java.lang.Thread.run(Thread.java:770)
Cause: The rules runtime component cannot identify the collection named system. For example, the following action is specified for the rule:
then, print "Number of Systems: " + the number of systems in { each system };
Although this rule is syntactically valid in the context of the Operational Decision Manager business rules integration that is embedded in IBM Case Manager, the collection named system is not recognized by the rules runtime component.
Resolution: Do not refer to collections that are invalid in the context of IBM Case Manager, even if the rules editor indicates that there are no syntax errors.
Incorrect validation messages are displayed in rules editor
Symptom: Generalized errors are displayed in the rules editor for syntax mistakes. For example, for the following rule, the rule editor displays the error The word ‘<a casetype>’ is missing. The error must be The word ‘contain’ is missing,if the Bool1 Multi Values of CaseType1
then, print "Hello World";
The following rule has the correct syntax::
if the Bool1 Multi Values of CaseType1 contain true
then, print "Hello World";
Cause: The embedded rules integration provides limited support for vocabulary related error messages.
Resolution: Use the completion menus to ensure that you write rules that are syntactically correct.
Choice list is displayed twice in completion menu when used with both single-value and multiple-value case properties
Symptom: The completion menu displays a choice list twice for the single value and multiple value case properties that are associated with the choice list. For example, a solution has a string choice list STR_CL that is associated with both a single value string case property and a multiple value string case property. In the completion menu, the completion menu displays both <a STR_CL> and <STR_CLs>.
Cause: There are limitations regarding how the embedded rules integration handles collections.
Resolution: For both single value string case properties and multiple value string case properties, use the choice list that is associated with the single value string case property.
Best practice: Use "print" statements to populate ruleReturnValue for further process routing or capturing changes to custom rule parameters
The output of "print" statements are appended together. A rule step in workflow returns a single string value, ruleReturnValue, containing the output of all print statements in the rule appended together.Case properties, whenever updated in the rule, are automatically updated in the case folder by the ICM_RuleOperations component, and hence do not need an explicit print statement.
If the value of ruleReturnValue must be used for process routing, then it must be ensured that appropriate "print" statements exist in the rule, whether it is a Text-based rule or a Table-based rule.
There is no explicit value to return the changes to custom rule parameters. "print" statements must be used to return the changes to custom rule parameters.
Was this topic helpful?
Document Information
Modified date:
24 June 2022
UID
ibm16595073