Basic condition syntax

There are various types of conditions that you can use to evaluate an XPath expression.

The most common operator used to evaluate an expression is = (equals), but you can use any valid XPath operator. See Basic XPath Expressions for a list of valid XPath operators.

The following examples demonstrate how to use various conditions to evaluate an XPath expression.

Example 1: Using string literals

String literals must be enclosed in quotation marks as shown in this example:

bpws:getVariableData('PatientInfo')/PV1/Department = 'ICU'

Example 2: Accessing variable data

Use the bpws:getVariableData function to access variable data

Using string literals in the getVariableData function:

The following example evaluates string nodes from two variables. The variable names in the bpws:getVariableData function are string literals.

bpws:getVariableData('PatientInfo')/PV1/Department = bpws:getVariableData('Orders')/PID/PtDept

Using numeric literals in the getVariableData function:

To evaluate numeric literals you must cast either one or both sides of the expression. For example:

number(bpws:getVariableData('PatientInfo')/PV1/Department) = bpws:getVariableData('Orders')/PID/PtDept

 - OR -

number(bpws:getVariableData('PatientInfo')/PV1/Department) = number(bpws:getVariableData('Orders')/PID/PtDept)

Example 3: Numeric literals

Numeric literals do not require quotation marks. Placing quotes around a numeric literal transforms it into a string literal.

Valid numeric expression example:

number(bpws:getVariableData('PurchaseOrder')/PurchaseOrder/POTotal) >= 5000.00

Invalid numeric expression example:

number(bpws:getVariableData('PurchaseOrder')/PurchaseOrder/POTotal) >= '5000.00'




Feedback | Notices


Timestamp icon Last updated: Tuesday, 27 September 2016


http://pic.dhe.ibm.com/infocenter/wci/v7r0m0/topic/com.ibm.wci.doc/ref_Basic_Condition_Syntax.html