It's all about the answers!

Ask a question

Is there any way by which we can set values in custom attributes for creating artifacts in RRC?


Samanwita Majumdar (5033639) | asked Sep 11 '12, 8:42 a.m.
We have a few custom attributes that we want to have default values while creating artifacts in RRC. Is there any ways that we can set the values for the same?

One answer



permanent link
Gabriel Ruelas (1.1k13) | answered Sep 11 '12, 10:40 a.m.
The artifact's Type can be used to define the default vale of new artifacts.

But if users wants to setup an initial value at artifact creation time, OSLC allows to specify the initial value in the request body.  Doing a get to the artifact Instance shape will expose the artifacts attributes and each artifact attribute will have an entry similar to :

<oslc:Property>
        <oslc:valueType rdf:resource="http://open-services.net/ns/core#Resource"/>
        <oslc:allowedValues>
            <oslc:AllowedValues>
                <oslc:allowedValue rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg#9fa948cf-d978-49b4-aac8-ab7cf73c0b70"/>
                <oslc:allowedValue rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg#5f25f5ae-5100-47a0-9913-a950498106db"/>
                <oslc:allowedValue rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg#3e9db9f1-3d5c-4716-aae0-f48d49260a8b"/>
                <oslc:allowedValue rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg#217b0cc2-9b72-4753-954a-effc3cd335cb"/>
                <oslc:allowedValue rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg#6f8bd7c7-fc78-413f-8240-36628727d196"/>
            </oslc:AllowedValues>
        </oslc:allowedValues>
        <oslc:propertyDefinition rdf:resource="https://gradev.ibm.com:9444/rdm/types/_9AkBgucBEeGTAYdIle28Lg"/>
        <oslc:range rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg"/>
        <oslc:allowedValues rdf:resource="https://gradev.ibm.com:9444/rdm/types/_84r34ucBEeGTAYdIle28Lg#9fa948cf-d978-49b4-aac8-ab7cf73c0b70"/>
        <oslc:occurs rdf:resource="http://open-services.net/ns/core#Zero-or-one"/>
        <dc:title rdf:parseType="Literal">Status</dc:title>
        <oslc:name>_9AkBgucBEeGTAYdIle28Lg</oslc:name>
    </oslc:Property>

From there users can check which is the default vale (oslc:allowedValues) and if needed specify a different one based on the oslc:allowedValues list.

Your answer


Register or to post your answer.