Preventing closed loop in GoJS group to group link creation

Hi all ,

for my project I am using GOJs libary . So far all of my requirements are fulfilled but I am struck in one point regarding validation when creating group to group link. Basically I donot want to allow my user to create a closed loop like this.What will be the logic in this case. I am attaching a screenshot for the scenario for your reference.

I believe setting Diagram.validCycle to go.Diagram.CycleNotDirected is sufficient, although I don’t know what other link validation requirements you might have (within groups?) that might conflict.

Read more at http://gojs.net/latest/intro/validation.html. Also of potential usefulness is http://gojs.net/latest/api/symbols/LinkingBaseTool.html#isValidCycle.

In my code I have written a code like this. But the problem is that it is also restricting self loop in case of nodes also. I want this functionality in case of group to group link only.

this.graph.validCycle = go.Diagram.CycleDestinationTree;

OK, then you will need to implement your own linkValidation predicate.

do you have any reference on this

I already gave you http://gojs.net/latest/intro/validation.html, which has a general discussion along with a specific example. I think there are other examples in the sample apps.