How to use DNG ReqIf api for creating REQIFDEFINITION which includes artifacts or module/views.
I have tried using below api for creating reqif definition
REQUEST URL: https://localhost:9443/rm/reqif_oslc/definition?componentURI="MyComponentURI"
METHOD: POST
REQUEST HEADER:
Accept: application/rdf+xml
Oslc-Core-Version: 2.0
Content-Type: application/rdf+xml
oslc.configuration: https://localhost:9443/gc/configuration/82
REQUEST BODY:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:dng_reqif="http://jazz.net/ns/rm/dng/reqif#"
xmlns:dcterms="http://purl.org/dc/terms/">
<dng_reqif:ReqIFDataDefinition rdf:about="">
<dcterms:title>test_ReqIfDefinition</dcterms:title>
<dcterms:description></dcterms:description>
<dcterms:identifier></dcterms:identifier>
<dng_reqif:includeLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_reqif:includeLinks>
<dng_reqif:includeFolders rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_reqif:includeFolders>
<dng_reqif:includeTags rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_reqif:includeTags>
<dng_reqif:isMigration rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</dng_reqif:isMigration>
<dng_reqif:preserveReqIFIdentifiers rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">true</dng_reqif:preserveReqIFIdentifiers>
<dng_reqif:include rdf:parseType="Resource">
<dng_reqif:ViewDefinitionSelection rdf:parseType="Resource">
<dng_reqif:module rdf:resource="https://localhost:9443/rm/resources/AIYDc16sEeqZK_TySw08xg"/>
<dng_reqif:view rdf:resource="https://localhost:9443/rm/views/-N-BUWqVEeqGiqHth5VF3w"/>
</dng_reqif:ViewDefinitionSelection>
</dng_reqif:include>
</dng_reqif:ReqIFDataDefinition>
</rdf:RDF>
RESPONSE BODY:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:jfs="http://jazz.net/xmlns/foundation/1.0/"
xmlns:rmReqIF="http://www.ibm.com/xmlns/rdm/reqif/"
xmlns:j.0="http://open-services.net/ns/config#"
xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
xmlns:xs="http://www.w3.org/2001/XMLSchema#">
<rmReqIF:ReqIFDataDefinition rdf:about="https://localhost:9443/rm/reqif/_A6YmwXfoEeqGiqHth5VF3w">
<rmReqIF:includeTags rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>true</rmReqIF:includeTags>
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
></dcterms:description>
<j.0:component rdf:resource="https://localhost:9443/rm/cm/component/_lHi2QC-LEequz6N99mc0aw"/>
<rmReqIF:includeLinks rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>true</rmReqIF:includeLinks>
<dcterms:identifier>_8564859e-4e64-4d81-943d-7ea909342a87</dcterms:identifier>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>test_ReqIfDefinition</dcterms:title>
<rmReqIF:includeFolders rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>true</rmReqIF:includeFolders>
<rmReqIF:preserveReqIFIdentifiers rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>false</rmReqIF:preserveReqIFIdentifiers>
<rmReqIF:isMigration rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean"
>false</rmReqIF:isMigration>
</rmReqIF:ReqIFDataDefinition>
</rdf:RDF>
This API call creates the REQIF definition without the viewdefinitionselection which is specified in request body.
Questions:
1. Is the request body for specifying view in ReqIfDefinition correct?
2. Can someone provide the sample request body creating reqIFDefinition which include artifact and modules/view.
|
One answer
Hi Karandeep,
I wonder if you've tried first creating the ReqIF definition from the UI where the View is defined, and from there, do an HTTP GET to obtain the ReqIF definition?
To get the list of ReqIF definitions do a GET to https://<server>:<port>/rm/reqif/definitions?resourceContext=https://<server>:<port>/rm/rm-projects/<project_uuid>/components/<component_uuid>, find the ReqIF definition which includes the view, and then do another GET to the selected definition, so you can use this as a reference of what's required for the RDF to include for the view creation.
The ReqIF API documentation is available here: https://jazz.net/wiki/bin/view/Main/DNGReqIF
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.