If an application supports RESTful APIs, you can create
artifacts in that application from the business needs in IBM® Rational® 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 Rational Focal Point.
Before you begin
- Ensure that you have appropriate access to the application in
which you are creating artifacts from Rational Focal Point.
- Add the application as an outbound friend in Rational 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
- In Rational Focal Point,
open the workspace.
- Click , and
click Add view command.
- Select a view where you want to add the view command.
- In REST Client Command Configuration section, complete
these steps:
- In REST Client Connector Name,
type a name to identify the connection.
- In REST Request Method, select
the POST method. For information
about using each method, see the "Supported methods to manage resources"
topic.
- In Friends List, select the application
that you added as a friend to Rational Focal Point.
- In Choose Unique Attribute to POST,
click Select and select an attribute. This
attribute is empty. After the first POST operation, it stores the
response URL from the application. So, for subsequent POST operations,
if the URL is same, the POST operation does not happen for that URL.
- In REST Application Request URL,
type the top-level URL of the area in the application where you are
creating artifacts. For example, for the Requirements Management
application, use the requirement creation factory URL. To get this
URL, typically you use the root services URL to get the RMCatalog
URL. You use the RMCatalog URL to get the project area URL; then you
use the project area URL to get the requirement factory URL.
- 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
XML to load dynamically, you can copy the XML in the REST
Application Template XML text box.
Note: For the POST operation,
you must know the XML structure of the application where you are posting
artifacts. So you get the XML either dynamically or manually. After
getting the code, that XML must support posting of new data to the
application. In some applications, if the XML does not support that,
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.
- In the Attribute Mapping section,
click Add, and map the Rational Focal Point attributes
with the attributes of the application. For example, if
you map the Title attribute of Rational Focal Point with
the Name attribute of the application, after the POST operation, the
Name attribute in the application is changed to Title.
- In the Response section, complete these steps:
- In REST Application Template XML,
specify the XML that is received in response to the GET method or
specify any other XML of the application. In the Root XPath
to REST Application Artifact specify the root XPath to
attributes, and then 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 Rational Focal Point attribute. The application header stores the XML of that application. Typically,
the Rational solution for CLM applications
header is Location.
- In the Configuration section, complete these steps:
- In REST Application supported Date Format,
type the date format that the external application uses.
- 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.
- To map the IDs of the attributes between Rational Focal Point and
the application, in the Request Parameter Table section, click Add,
and select a Rational Focal Point attribute.
Type the ID of the application in the Key column. For example, if you select Project ID for Rational Focal Point,
in the Key column, type the ID that is used
for the project ID in the application.
- 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 |
- Click Save.
- In the Display menu, select the
view the elements of which you want to create in the other application.
- To create all the artifacts that are available in the view,
from the view toolbar click the dropdown list and select the POST
view command and then click the Go icon
.
- To create one artifact, from the artifact toolbar select
the POST view command and then click the Go icon
.