Multiple nodes resizing should not be possible outside the bounds of parent group nodes

I have a group shape (reactangle) with some nodes of different size inside it.
Now when multiple nodes are selected for resizing one should not be able to resize the nodes when any of the node goes outside the bounds of group shape,

How this can be prevented ?

The reason, i need this behavior is , I have a BPMN diagram with multiple lanes and each node , its parents have relations maintained in database.
Now when multiple nodes either from same lane or different lane selected for resizing, then user can resize them in such a way that some of nodes are not completly within the boundaries of lane. So i want to prevent, when any of selected node goes outside the boundary of lane, resizing should stop.

So I assume you are using the extensions/ResizeMultipleTool.js.

Add an override of ResizingTool | GoJS API that returns a value that is no larger than the result of calling the super method, go.ResizingTool.prototype.computeMaxSize.call(this).

You’ll need to iterate over all of the non-Group Nodes in the this.diagram.selection and compute the largest size that would not cause any of those nodes to overlap the edge of its containingGroup.