How to prevent node to connected with other node in same group

I am having some nodes in a group node. And i do not want to link nodes within same group.
how i can achieve this? Anyone having information about this can help me to get out of this problem

First, have you read GoJS Validation -- Northwoods Software ? And LinkingBaseTool | GoJS API.

Maybe something like this predicate specified in Diagram initialization:

    "linkingTool.linkValidation": function(from, fromPort, to, toPort, link) {
        return from.containingGroup !== to.containingGroup;
    }

I will read it.
Thank you walter.