ata({ from: newnode.key, to: tonode.key });
        }
      } else if (newnode.category === 'For' || newnode.category === 'While') {
        // add loop group
        // add group for loop
        var groupdata = { isGroup: true, cat: newnode.category, text: newnode.category };
        diagram.model.addNodeData(groupdata);
        var group = diagram.findNodeForData(groupdata);
        group.containingGroup = oldlink.containingGroup;
        diagram.select(group);

        newnode.containingGroup = group;

