return assembly_id;
} return assembly_id;
    public static String createCMTasb(String assembly_description,String cfw_g_id,String[] threads, Map clones){	clearUnusedCMTassemblies();	String assembly_id = getAssemblyID(cfw_g_id, threads, clones);	if (hasRows(asbPrefix+"asb_assembly", "assembly_id", sqlQuote(assembly_id))){	    System.out.println("Not creating new assembly for: "+assembly_id+" which is already in the DB");	    return assembly_id;	} else {	    String sqlThreads = sqlThreads(threads);	    Map subs = new HashMap();	    addSubs(subs,":cfw_group_id",cfw_g_id);	    addSubs(subs,":assembly_id",assembly_id);	    // to make a short name for temporary tables	    String shortASBId = ((String)assembly_id.substring(assembly_id.length()/2)).replace('-','_');	    shortASBId = shortASBId.replace('{','_');	    shortASBId = shortASBId.replace('}',' ');	    addSubs(subs,":short_assembly_id",shortASBId);	    addSubs(subs,":threads", sqlThreads);	    addSubs(subs,":oplan_ids","('093FF')");	    addSubs(subs,":cfw_instances",sqlListFromQuery("getCFWInstancesFromGroup",subs));	    //  	    System.out.println("subs = "+subs);	    if(!hasRows(asbPrefix+"asb_assembly","assembly_id",sqlQuote(assembly_id))){				// this query is legal in both Oracle and mySQL		dbUpdate("insertASBAssembly",			 addSubs(addSubs(new HashMap(),":assembly_id",sqlQuote(assembly_id)),				 ":assembly_description",sqlQuote(assembly_description)));		executeQuerySet("addNewBaseAgentAlibComponents",subs);		Iterator i=clones.keySet().iterator();		while(i.hasNext()){		    executeQuerySet("addNewClonedAgentAlibComponents",					  addSubs(addSubs(new HashMap(),":org_group_id",i.next()),						  ":n",clones.get(i.next())));		}		executeQuerySet("addBaseASBAgents", subs);		i=clones.keySet().iterator();		while(i.hasNext()){		    executeQuerySet("addClonedASBAgents",					  addSubs(addSubs(addSubs(new HashMap(),":org_group_id",i.next()),							  ":n",clones.get(i.next())),						  ":assembly_id",assembly_id));		}                // this must occur AFTER the ASB_agents table is filled in, to allow for handling multiplicity		executeQuerySet("addNewPluginAlibComponents",subs);		executeQuerySet("addPluginASBComponentHierarchy",subs);		executeQuerySet("addAgentNameComponentArg",subs);		executeQuerySet("addASBAgentPGAttr",subs);		executeQuerySet("addASBAgentRelationToBase",subs);		executeQuerySet("addASBAgentRelationToCloneset",subs);		executeQuerySet("addASBAgentHierarchyRelationToBase",subs);		executeQuerySet("addASBAgentHierarchyRelationToCloneset",subs);		executeQuerySet("addPluginAgentASBComponentArg",subs);		executeQuerySet("addPluginOrgtypeASBComponentArg",subs);		executeQuerySet("addPluginAllASBComponentArg",subs);		executeQuerySet("addASBOplans",subs);		executeQuerySet("addASBOplanAgentAttr",subs);	    }	}	return assembly_id;    }