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

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",
    }, {
        "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


0 votes

Comments

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?

"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

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? 

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

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.


0 votes


Permanent link

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

0 votes

Comments

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

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?

0 votes

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

Your answer

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
× 10,938

Question asked: May 02 '24, 9:32 a.m.

Question was seen: 996 times

Last updated: May 07 '24, 9:14 a.m.

Confirmation Cancel Confirm