Prevent a WI -> WI link based on WIs type/attributes ?
![](http://jazz.net/_images/myphoto/34c2a950dfc1eaa18c98792a264d3a45.jpg)
Hi
I have added some new Link Types to RTC and I have a need to prevent the user from linking some WIs to other WIs based on:
- The source/target WIs type
- The value of the source/target WIs attributes
In the link def I use:
...
<itemReferenceType>
...
Is there a way to add more constraints here? if not then I guess I need to add code that would run when adding links - can I get some instructions on what class to use etc'?
Thanks in advance.
I have added some new Link Types to RTC and I have a need to prevent the user from linking some WIs to other WIs based on:
- The source/target WIs type
- The value of the source/target WIs attributes
In the link def I use:
...
<itemReferenceType>
...
Is there a way to add more constraints here? if not then I guess I need to add code that would run when adding links - can I get some instructions on what class to use etc'?
Thanks in advance.
6 answers
![](http://jazz.net/_images/myphoto/34c2a950dfc1eaa18c98792a264d3a45.jpg)
I have added some new Link Types to RTC and I have a need to prevent
the user from linking some WIs to other WIs based on:
- The source/target WIs type
- The value of the source/target WIs attributes
In the link def I use:
..
itemReferenceType
..
Is there a way to add more constraints here? if not then I guess I
need to add code that would run when adding links - can I get some
instructions on what class to use etc'?
The type of constraints that you are describing cannot be configured out
of the box. An option would be to write your own precondition that
checks the custom constraints:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample
--
Regards,
Patrick
Jazz Work Item Team
![](http://jazz.net/_images/myphoto/34c2a950dfc1eaa18c98792a264d3a45.jpg)
On 6/22/10 5:08 PM, shlomiti wrote:
We don't provide the hooks that would allow you to prevent adding the
link in the first place.
--
Regards,
Patrick
Jazz Work Item Team
Thank you, if I understand correctly only when the user press 'save' I
will be able to check if the links are ok. I wanted to check this when
the user does the "add link" - is that possible?
We don't provide the hooks that would allow you to prevent adding the
link in the first place.
--
Regards,
Patrick
Jazz Work Item Team
![](http://jazz.net/_images/myphoto/34c2a950dfc1eaa18c98792a264d3a45.jpg)
Hi,
I was thinking then maybe to take a diff approach: add a menu action (available via right-mouse click on a WI) that will enable to add links. In such a menu action I know the WI type and can activate the action only for the allowed types.
Is it possible to add menu actions for WI via a standard extension point?
If so how?
If not )-:
thanks
I was thinking then maybe to take a diff approach: add a menu action (available via right-mouse click on a WI) that will enable to add links. In such a menu action I know the WI type and can activate the action only for the allowed types.
Is it possible to add menu actions for WI via a standard extension point?
If so how?
If not )-:
thanks
![](http://jazz.net/_images/myphoto/34c2a950dfc1eaa18c98792a264d3a45.jpg)
I was thinking then maybe to take a diff approach: add a menu action
(available via right-mouse click on a WI) that will enable to add
links. In such a menu action I know the WI type and can activate the
action only for the allowed types.
Is it possible to add menu actions for WI via a standard extension
point?
Yes menu actions can be contributed using the regular Eclipse object
contribution mechanism. Register the object contribution for IWorkItem
or IWorkItemHandle.
--
Regards,
Patrick
Jazz Work Item Team