BPMN Sub process resizable issue

code for sub process shape

$(go.Group,
      "Auto",
      new go.Binding("location", "location"),
      {
        defaultAlignment: go.Spot.Top,
        resizable: true,
        minSize: new go.Size(300, 150),
        resizeObjectName: "BODY",
        selectionObjectName: "BODY",
      },
      $(
        go.Shape,
        "RoundedRectangle",
        {
          name: "BODY",
          parameter1: 4,
          fill: "rgba(239, 244, 253, 1)",
          stroke: "rgba(93, 141, 233, 1)",
          strokeWidth: 2,
        }
      ),
      $(
        go.Panel,
        "Vertical",
        { defaultAlignment: go.Spot.Left, name: "BODY", },
        $(
          go.Panel,
          "Horizontal",
          { defaultAlignment: go.Spot.Top, name: "BODY", },
          $(
            go.TextBlock,
            { font: "12pt Sans-Serif", margin: new go.Margin(6) },
            new go.Binding("text", "text")
          )
        ),
        $(
          go.Placeholder,
          {
            padding: new go.Margin(0, 10),
            name: "BODY",
            background: "rgba(247, 249, 254, 1)",
            minSize: new go.Size(300, 150),
            stretch: go.GraphObject.Horizontal,
          },
          new go.Binding("visible", "isSubGraphExpanded", function (e) {
            return e;
          }).ofObject()

        )
      ),
    );
  };

Subprocess is being resized but the inside one is not properly resizing,
From image you can see that white background is not being resized.

Another issue is there is no min size, even after giving minSize its not working, and shapes inside sub process goes outside of parent.

How do I fix it?

If you use a Placeholder, it will always have the position and size determined by its member Parts (when the subgraph is expanded). You could have the user resize a Shape or Panel. But you then need to decide what should happen – there are many plausible policies that you could implement.

Have you read GoJS Sized Groups -- Northwoods Software ? I think some of our samples customize the ResizingTool so that what is resized always continues covering the area occupied by the member Parts. But other policies are plausible, such as shifting the nodes closer or farther apart, or resizing the nodes proportionally. Since there are so many possibilities, no specific behavior is pre-defined.