Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Using the EmfModel class
Using the EmfModel class [message #593648] Mon, 13 September 2010 08:47 Go to next message
Andreas is currently offline Andreas
Messages: 33
Registered: September 2010
Location: Germany
Member
Hi,

I have to following problem:

I created a EmfModel object (org.eclipse.epsilon.emc.emf.EmfModel) and then try to load a model in this object.
Therefore I use the following code:

EglFileGeneratingTemplateFactory factory = new EglFileGeneratingTemplateFactory();
EmfModel emfModel = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, name);
properties.put(EmfModel.PROPERTY_METAMODEL_FILE, "file:/" + getFile(metamodel).getAbsolutePath());
properties.put(EmfModel.PROPERTY_MODEL_FILE, "file:/" + getFile(model).getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
properties.put(EmfModel.PROPERTY_READONLOAD, "true");
//properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, "false");
emfModel.load(properties, null);

factory.getContext().getModelRepository().addModel(emfModel) ;

I didn't receive an error message when I run my program so I think the loading of my model should work fine.

But my problem is that I'm not able to access any concrete data of the model.

Did I something completely wrong?

If necessary you can see in this thread how the model and the meta model looks like.

http://www.eclipse.org/forums/index.php?t=msg&th=175068& amp;start=0&S=2ba7d260f4a39ac0cb5f2531aa9308d8

Best regards,

Andreas
Re: Using the EmfModel class [message #593671 is a reply to message #593648] Mon, 13 September 2010 09:36 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Andreas,

At a first glance your code looks fine. Could you please be a bit more
specific on the "I'm not able to access any concrete data" issue? Are
you 1) getting an exception when you try to access data of the model, 2)
getting back nothing at all, or 3) not sure how to access data of the
model at all?

Cheers,
Dimitris

Andreas wrote:
> Hi,
>
> I have to following problem:
>
> I created a EmfModel object (org.eclipse.epsilon.emc.emf.EmfModel) and
> then try to load a model in this object. Therefore I use the following
> code:
>
> EglFileGeneratingTemplateFactory factory = new
> EglFileGeneratingTemplateFactory();
> EmfModel emfModel = new EmfModel();
> StringProperties properties = new StringProperties();
> properties.put(EmfModel.PROPERTY_NAME, name);
> properties.put(EmfModel.PROPERTY_METAMODEL_FILE, "file:/" +
> getFile(metamodel).getAbsolutePath());
> properties.put(EmfModel.PROPERTY_MODEL_FILE, "file:/" +
> getFile(model).getAbsolutePath());
> properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
> properties.put(EmfModel.PROPERTY_READONLOAD, "true");
> //properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, "false");
> emfModel.load(properties, null);
>
> factory.getContext().getModelRepository().addModel(emfModel) ;
>
> I didn't receive an error message when I run my program so I think the
> loading of my model should work fine.
> But my problem is that I'm not able to access any concrete data of the
> model.
> Did I something completely wrong?
> If necessary you can see in this thread how the model and the meta model
> looks like.
> http://www.eclipse.org/forums/index.php?t=msg&th=175068& amp;start=0&S=2ba7d260f4a39ac0cb5f2531aa9308d8
>
>
> Best regards,
>
> Andreas
>
>
>
>
>
>
>
Previous Topic:method not found esception
Next Topic:[EWL/ETL] Model matching
Goto Forum:
  


Current Time: Fri Sep 19 02:04:18 GMT 2014

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

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