Skip to main content


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 AndreasFriend
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 KolovosFriend
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 Apr 26 23:20:45 GMT 2024

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

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

Back to the top