//#template.templateHeader.modelImports[i].name
String name = loadAttribute(modelImport, ATTRIBUTE_MODELIMPORT_NAME);
//create model instance
//TODO Check if this works
ResourceSet resourceSet = getTElement().eResource().getResourceSet();
// ResourceSet resourceSet = new ResourceSetImpl();
// resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
URI resourceUri=null;
try{
resourceUri = URI.createURI(resourceUriS);
} catch(Exception e){
interpreterLog.warn("Couldn't load resource for model "+name+" from: " + resourceUriS,e);
return;
}
resourceUri = resolveURI(resourceUri);
if(resourceUri!=null&&!resourceUriS.matches(resourceUri.toString())){
log.debug("Resolved " + resourceUriS + " to " + resourceUri.toString());
}
Resource inputModelR = resourceSet.createResource(resourceUri);
if(inputModelR==null){
interpreterLog.warn("Couldn't load resource for model "+name+" from: " + resourceUriS);
return;
}
if(name2inputModelMap.get(name)!=null) interpreterLog.warn("There is already a model: " + name +". Override it.");