Integrating : Integrating with applications that support REST XML APIs : Creating artifacts from Focal Point to another application
  
Creating artifacts from Focal Point to another application
If an application supports RESTful APIs, you can create artifacts in that application from the business needs in Focal Point. For example, you can create requirements in the Requirements Management application of the Rational solution for Collaborative Lifecycle Management from the business needs in Focal Point.
Before you begin
Ensure that you have appropriate access to the application in which you are creating artifacts from Focal Point.
Add the application as an outbound friend in Focal Point. For more information, see Connecting to the Rational solution for Collaborative Lifecycle Management application server.
Make sure that the content of the application that supports REST APIs is in the XML format.
Be aware of the XML structure of the application artifacts and have the rights to access them.
Procedure
1 In Focal Point, open the workspace.
2 Click the Settings icon Settings iconand then, from the Configure group, click REST client view command. Click Add view command.
3 Select a view where you want to add the view command.
4 In REST Client Command Configuration section, complete these steps:
In REST Client View Command Name, type a name to identify the connection.
To provide an alias of your choice, edit the default alias.
In REST Request Method, select the POST method. For information about using each method, see Supported methods to manage resources.
In Friends List, select the application that you added as a friend to Focal Point.
In Choose Unique Attribute to POST, click Select and select a Focal Point attribute. You can select any empty attribute such as text, URL, or integration link attribute.
In REST Application Request URL, type the top-level URL of the area in the application where you are creating artifacts. Use the available discovery mechanisms to fetch the URL for your application. For example, you can use the requirement creation factory URL for the Requirements Management application. To discover the requirement creation factory URL, use the root services URL to find the RMCatalog URL, and use the RMCatalog URL to find the project area URL. The project area URL can be used to locate the requirement factory URL.
5 In the REST Client Template XML Configuration section, complete these steps:
In REST Application URL to Template XML, type the URL that points to an artifact in the application, and click Get Template XML. The XML loads in the REST Application Template XML text box. If you do not want the XML to load dynamically, copy the XML in the REST Application Template XML text box.
For the POST operation, you must know the XML structure of the application where you are posting artifacts. You can get the XML either dynamically or manually. After getting the code, the XML must support the posting of new data to the application. In some applications the XML does not support that. In such case, you have to manually create or edit the XML.
In Root XPath to REST Application Artifact, click Select, and select the root XPath for attributes. The Select button is enabled only if the XML in REST Application Template XML is correct.
6 In the Attribute Mapping section, click Add, and map the Focal Point attributes with the attributes of the application. For example, if you map the Title attribute of Focal Point with the Name attribute of the application, after the POST operation, the Name attribute in the application is changed to “Title”.
7 In the REST Client POST Response Configuration section, map the attributes and the header:
To map the attributes, in REST Application Template XML, specify the XML received in response to the POST method.
In Root XPath to REST Application Artifact specify the root XPath to attributes.
in Response Attribute Mapping click Add to map the attributes.
In the Response Header Mapping section, click Add to map the application header with a Focal Point attribute.
For example: Typically, the Rational solution for CLM application header is Location. In this case, Location is mapped to the URL of the newly created resource in the Rational solution for CLM application.
Note On mapping the attributes and header, the attribute selected in the Choose Unique Attribute to POST field in Step 4d is replaced by the Response Header or the XML attribute value.
8 In the Configuration section, complete these steps:
In REST Application supported Date Format, type the date format that the external application uses.
Examples:
yyyy-MM-dd'T'HH:mm:ss.SSS'Z for IBM Rational Team Concert
yyyy-MM-dd for the Requirements Management application
In Focal Point Separator, type a separator value such as a comma (,) or a semicolon (;). The MultiChoice and the LinkedList items will be separated by the specified separator.
Validate a command configuration by executing the command in the Debug mode. To execute the command in the Debug mode, select the Run in Debug Mode check box. After the command is executed, the resulting page displays the following information: the REST Client view command name, the User Authentication Info, the REST Request Method, the Request URL, the Request Header, the Request XML, the Response Code, the Response Header, and the Response field with a link to download the debugging information.
To hide the command from the Select Batch Command to execute list displayed in the Display View Commands window, select the Hide Command in execute window check box.
9 To map the IDs of the attributes between Focal Point and the application, in the Request Parameter Table section, click Add, and select a Focal Point attribute. Type the ID of the application in the Key column. For example, if you select Project ID for Focal Point, in the Key column, type the ID that is used for the project ID in the application.
10 In the Request Header Mapping section, click Add, and type the name and value of the header. For the Rational solution for CLM applications, the headers are as follows:
 
Header name
Header value
Accept
application/rdf+xml
Content-Type
application/rdf+xml
OSLC-Core-Version
2.0
11 In the REST Client Command Scheduler section, select the check box to schedule the REST Client command. Click Save.
12 In the Display menu, select the view the elements of which you want to create in the other application.
13 To create all the artifacts that are available in the view, click the dropdown list from the view toolbar, and select the POST view command. Then, click the Go icon Go.
14 To create one artifact, from the artifact toolbar select the POST view command and then click the Go icon Go.
Go up to
Integrating with applications that support REST XML APIs