Using the EmfModel class [message #558486] |
Mon, 13 September 2010 08:47 |
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 #558503 is a reply to message #558486] |
Mon, 13 September 2010 09:36 |
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
>
>
>
>
>
>
>
|
|
|
|
|
Re: Using the EmfModel class [message #558524 is a reply to message #558521] |
Mon, 13 September 2010 11:19 |
Andreas Messages: 33 Registered: September 2010 Location: Germany |
Member |
|
|
Hi Dimitris,
mainly I want to use EGL to acess the data and generate a HTML Report from them.
But at the moment I just play around and try different solution to access the data.
At the moment it seems to me, that the problem is somewhere around the loading of the model (creation of the EmfModel class).
Regards,
Andreas
[Updated on: Mon, 13 September 2010 11:19] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05784 seconds