Integrating : Focal Point and the Rational solution for Collaborative Lifecycle Management : Setting up the integration for Focal Point and Rational solution for Collaborative Lifecycle Management applications : Configuring Focal Point as a consumer in CLM applications : Example: Finding the XPathValue of an attribute and defining the XPath expression
  
Example: Finding the XPathValue of an attribute and defining the XPath expression
To define the XPathValueFetcher business rule, you must understand the REST services provided by the REST application that you are integrating. For example, Rational Requirements Composer and Rational Team Concert™. To identify the REST application XPath value of an attribute, you can use the REST Client View Command feature of Focal Point and use this value to define the business rule. Alternatively, you can also use any of the REST client tools available for browsers such as POSTER plug-in available for Mozilla Firefox.
Before you begin
You must know how to use REST queries to access data from the sources.
You must know how to read the XML output to identify the correct XPath for the attributes you want to retrieve.
About this task
This example is about defining an XPathValueFetcher business rule to retrieve a custom attribute value from a Rational Team Concert work item and copy it to Focal Point attribute value.
Procedure
1 To identify the attribute, you require the URL of the correct artifact type in the CLM application. In Focal Point, locate the integration link attribute that you created for holding the link for Rational Team Concert.
2 Right-click the attribute to display the popup menu, and then click Copy Link Location.
3 Use the REST Client View Command option in Focal Point to check the attribute path of the artifact. Click the Settings icon Settings icon and then, from the Configure group, click REST client view command. Select any view. Specify the following information.
Provide a name for the command and select GET from the REST Request Method list.
From the Friends list, select the server friend name that you have configured to establish the connection between the applications.
In the REST Application Request URL field, copy the integration link attribute location that you copied as mentioned in step 2.
In the Request Header Mapping section, click Add and specify the Header Name as accept and Header Value as application/xml.
Click Connect.
In the Root XPath to REST Application Artifact field, click Select. From the list, select /oslc_cm:ChangeRequest.
In the Identification Mapping section, click Add.
The Identification Mapping window retrieves the list of XPath values of all the attributes in Rational Team Concert.
REST Client Command page of Rational Focal Point
From the retrieved list, search for the attribute ID that you need to verify and note down the attribute path. In this example, the attribute ID in Rational Team Concert for the Customer Request Number is CRN and the XPath attribute path is rtc_cm:CRN.
Note the XPath value for all the attributes that you require, and then close the REST Client View Command page.
4 Define the XpathValue Fetcher business rule by using the Xpath attribute path that you identified to retrieve the value from Rational Team Concert. To restrict the query to only this attribute, you can use this value in the URL parameters field.
In this example, the XPathValueFetcher rule can be:
=XPathValueFetcher('RTC-FP',"/?oslc.properties=rtc_cm:CRN","//rtc_cm:CRN[text()]","Customer Request Number","run_interval=1h")
The business rule is using the RTC-FP attribute to locate the work item in Rational Team Concert, and requesting the value for the CRN attribute, and converting it to a text value. Customer Request Number is the label in Focal Point for the CRN value and is refreshed every one hour.
Related topics
XPathValueFetcher business rule
URL link icon Integrating Focal Point with Collaborative Lifecycle Management applications
URL link icon Track projects in Focal Point with the XPathValueFetcher business rule
URL link icon Use REST client to create and synchronize resources from external applications
Go up to
Configuring Focal Point as a consumer in CLM applications