Creating boolean expressions
A boolean expression is used in the test attribute of the <when> XML tag.
The boolean expression should evaluate to true or false. When the expression evaluates to true, the corresponding <when> condition is met, the content between the <when> and </when> XML tags will be executed.
left_operand operator right_operand
where operator is one of the logical or comparison
operators. Similar to most programming languages, you can use a combination
of operators to operate on a number of operands, to create more complex
boolean expressions.
id.222.response.TCRMPersonNameBObj.LastName = 'Smith'
id.222.response.TCRMPersonNameBObj.LastName = 'Smith' and
id.222.response.TCRMPersonNameBObj.GivenNameOne = 'John'
This boolean expression will test whether the person's
last name is Smith and first name is John.Understanding the position of the operand
In some programming languages, there is no restriction on whether an operand appears on the left side or right side of the operator. For example, the expressionLastName = 'Smith' and
the expression 'Smith' = LastName are both allowed.
This is, however, not the case with boolean expressions used in composite
XML transactions.- A backward reference to an attribute value
- The count function (see Understanding supported functions)
- A backward reference to an attribute value
- A keyword (see Understanding supported keywords)
- A constant value, such as John Smith, Y, or 1234
- The date function (see Understanding supported functions
If the wrong type of operand appears in the boolean expression, an exception will be thrown at parsing time.
Understanding supported functions
The framework supports two functions that can be used in expressions:- count
- date
The format of the count function is count(argument), where argument is a backward reference to a business object. The count function returns a numeric value that equals to the number of occurrences of the specified business object.
count(id.111.response.TCRMPersonSearchResultBObj) = 0
The count function is intended to test the number of occurrences in a collection, hence the argument is expected to resolve to a collection at runtime. If the argument resolves to a single instance, the count function will throw an exception.
The format of the date function is date(argument), where argument is the string representation of a date. The date function ensures that the string argument can be converted into a date object.
id.111.response.TCRMPartyBObj.PartyLastUpdateDate = date('2005-12-31 12:00:00.000')
Understanding supported keywords
The only supported keyword is null. Use the null keyword with another backward reference to test whether that reference exists or not.
id.111.response.TCRMPersonBObj.AlertIndicator = nullid.111.response.TCRMPersonBObj.TCRMFinancialProfileBObj = null