Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

update module with artifact not working with API in DNG 7.0.3

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": []
}
]

0 votes

Comments
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.

In this answer https://jazz.net/forum/search/?csrfmiddlewaretoken=HGauDLwLVhlhtaTGGinf7uW9FDurlhP6&q=module+structure+api&t=question follow the link to OSS Python example of using the module structure 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.

Thanks for your quick response. artifact is already created and with this method i am just trying to update the structure of module by adding the artifact to it.

Btw i couldn't find your answer in the above link..can you please send it to me.

Just checked and 202 is success response - why do you think your update is failing?

You need to provide a configuration - see the notes about headers in the answer I linked to.

Because it gives 202 response but when i check on the DNG server it didn't change anything

Because it gives 202 response but when i check on the DNG server it didn't change anything

If you’re not providing an explicit config with the PUT, then perhaps the update is going into the default configuration for your project, have you checked there? It’s in the default component, the Initial Stream.


Or repeat the update (GET and PUT) with an explicit config and then after getting 202 check the update worked.

showing 5 of 9 show 4 more comments

Be the first one to answer this question!

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 480
× 139
× 116
× 46
× 25

Question asked: Nov 26 '24, 8:27 a.m.

Question was seen: 172 times

Last updated: Nov 27 '24, 3:00 p.m.

Confirmation Cancel Confirm