
Predefined XPath extension functions
You can use XPath extension functions in the BPEL process editor to provide additional functionality. Predefined extension functions are included with IBM® Integration Designer.
In addition to standard XPath functions described in the XPath 1.0 specification (http://www.w3.org/TR/xpath), you can use the following predefined extension functions in your XPath expressions and conditions. If these predefined extension functions do not meet your organization's needs, you can create and define custom extension functions. For more information, see BPEL processes: Creating custom XPath extension functions.
XPath extension functions defined by BPEL
The BPEL specification defines the following XPath extension functions, which are also supported in IBM Process Server. The namespace for these functions is: http://schemas.xmlsoap.org/ws/2004/03/business-process/
- bpws:getVariableData(variableName)
- Returns the BPEL variable with the indicated name.
- bpws:getVariableData(variableName , partName or XPath expression )
- If the variable indicated by variableName specifies a WSDL message, this function returns the indicated part of this BPEL variable. Otherwise, it evaluates the XPath expression on the BPEL variable variableName.
- bpws:getVariableData(variableNam , partName, XPath )
- Returns the evaluation result of the XPath expression applied to part partName of the WSDL message stored in the BPEL variable variableName.
- bpws:getVariableProperty(variableName , propertyName )
- This function is used to extract the property value propertyName from BPEL variable variableName. Note that the property value must be a qualified name.
- bpws:getLinkStatus(linkName )
- This function is only available in join conditions of arbitrary activities. For linkName, you may only use names of incoming links for the activity associated with the join condition.
- If a transition condition exists on the link, this method returns the result of this transition condition. If there is no transition condition, this function returns true if this link was navigated, and returns false, if this link was not navigated because of dead-path elimination, such as a previous link returned false in a transition condition, therefore all subsequent links were not navigated.
XPath extension functions for Business Objects
For easier work with Business Objects, the following functions are available. The namespace for these functions is: http://www.ibm.com/xmlns/prod/websphere/wbi/BusinessObject/6.0.0
- bo:create( typeNamespace , typeName )
- Returns an empty instance of the XSD complex type indicated by typeNamespace and typeName. You get these values by opening the appropriate data type with the Business Object Editor. Review these values in the properties view.
- bo:equals( variable1 , variable2 )
- Returns true if variable1 and variable2 are equal, otherwise false. If the type of variable1 is a simple type, the equals() function of the corresponding Java™ type is used. If both variables are represented by Business Objects, that is they are either interface type or refer to a complex type or element, the extension function delegates the evaluation to isEqual() operation of the system SCA service BOEqual. In all other cases, false will be returned.
Miscellaneous XPath extension functions
Furthermore, there are some extension functions to provide access to several objects within a BPEL process. The namespace for these functions is: http://www.ibm.com/xmlns/prod/websphere/business-process/6.0.0
- wpc:getCustomProperty (propertyName)
- Returns the value of the custom property propertyName defined on the process level.
- wpc:getCustomProperty( propertyName , activityName )
- Returns the value of the custom property propertyName defined on the activity activityName. If parameter activityName is null, the custom property defined on the process level is returned. activityName is the name of an activity, not the display name. As the name of an activity is optional in BPEL, you need to specify it if you want to access its custom properties. BPEL lets you use the same name on several activities. Nevertheless, if you try to access the custom properties of such an activity, you will get an exception as the name is ambiguous. Therefore, avoid using the same name for different activities.
- For activities within while loops, you will get the custom property of the last execution of the activity, that is if you access the custom property within a while loop, you always get the current instance of the indicated activity. If you access the custom property of an activity within a while loop from outside the while loop, you get the instance of the last while iteration.
- Arbitrary activities within event handlers and forEach activities can only be accessed from within the same event handler.
- wpc:getServiceRefForProcessTemplate( processTemplateName , portTypeNamespace , portTypeName )
- Returns a service reference to the port type portTypeNamespace, portTypeName of the process specified by processTemplateName. If multiple versions of a process template are available, you get the service reference to the current valid version. Make sure that you have added an export with SCA binding for the corresponding process component in the assembly editor. Otherwise, no service reference can be returned.
- You can use this function for example on the from part of an assign activity and assign the result to an partner link.