Create a copy of an atrifact in a module of another component in DNG
Hello,
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 https://jazz.net/wiki/bin/view/Main/DNGModuleApiOverview andĀ https://jazz.net/wiki/bin/view/Main/DNGModuleAPI
I hope some one had a similar case and is able to help solving my poblem.
Thanks in advance.
One answer
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.
For more info on cloning seeĀ https://www.ibm.com/docs/en/elm/7.0.2?topic=configurations-cloning-requirement-artifacts
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.
HTH
Ian
Comments
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.
Regards.
Reem.
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.