Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Use of Plugin GenModels
Use of Plugin GenModels [message #302268] Tue, 18 April 2006 12:49 Go to next message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
I am using the EcoreImporter to programmatically create a GenModel on an
Ecore model.
The Ecore Model contains EClasses which have as a SuperType an EClass "A"
defined in a Plugin created in the standard way.
When I come to run genModel.validate(); I get an error:

"Problems encountered in the model ;
org.eclipse.core.runtime.CoreException
Problems encountered in the model
The package 'uk.co.his.diagram.metamodel#/' is needed but isn't
accessible from the Generator model"

I know from EcorePlugin.getEPackageNsURIToGenModelLocationMap() what the
location of the genmodels of this nsuri "uk.co.his.diagram.metamodel" is.
I can add these to the GenModel using its getUsedGenPackages list;


Map map = EcorePlugin.getEPackageNsURIToGenModelLocationMap();
URI coreMetamodelGenModelURI = (URI)map.get("uk.co.his.metamodel.core");

if(coreMetamodelGenModelURI != null)
{

ResourceSet resSet = modelImporter.createResourceSet();
Resource res = resSet.getResource(coreMetamodelGenModelURI, true);
if(res != null)
{
GenModel externalGenModel = (GenModel)res.getContents().get(0);
if(externalGenModel != null)
{
for(Iterator iter = externalGenModel.getGenPackages().iterator();
iter.hasNext(); )
{
GenPackage externalGenPkg = (GenPackage)iter.next();
generator.getUsedGenPackages().add(externalGenPkg);
}
}
}
}

However I now get a different set of diagnostic errors along the lines of
...

Problems encountered in the model
Unable to resolve proxy
'platform:/plugin/uk.co.his.tool2.metamodel.core/genmodel/Me taModel.ecore#//core/Object/canAddAll/index'
Its use is by
'platform:/plugin/uk.co.his.tool2.metamodel.core/genmodel/Me tamodel.genmodel#//@genPackages.1/@nestedGenPackages.0/@genC lasses.15/@genOperations.8/@genParameters.2'

platform:/plugin/uk.co.his.tool2.metamodel.core/genmodel/Met aModel.ecore
is a file created along with the original
platform:/plugin/uk.co.his.tool2.metamodel.core/genmodel/Met amodel.genmodel
when I was importing the original Ecore model to create a gen model.


What am I doing wrong? Is there any neater way to get the GenModel code to
pick up genmodels which are already registered?

Thanks
Re: Use of Plugin GenModels [message #302269 is a reply to message #302268] Tue, 18 April 2006 12:54 Go to previous message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
Sorry, I have posted this to the EMF Newsgoup instead
Previous Topic:Editor: writing to disk on save
Next Topic:Re-use editor syntax highlighting for coloured HTML export
Goto Forum:
  


Current Time: Sat Dec 21 13:55:50 GMT 2024

Powered by FUDForum. Page generated in 0.03343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top