It's all about the answers!

Ask a question

Create a copy of an atrifact in a module of another component in DNG

Reem Kadadihi (136) | asked Nov 03 '21, 9:45 a.m.

I want to make a copy from an existing artifact in module x which is also in Component x1
my module target where I want to copy in in modlu y in the component y1. The global cofiguration for the PA is enabled.
I tried to use the instructions here but it didnt work :(

Since 6.0.6 you can add an existing artifact to a module structure using the module structure API - see andĀ

I hope some one had a similar case and is able to help solving my poblem.
Thanks in advance.

One answer

permanent link
Ian Barnard (1.9k613) | answered Nov 05 '21, 4:50 a.m.

Hi Reem

It sounds like you're using REST APIs and are hoping to do something like reuse an artifact from one component in a module in a different component, is that right?

The module API you mention works within a component, just like how, when working in a browser, in a module you add an existing artifact, i.e. one which is in the same component as the module. But that doesn't allow adding an existing artifact from a different component.

It is possible in the user interface (but not AFAIK using the REST APIs) to clone an artifact from one component to another, and once you've cloned it into the same component as the module then you can insert the existing (cloned) artifact (i.e. from the same component as the module) into the module. But AFAIK this isn't possible using the APIs.

As it says there "Reorganize how artifacts are grouped in your project area by cloning them from one component into another. When you clone an artifact, a new version is added to the stream of the component that you work in."

You need to be careful that any artifact you've cloned isn't in more than one contribution (e.g. in it's origin component and in the component it's cloned into) to a single Global Configuration - this is called skew and must be avoided.


Reem Kadadihi commented Nov 05 '21, 5:17 a.m.
Hi Ian,
thank you for your Antwort. I try to use any API (Rest or OSLC) to copy artifacts in different components. It will be fine for me if I create a new artifact and not just a cloned one.
I am able to create a copy and use the structure api to add it to the target module inside one component. My problem is to do the same between 2 components and the GC is enabled also.

Ian Barnard commented Nov 05 '21, 10:17 a.m.

AFAIK cloning isn't possible through the APIs so you can't reuse an artifact from one component in a module in a different component. You will have to code the copying the artifact say it's called ID1 into the component where the module is to create a new artifact ID2 and then create a reuse of ID2 into the module structure.

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.