It's all about the answers!

Ask a question

update module with artifact not working with API in DNG 7.0.3


Abhi Akbari (11) | asked 19 hours ago
the format of the module
above image shows the format of the module.

Here is the details of the artifact which i want to include inside the above module.
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:oslc_core="http://open-services.net/ns/core#"
xmlns:oslc_config="http://open-services.net/ns/config#"
xmlns:j.0="http://jazz.net/ns/rm/navigation#"
xmlns:nav="http://com.ibm.rdm/navigation#"
xmlns:jazz_rm="http://jazz.net/ns/rm#"
xmlns:rm_types="http://www.ibm.com/xmlns/rdm/types/"
xmlns:process="http://jazz.net/ns/process#">
<jazz_rm:Artifact rdf:about="https://jazz7:9443/rm/resources/TX_MyDtYKs_Ee-jCoWF2gxAeg">
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
></dcterms:description>
<oslc_config:component rdf:resource="https://jazz7:9443/rm/cm/component/_OJPkYIZAEe-EhaxT-7FRbA"/>
<jazz_rm:artifactFormat rdf:resource="http://jazz.net/ns/rm/dng/type/format#Text"/>
<process:projectArea rdf:resource="https://jazz7:9443/rm/process/project-areas/_N5Tq8IZAEe-EhaxT-7FRbA"/>
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>process name</dcterms:title>
<dcterms:contributor rdf:resource="https://jazz7:9443/jts/users/aak_adm"/>
<jazz_rm:primaryText rdf:parseType="Literal"><div xmlns="http://www.w3.org/1999/xhtml">
<p id="_1732547341512">process name</p>
</div></jazz_rm:primaryText>
<dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
>415</dcterms:identifier>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2024-11-25T15:09:00.087Z</dcterms:created>
<j.0:parent rdf:resource="https://jazz7:9443/rm/folders/FR_KI2yx4bxEe-GkKV8PcjVhw"/>
<dcterms:creator rdf:resource="https://jazz7:9443/jts/users/aak_adm"/>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>2024-11-25T15:09:00.087Z</dcterms:modified>
<jazz_rm:artifactType rdf:resource="https://jazz7:9443/rm/types/OT_qcuisIbxEe-GkaV8PcjVhw"/>
</jazz_rm:Artifact>
</rdf:RDF>

i am using PUT method to update the module and it also give the "202 Accepted" status but in the DNG it is not updating anything.

Headers:

DoorsRP-Request-Type:public 2.0
If-Match:"%220%22&_g7VVsKGwEe-Bxfjn_fA72g"
Accept:application/json
Content-Type:application/json


Body :

[
{
"uri": "https://jazz7:9443/rm/resources/MD_cdU5UKGwEe-Bxfjn_fA72g/structure",
"type": "dng_module:Binding",
"component": "https://jazz7:9443/rm/cm/component/_OJPkYIZAEe-EhaxT-7FRbA",
"isStructureRoot": "true",
"isHeading": false,
"module": "https://jazz7:9443/rm/resources/MD_cdU5UKGwEe-Bxfjn_fA72g",
"boundArtifact": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",
"childBindings": [
"https://jazz7:9443/rm/resources/BI_g6tqoKGwEe-Bxfjn_fA72g",
"https://jazz7:9443/rm/resources/MB_e34eb5d27c8446c791e72a882d52fd34"
]
},
{
"uri": "https://jazz7:9443/rm/resources/BI_g6tqoKGwEe-Bxfjn_fA72g",
"type": "dng_module:Binding",
"component": "https://jazz7:9443/rm/cm/component/_OJPkYIZAEe-EhaxT-7FRbA",
"isHeading": true,
"module": "https://jazz7:9443/rm/resources/MD_cdU5UKGwEe-Bxfjn_fA72g",
"boundArtifact": "https://jazz7:9443/rm/resources/TX_g7DB0KGwEe-Bxfjn_fA72g",
"childBindings": []
},
{
"uri": "https://jazz7:9443/rm/resources/MB_e34eb5d27c8446c791e72a882d52fd34",
"type": "dng_module:Binding",
"component": "https://jazz7:9443/rm/cm/component/_OJPkYIZAEe-EhaxT-7FRbA",
"isHeading": true,
"module": "https://jazz7:9443/rm/resources/MD_cdU5UKGwEe-Bxfjn_fA72g",
"boundArtifact": "https://jazz7:9443/rm/resources/TX_MyDtYKs_Ee-jCoWF2gxAeg",
"childBindings": []
}
]


Comments
Ian Barnard commented 10 hours ago | edited 9 hours ago
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
To be clear, it’s not that the API(s) aren’t working, it’s that you’re not using them in a way that will succeed, IYSWIM.

Are you trying to create the artifact and also bind it into a module? Don’t think that will work, also when creating the artifact application/json won’t work (must be RDF), also you need to provide the header OSLC-Core-Version: 2.0 and not the DOORS-RP-Request-Type header. IIRC the module structure API can GET/PUT application/json and you mustn’t provide header OSLC-Core-Version.


You should first create the core artifact using the OSLC API by posting RDF to the creation factory for requirements.

Then update the module structure GET then PUT using Module Structure API to create a binding into the structure.

The UI hides these details from you - when you appear to be creating an artifact in the module it’s doing both the above steps for you. When using the APIs you have to do the above steps.

Search here for module structure api answer I posted.


Ian Barnard commented 9 hours ago | edited 9 hours ago
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
In this answer https://jazz.net/forum/search/?csrfmiddlewaretoken=HGauDLwLVhlhtaTGGinf7uW9FDurlhP6&q=module+structure+api&t=question follow the link to my OSS Python example of using the module strcuture API to create a new binding.

Be careful to follow the directions about headers to provide and not to provide!

In the JSON added to the structure provide a dummy URI for the binding uri, this will be replaced in the structure with the new binding uri.

Be the first one to answer this question!


Register or to post 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.