It's all about the answers!

Ask a question

Automatically create empty RRC Collection type artifact using API


0
1
Halil BAHADIR (3322020) | asked Sep 28 '12, 6:00 a.m.
JAZZ DEVELOPER
Hi,

How can I create a RRC collection type artifact from an external program. Is there any API for this?

We want to create Collections in RRC related to each demand comming from demand management product. Collection name must be the same with the Demand ID. When it is created BusinessAnalysts add changing requirements to the collection. Creating a collection manually is risky because if BA writes the name of the collection wrong, it is very hard to find the right collection for dev and test team.

Accepted answer


permanent link
Gabriel Ruelas (1.1k13) | answered Oct 02 '12, 11:24 a.m.
OSLC allows the creation of Collections in RRC.

The OSLC SPEC http://open-services.net/bin/view/Main/RmSpecificationV2

The OSLC Workshop contains sample code of creating artifacts in RRC :  https://jazz.net/library/article/635

To create a collection just look for the Collection creation factory in the service document and POST it with the basic information needed.
Halil BAHADIR selected this answer as the correct answer

Comments
Halil BAHADIR commented Oct 03 '12, 3:57 p.m.
JAZZ DEVELOPER

Thank you Gabriel..

2 other answers



permanent link
Halil BAHADIR (3322020) | answered Oct 14 '12, 5:57 p.m.
JAZZ DEVELOPER
Hi Gabriel,

I've done what you told to me but I have a problem

I've a project named "RMDemo". I've created a collection artifact type named "Release Package".

Response from -->https://clm.ibm.com:9443/rm/discovery/_kCQe0BR9EeK6abdSphZAgA/services.xml

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
    xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/">
<oslc:ServiceProvider rdf:about="https://clm.ibm.com:9443/rm/discovery/_kCQe0BR9EeK6abdSphZAgA/services.xml">
    <dcterms:title rdf:parseType="Literal">RMDemo</dcterms:title>
    <dcterms:description rdf:parseType="Literal">Service Descriptor for Project: RMDemo</dcterms:description>
    <dcterms:publisher rdf:resource="https://clm.ibm.com:9443/rm/application-about" />
    <oslc:details rdf:resource="https://clm.ibm.com:9443/jts/process/project-areas/_kCQe0BR9EeK6abdSphZAgA"/>
    <rm:home rdf:resource="https://clm.ibm.com:9443/rm/web#action=com.ibm.rdm.web.pages.showProjectDashboard&amp;projectURI=https://clm.ibm.com:9443/jts/process/project-areas/_kCQe0BR9EeK6abdSphZAgA"/>
    <oslc:service>
        <oslc:Service>
            <oslc:domain rdf:resource="http://open-services.net/ns/rm#" />
            <oslc:selectionDialog>
                <oslc:Dialog>
                    <dcterms:title rdf:parseType="Literal">Requirement Selection</dcterms:title>
                    <oslc:label>Requirement</oslc:label>
                    <oslc:dialog rdf:resource="https://clm.ibm.com:9443/rm/_ajax-modules/com.ibm.rdm.web.RRCPicker?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:hintWidth>800px</oslc:hintWidth>
                    <oslc:hintHeight>550px</oslc:hintHeight>
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement" />
                </oslc:Dialog>
            </oslc:selectionDialog>
            <oslc:selectionDialog>
                <oslc:Dialog>
                    <dcterms:title rdf:parseType="Literal">Collection Selection</dcterms:title>
                    <oslc:label>Collection</oslc:label>
                    <oslc:dialog rdf:resource="https://clm.ibm.com:9443/rm/_ajax-modules/com.ibm.rdm.web.CollectionPicker?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:hintWidth>800px</oslc:hintWidth>
                    <oslc:hintHeight>550px</oslc:hintHeight>
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection" />
                </oslc:Dialog>
            </oslc:selectionDialog>
            <oslc:creationDialog>
                <oslc:Dialog>
                    <dcterms:title rdf:parseType="Literal">Requirement Creation</dcterms:title>
                    <oslc:label>Requirement</oslc:label>
                    <oslc:dialog rdf:resource="https://clm.ibm.com:9443/rm/_ajax-modules/com.ibm.rdm.web.CreateArtifactPicker?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:hintWidth>520px</oslc:hintWidth>
                    <oslc:hintHeight>425px</oslc:hintHeight>
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement" />
                </oslc:Dialog>
            </oslc:creationDialog>
            <oslc:creationDialog>
                <oslc:Dialog>
                    <dcterms:title rdf:parseType="Literal">Collection Creation</dcterms:title>
                    <oslc:label>Collection</oslc:label>
                    <oslc:dialog rdf:resource="https://clm.ibm.com:9443/rm/_ajax-modules/com.ibm.rdm.web.CreateCollectionPicker?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:hintWidth>520px</oslc:hintWidth>
                    <oslc:hintHeight>425px</oslc:hintHeight>
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection" />
                </oslc:Dialog>
            </oslc:creationDialog>
            <oslc:creationFactory>
                <oslc:CreationFactory>
                    <dcterms:title rdf:parseType="Literal">Requirement Creation Factory</dcterms:title>
                    <oslc:creation rdf:resource="https://clm.ibm.com:9443/rm/requirementFactory?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement" />
                    <oslc:resourceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_ngrGhhR9EeK6abdSphZAgA" />
                    <oslc:resourceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_niAjXhR9EeK6abdSphZAgA" />
                    <oslc:resourceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_njDFLRR9EeK6abdSphZAgA" />
                    <oslc:resourceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_njysDhR9EeK6abdSphZAgA" />
                    <oslc:resourceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_nlIvtRR9EeK6abdSphZAgA" />
                    <oslc:usage rdf:resource="http://open-services.net/ns/core#default" />
                </oslc:CreationFactory>
            </oslc:creationFactory>
            <oslc:creationFactory>
                <oslc:CreationFactory>
                    <dcterms:title rdf:parseType="Literal">Collection Creation Factory</dcterms:title>
                    <oslc:creation rdf:resource="https://clm.ibm.com:9443/rm/requirementFactory?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection" />
                    <oslc:resourceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_NKZ-pxZEEeK5eJezpVJWfQ" />
                </oslc:CreationFactory>
            </oslc:creationFactory>
            <oslc:queryCapability>
                <oslc:QueryCapability>
                    <dcterms:title rdf:parseType="Literal">Query Capability</dcterms:title>
                    <oslc:queryBase rdf:resource="https://clm.ibm.com:9443/rm/views?oslc.query=true&amp;projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA" />
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement" />
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#RequirementCollection" />
                </oslc:QueryCapability>
            </oslc:queryCapability>
            <oslc:queryCapability>
                <oslc:QueryCapability>
                    <dcterms:title rdf:parseType="Literal">Folder Query Capability</dcterms:title>
                    <oslc:queryBase rdf:resource="https://clm.ibm.com:9443/rm/folders?oslc.where=public_rm:parent=https://clm.ibm.com:9443/rm/folders/_kCQe0BR9EeK6abdSphZAgA" />
                </oslc:QueryCapability>
            </oslc:queryCapability>
            <calm:filter>
                <calm:Filter>
                    <dcterms:title rdf:parseType="Literal">Requirements Changed Since Filter</dcterms:title>
                    <oslc:usage rdf:resource="http://jazz.net/xmlns/prod/jazz/calm/1.0/requirementsChangedSince" />
                    <oslc:resourceType rdf:resource="http://open-services.net/ns/rm#Requirement" />
                    <calm:filerBase rdf:resource="https://clm.ibm.com:9443/rm/calmFilter/_kCQe0BR9EeK6abdSphZAgA/requirementsChangedSince" />
                </calm:Filter>
            </calm:filter>
        </oslc:Service>
    </oslc:service>
</oslc:ServiceProvider>
</rdf:RDF>


According to this response I've defined an POST request
to URI -->
https://clm.ibm.com:9443/rm/requirementFactory?projectURL=https%3A%2F%2Fclm.ibm.com%3A9443%2Fjts%2Fprocess%2Fproject-areas%2F_kCQe0BR9EeK6abdSphZAgA

BODY:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
        xmlns:oslc_rm="http://open-services.net/ns/rm#"
        xmlns:dc="http://purl.org/dc/terms/"
        xmlns:oslc="http://open-services.net/ns/core#"
        xmlns:rm_property="https://clm.ibm.com:9443/rm/types/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <oslc_rm:Requirement
        rdf:about="">
    <dc:title>MyCollectiont</dc:title>
    <dc:description>This is a test collection</dc:description>
    <oslc:instanceShape rdf:resource="https://clm.ibm.com:9443/rm/types/_NKZ-pxZEEeK5eJezpVJWfQ"/>
    </oslc_rm:Requirement>
</rdf:RDF>


And  the result --> It created an Artifact with type "Release Package" but artifact format is TEXT so it is not a real collection..
What can be the problem?? Why the artifact format is TEXT which I defined "release package" type as "COLLECTION"

Regards,
Halil

permanent link
Gabriel Ruelas (1.1k13) | answered Oct 15 '12, 4:14 p.m.
Hello,

You need to add following entry to the RDF body to indicate it is a collection ( if that entry is not found a Requirement is created ):

<rdf:type rdf:resource="http://open-services.net/ns/rm#RequirementCollection"/>

Your answer


Register or to post your answer.