It's all about the answers!

Ask a question

RM.Data.deleteLink : some links are not deleted

Jean-François CHAPELLE (5412) | asked Dec 12 '23, 2:15 a.m.
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 ?


Bartosz Chrabski commented Jan 04, 4:21 p.m.
Hi Jean,

I strongly suggest checking permissions because we have used RM.Data.deleteLink some projects and problem with deletion was almost always related to permissions. You can display the problem by displaying detailed status message that is returned my RM.Data.deleteLink.

One answer

permanent link
Davyd Norris (2.3k217) | answered Jan 04, 6:03 p.m.
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

Jean-François CHAPELLE commented Feb 10, 11:54 p.m. | edited Feb 11, 12:07 a.m.
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?


Jean-François CHAPELLE commented Feb 11, 4:13 a.m.
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

Davyd Norris commented Feb 14, 1:09 a.m.
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:

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.