It's all about the answers!

Ask a question

adding an existing artifact from one module into a new module


Arjuna Pandu (113) | asked May 02, 9:32 a.m.
edited May 02, 12:49 p.m. by Ian Barnard (2.3k613)

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",
    }, {
        "type": "dng_module:Binding",
        "isHeading": true,
        "childBindings": []
    }, {
        "type": "dng_module:Binding",
        "isHeading": true,
        "childBindings": []
    }
]

last artifact is the one i'm adding which is already in another module.

could you please tell me what im doing wrong



Comments
Ian Barnard commented May 02, 12:27 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 commented May 02, 12:42 p.m. | edited May 02, 12:47 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Try putting a dummy URL (i.e. a valid but non-existent url) in the uri, such as https://alm.com/rm/resources/newbinding (revised for your server alm.com) - then when the update completes you'll have to read back the structure to get the actual binding.

I've never tried to create a child binding directly in the structure like you're trying to do, but this needs the binding url in the childbindings of its parent - you could try using the same dummy URL there, or you might have to first create it at the top level then once you've got it's url you update the structure moving it (using its real url) to its correct location


Arjuna Pandu commented May 03, 4:30 a.m.

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
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']".
how do i create new binding? 

Ian Barnard commented May 03, 8:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Make sure to specify the configuration with header vvc.configuration

Then construct a body using a dummy url for what will become the new binding, referenced in the uri for the new binding and in the childbindings of the root.

If successful you'll get a 202 response to track the completion of structure update and creation of the new binding.

To find the new binding URL, GET the new structure

3 answers



permanent link
Arjuna Pandu (113) | answered May 03, 2:23 a.m.

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.



permanent link
Ian Barnard (2.3k613) | answered May 03, 8:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited May 03, 9:00 a.m.

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",
    }, {
        "type": "dng_module:Binding",
        "isHeading": true,
        "childBindings": []
    }, {
        "type": "dng_module:Binding",
        "isHeading": true,
        "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


Comments
Arjuna Pandu commented May 03, 10:21 a.m.

Hello Ian,


like i mentioned in the earlier comment, i'm getting a new exception when i track the URL

"Propagated exception; original message [IllegalArgumentException: Slug should be decorated but is not 'dummyurl']"

you know how to resolve this?



permanent link
Arjuna Pandu (113) | answered May 06, 8:17 a.m.

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
Ian Barnard commented May 07, 8:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Are you providing the configuration using header vvc.configuration?


Arjuna Pandu commented May 07, 9:14 a.m.

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

Your answer


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.