RM.Data.deleteLink : some links are not deleted
We have RM 7.0.2 - iFix026.
We have 2 modules, in distinct components, with requirements, in the same global configuration :
- Module A, with requirements A1, A2 ...
- Module B, with requirements B1, B2 ...
We create somme satisfaction Links between requirements from A --> B ("Satisfies" links, for example) :
- A1 --> B1
- A2 --> B1
- A3 --> B1
The result is : B1 is "Satisfied by" 3 requirements (A1, A2 and A3).
We create a widget to delete links between artifacts, and we use the "RM.Data.deleteLink" API method.
We open Module B and run the widget.
The "RM.Data.deleteLink" has a "strange" behavior :
-
A2/B1 and A3/B1 links are deleted well
-
but A1/B1 is not deleted (response.code=OPERATION_FAILED) ...
We run again the widget, but the link A1/B1 can not be deleted ...
Why this behavior ?
Regards.
One answer
I have found, as well as the permissions issue mentioned above, that you need to delete the link in the correct context. If you have a mix of links created in module context and artefact context, then you'll need to do two delete calls - one for each context.
It could be that A1-> B1 is done directly to the B1 artefact, while the other two are done to the B1 artefact in the module's context
Comments
For the moment, I'm doing my development in a "JazzAdmin" context, so permissions are not the biggest constraints. I first want to make sure that the logic of how the widget works is correct.
Indeed, I am looking to correct certain links created directly on the artifact, outside the context of the module. And specifically, the links I'm looking to remove are those created directly on the artifact.
But the widget I'm developing only seeks to remove links created outside of a module context :
1/ The widget detects “malformed” links
2/ Then must first delete them one after the other
3/ Currently, the first link is deleted, but not the others, which generate an error
My major problem therefore remains to understand why such behavior?
1/ The widget detects “malformed” links
2/ Then must first delete them one after the other
3/ Currently, the first link is deleted, but not the others, which generate an error
My major problem therefore remains to understand why such behavior?
Regards
In addition, I realize that an "Base Artifact" does not have the same URI as an "Module Artifact" and that changes a lot of things...
So I have to modify the logic of my Widget
Yes, that's what I meant in my answer above - you need to look at the context of the link and perform the delete in the correct context.
The API documentation shows how you can detect the context:
Comments
Bartosz Chrabski
Jan 04, 4:21 p.m.