This documentation supports the 9.1 version of Remedy Action Request System.

To view the latest version, select the version from the Product version menu.

Using the XPATH function for web service qualifications

When web services are published in BMC Remedy AR System, the Get and Set operation types accept a qualification string. At run time, a query is made using the specified qualification, and the Get, GetList, and Set operations are executed on the entries that the query returns. The format of the qualification string is similar to that used in the advanced query bar in the user client, but an additional function called XPATH is used for web service qualifications.

To access the available XPATH expressions, use the Expression Editor. See To construct XPATH expressions in the Expression Editor.

An XPATH expression identifies an XML element inside an XML document. Its syntax is similar to a directory path. When creating XPATH expressions, follow these guidelines:

  • The XPATH function takes one argument, which must be an expression referencing an element or an attribute in the input mapping of the operation.
  • The element or attribute being referenced does not have to be mapped to a field; it might exist only in the XML schema and be used only for qualification.
  • The expression must start with /ROOT and must list all the elements in the path including the one being referenced.
  • When referencing an attribute, use @ before the attribute name.
  • The XPATH function can be used anywhere in the qualification, and a value is substituted based on the XML data type.
  • For strings, BMC Remedy AR System adds extra double quotation marks around the value.
  • For date-time fields, the XML date/time string is converted to the number of seconds.
  • If more than one element matches the expression, the first element is considered.
  • An entire qualification string can be passed as one of the XML elements in the input document to create totally dynamic queries. This is analogous to using the EXTERNAL function.
  • If an element is missing in the input document, it is resolved to $NULL$.

XPATH expressions are similar to field references, for example, suppose you have this qualification:


'RequestID' = $RequestID$

$RequestID$ is the value of the RequestID field in the current entry, and 'RequestID' is the field to search on.

Similarly:


'RequestID' = XPATH("/ROOT/RequestID")

XPATH("/ROOT/RequestID") is the value of the RequestID in the current XML document, and RequestID is the field to search on.

This is an example of an XML document and some sample qualification strings using XPATH expressions:


<? xml version="1.0" ?>
<ROOT>
	<Employee ID="112">Adam</Employee>
	<Address>
		<Street>1500 Salado Dr</Street>
		<City>Mountain View</City>
	</Address>
	<HireDate>2004-01-01T00:00:00.0000000-08:00</HireDate>
	<query>
		<qualification>'Employee_ID' > 100</qualification>
	</query>
</ROOT>

Sample qualification

XPATH resolved qualification

Comments

'Employee_Name'=XPATH(/ROOT/Employee)

'Employee_Name'="Adam"

Employee is of type string.

'Employee_ID'=XPATH(/ROOT/Employee/@ID)

'Employee_ID'=112

ID is an attribute of type integer.

'City'=XPATH(/ROOT/Address/City)

'City'="Mountain View"

City is of type string.

'HireDate'=XPATH(/ROOT/HireDate)

'HireDate'=1009872000

HireDate is of type dateTime. It converts to the number of seconds since 1/1/1970.

'State'=XPATH(/ROOT/Address/State)

'State'=$NULL$

State does not exist in the input document.

XPATH(/ROOT/query/qualification)

'Employee_ID'>100

Qualification is of type string.


For information about the XPATH specification, see http://www.w3.org/TR/xpath.

To construct XPATH expressions in the Expression Editor

  1. Expand the WSDL operation panel where you want to add the XPATH expression.
  2. Click the ellipsis button [...] next to the Qualification field to open the Expression Editor.
  3. In the Expression Editor, expand the Fields panel.
    XPATH panel in the Expression Editor
    (Click the image to expand it.)
  4. Double-click a field name, so that it appears in the editing field.
  5. Click the = button.
  6. Expand the XPATH panel.
  7. Double-click an XML element so that it appears in the expression editing area.
    Alternatively, you can highlight an element and click the Add XPATH button.
  8. Verify that your XPATH expression is correct, for example:
    
    'Request ID' = XPATH(/ROOT/Request_ID)
  9. Click OK to save your qualification.

    Tip

    You can also construct expressions by typing in the editing field.

For more information about using the Expression Editor, see Using the expression editor and content assist.

Was this page helpful? Yes No Submitting... Thank you

Comments