adding an existing artifact from one module into a new module
Hello Team,
im trying to add an existing artifact from one module into another
when i track the url im getting below message:
Not allowed to change the module of binding[UUID _9q9Hwyn2Ee6DM4TOylsSWg] from [UUID _4qHEESn2Ee6DM4TOylsSWg] to [UUID _LLl3EQh2Ee-jPpBtLV44xw]
below is body of a put request
[
{
"type": "dng_module:Binding",
"isStructureRoot": "true",
"isHeading": false,
"boundArtifact": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",
"childBindings": ["https://alm.com/rm/resources/BI_9q9Hwyn2Ee6DM4TOylsSWg", "https://alm.com/rm/resources/BI_x0v1gAhzEe-jPpBtLV44xw"]
}, {
"type": "dng_module:Binding",
"isHeading": true,
"boundArtifact": "https://alm.com/rm/resources/TX_HSIcwAh3Ee-jPpBtLV44xw",
"childBindings": []
}, {
"type": "dng_module:Binding",
"isHeading": true,
"boundArtifact": "https://alm.com/rm/resources/TX_9ri9oCn2Ee6DM4TOylsSWg",
"childBindings": []
}
]
last artifact is the one i'm adding which is already in another module.
could you please tell me what im doing wrong
3 answers
Hello Ian,
I'm using 7.0.2 Ifix 028, im using PUT Request.
below are the headers im using:
DoorsRP-Request-Type: public 2.0
Accept: application/json
If-Match: "%220%22&_mIi1OQkEEe-jPpBtLV44xw"
Content-Type: application/json
I'm getting below error when i tried to use a dummy url.
"Propagated exception; original message [IllegalArgumentException: Slug should be decorated but is not '_url1']".
is there a way i can add an existing artifact from one module to another module? which is possible in UI, same thing i want to achieve using rest API.
Construct a body by GETtign the current structure, then adding a placeholder for what will become the new binding, using a dummy URL for its uri, and reference that same dummy URL in the childbindings of the root, based on your body this could be:
[
{
"type": "dng_module:Binding",
"isStructureRoot": "true",
"isHeading": false,
"boundArtifact": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",
"childBindings": ["https://alm.com/rm/resources/BI_9q9Hwyn2Ee6DM4TOylsSWg", "https://alm.com/rm/resources/dummyurl"]
}, {
"type": "dng_module:Binding",
"isHeading": true,
"boundArtifact": "https://alm.com/rm/resources/TX_HSIcwAh3Ee-jPpBtLV44xw",
"childBindings": []
}, {
"type": "dng_module:Binding",
"isHeading": true,
"boundArtifact": "https://alm.com/rm/resources/TX_9ri9oCn2Ee6DM4TOylsSWg",
"childBindings": []
}
]
Then you PUT ensuring the If-Match is the same as the etag from the previous GET, and that the configuration is in header vvc.configuration.
When successful you'll get a 202 response and a tracker to poll for completion.
Find the URL o fthe new binding by GETting the updated structure
hello Ian,
i have used the dummy URL as suggested by you, im getting a different exception this time, "Propagated exception; original message [IllegalArgumentException: Slug should be decorated but is not 'dummyurl']" is there anything i'm missing?
Comments
Are you providing the configuration using header vvc.configuration?
yes, i'm providing below headers
DoorsRP-Request-Type: public 2.0
Accept: application/json
If-Match: "%220%22&_goyHoQlWEe-jPpBtLV44xw"
Content-Type: application/json
vvc.configuration: https://alm.com/rm/cm/stream/_6EoNFgjqEe2dNuKKWtMw8g
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 02 '24, 12:27 p.m.What version + ifix are you using? What's the http operation you're using? What are all the headers you're sending with the http operation?
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 02 '24, 12:47 p.m."already in another module"? Do you mean that https://alm.com/rm/resources/BI_x0v1gAhzEe-jPpBtLV44xw is an existing binding? If so that won't work; you want to create a new binding, which will have its own URL.
Arjuna Pandu
May 03 '24, 4:30 a.m.Hello Ian,
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 03 '24, 8:52 a.m.