How to create ArtifactRef object from existing uri
I'm working on creating a tool to operate on all artifacts in all modules. Currently, it appears that the RM api provides capability to access only 1 module worth of artifacts, so I'm investigating a workaround. This includes getting each module's uri and operating on each individual module in sequential order. Am I able to generate/get an ArtifactRef from a uri?
If I can do this, then I can operate on all modules necessary at once, rather than having to navigate to each module while subscribed to the ARTIFACT_OPENED event to perform the action that I want.
Accepted answer
Jake,
Please check following code. It should return the object.
let tmp = new RM.ArtifactRef(URI, COMPONENT_URI, null, FORMAT);
Comments
Awesome! Is there any documentation showing that the parameters have to be in that order?
1 vote
I'm assuming that the null can also be a moduleUri?
I was only just trying to do this last night and kept getting "ArtifactRef is not a constructor" errors so will be trying this out this morning!
Davyd,
Yes null can be a moduleURI. I found it when I started debuging IBM library. This code works because I am using this in my appications.
Jake,
Display any existing artifactRef and You will see the order of the parameters. I was not able to find any documentation and this is outcode of my own research.
Bartek