Group.getRoot().manageLinks(true);
private static VDBData generateTemplate(DBDData dbd, DBTemplate dbTemplate){	VDBTemplate vt = new VDBTemplate(dbTemplate.getId(), dbTemplate.getFileName());	vt.setComment(dbTemplate.getComment());		vt.setDescription(dbTemplate.getDescription());		// generate vt.group / VDB data	Group root = Group.getRoot();		try	{			vt.setGroup(new Group(null));		vt.getGroup().setAbsoluteName("");		vt.getGroup().setLookupTable(new Hashtable());			Group.setRoot(vt.getGroup());			VDBData vdbData = VDBData.generateVDBDataInternal(dbd, dbTemplate.getData());		DrawingSurface.applyVisualData(false, vt.getGroup(), dbTemplate.getData(), vdbData);		vt.getGroup().unconditionalValidateSubObjects(false);	/*			vt.setInputs(generateTemplateIOFields(dbTemplate, dbTemplate.getInputs(), "input"));		vt.setOutputs(generateTemplateIOFields(dbTemplate, dbTemplate.getOutputs(), "output"));			vt.setInputComments(dbTemplate.getInputComments());		vt.setOutputComments(dbTemplate.getOutputComments());		vt.setPorts(dbTemplate.getPorts());		vt.setPortsV(dbTemplate.getPortsV());	*/				Hashtable ports = new Hashtable();		Vector portsV = new Vector();		Enumeration keys = dbTemplate.getPorts().keys();		while (keys.hasMoreElements())		{			Object key = keys.nextElement();			DBPort port = (DBPort)dbTemplate.getPorts().get(key);			VDBPort vdbPort = new VDBPort(vt, port);				// has visual			if (port.isHasVisual())			{				Port visualPort = new Port(vdbPort, Group.getRoot(),									  port.getX(), port.getY());				visualPort.setColor(port.getColor());				visualPort.setMode(port.getMode());				// delegate defaultVisibility				vdbPort.setVisibility(port.getDefaultVisibility());								Group.getRoot().addSubObject(vdbPort.getName(), visualPort);			}			ports.put(key, vdbPort);			portsV.addElement(vdbPort);		}		vt.setPorts(ports);		vt.setPortsV(portsV);		VDBData.addTemplate(vt);		// validate all links		// !!? should I move this into finally scope?		Group.getRoot().manageLinks(true);				return vdbData;	}	catch (Exception ex)	{		Console.getInstance().println();		Console.getInstance().println("Exception caught while generating '"+dbTemplate.getId()+"' template.");		Console.getInstance().println(ex);		Console.getInstance().println();	}	finally	{		Group.setRoot(root); 	}		return null;}