DOORS NG: obtain the direction of linkTypes through REST API
I'm trying to develop a widget for DOORS NG in which I need to navigate the linked artifacts, and I need to know which link types exist along with their directions (IN or OUT). I've already used the REST endpoint "rm/types?resourceContext=PROJECT_ID", where all link types are defined, but the directions are either missing or incorrect (subToObj or ObjToSub).
Do you know REST API that returns the direction (IN or OUT) for each linktypes?
THANKS!
4 answers
Hi,
My idea:
Is the 'IN/OUT link type' the same for every requirement?
-> If yes then I would create a getter. Parse through every requirements and see what this getter returns.
The getter consists mainly of the query(target URL). Do you already know which xml field/attribute is responsible for containing this link?
-> if yes then make the query. Query example using the cap 5.4 LinkType ResourceShape you shared: query = (
r"{}/views?oslc.query=true&projectURL={}&"
r"oslc.prefix=label=<http://...>&" # <- IDK what prefix this label is used with or if it even requires one.
r"oslc.where=rdfs:label=%22MyLinkTypeOut%22".format(rm_url, project_area_url), #<- %22 might not be needed, they mark the string.
)
And another query for the xml field where you store the IN (in the cap 5.4 that would be "<oslc:inverseLabel>".
-> if not, GET some requirements and look at their XML. You should see similar IN/OUT link type fields then.
-> if not, I can't think of anything.
Alex
In the Type System XML, do you want to check the following node. Node name mentioned "To". Check this node name in the other link also.
objectToSubjectLabel
I'm also unable to see information about links in the Requirement XML itself, let's try a different approach.
I'll provide an example that works for me, please let me know if I misunderstood what you're looking for.
rm_nr = 'rm1' # for me.
For the next variable, you need to know your element/artifact/requirement URL.
E.g. a requirement URL from me: 'https://my_jazz_site/rm1/resources/BI_oVSksBOREfCyoOBaQxWUzQ'
artifact_itemId = 'BI_oVSksBOREfCyoOBaQxWUzQ'
query_url = f"https://{your_jazz_site}/{rm_nr }/publish/resources?linksonly=true&resourceURI={artifact_itemId}"
configuration_context = 'This_must_be_your_GLOBAL_config.' # I did not find a way to work with links in change sets / local configurations, please use your global one.
Your GET consists of URL=query_url and headers = {'Configuration-Context': 'configuration_context'}
If you print the response text, you'll see all the links you have. e.g. I only have 'ValidatedBy'.
You can then play with the response, encode it, parse it etc.
Comments
Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 01 '25, 10:33 a.m.Pippo Franco
May 05 '25, 5:20 a.m.Pippo Franco
May 05 '25, 5:24 a.m.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 06 '25, 10:40 a.m.Pippo Franco
May 06 '25, 11:06 a.m.Ian Barnard
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 07 '25, 4:57 a.m.Pippo Franco
May 07 '25, 8:57 a.m.Pippo Franco
May 07 '25, 8:57 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 08 '25, 8:22 a.m.Pippo Franco
May 09 '25, 7:25 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 12 '25, 2:09 a.m.Pippo Franco
May 12 '25, 6:56 a.m.Pippo Franco
May 12 '25, 7:05 a.m.