Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » [Epsilon] Launch EVL validations programmatically
[Epsilon] Launch EVL validations programmatically [message #384260] Tue, 22 July 2008 09:40 Go to next message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Hello,

I'm trying to launch EVL validations programmatically. I found an example
of how to run EOL from java, and I'm using it for loading de EMF model and
setting its properties. I made some proofs with EOL to ensure the correct
loading and now I'm defining an EvlModule.

It's OK? Or is there an easier way to do it? How do I set the evl file
that contais the validation to the EvlModule to execute it?

Thanks,
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #384261 is a reply to message #384260] Tue, 22 July 2008 10:19 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Héctor,

You can find an example of launching EVL programmatically at
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/examples/org.eclipse.epsilon.examples.standalone/src/or g/eclipse/epsilon/examples/standalone/evl/EvlStandaloneExamp le.java?revision=1.1&root=Technology_Project&view=ma rkup

Cheers,
Dimitrios

Héctor Iturria wrote:
> Hello,
> I'm trying to launch EVL validations programmatically. I found an
> example of how to run EOL from java, and I'm using it for loading de EMF
> model and setting its properties. I made some proofs with EOL to ensure
> the correct loading and now I'm defining an EvlModule.
>
> It's OK? Or is there an easier way to do it? How do I set the evl file
> that contais the validation to the EvlModule to execute it?
>
> Thanks,
> Héctor
>
Re: [Epsilon] Launch EVL validations programmatically [message #384262 is a reply to message #384261] Tue, 22 July 2008 12:50 Go to previous messageGo to next message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Many Thanks!

Now I'm trying to modify the code to work with metamodel URIs (no file
based)

Thanks,
Héctor.
Re: [Epsilon] Launch EVL validations programmatically [message #384263 is a reply to message #384262] Tue, 22 July 2008 13:08 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
To do this you'll need to modify

properties.put(EmfModel.PROPERTY_METAMODEL_FILE,getFile(meta model).getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");

to the following :

properties.put(EmfModel.PROPERTY_METAMODEL_URI,YOUR_URI_HERE );
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "false");

Cheers,
Dimitrios

Héctor Iturria wrote:
> Many Thanks!
>
> Now I'm trying to modify the code to work with metamodel URIs (no file
> based)
>
> Thanks, Héctor.
>
>
>
Re: [Epsilon] Launch EVL validations programmatically [message #384265 is a reply to message #384263] Wed, 23 July 2008 09:07 Go to previous messageGo to next message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Hi,

When I try what you said I get these errors:

/*********************************************************** *****************/
URI: http://prueba/1.0 (This line is the output for:
System.out.println("URI: " +
properties.getProperty(EmfModel.PROPERTY_METAMODEL_URI));

Exception in thread "main" java.lang.NullPointerException
at org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
at
org.epsilon.eol.runfromjava.EpsilonStandalone.createEmfModel (EpsilonStandalone.java:61)
at
org.epsilon.eol.runfromjava.EvlStandalone.getModels(EvlStand alone.java:37)
at
org.epsilon.eol.runfromjava.EpsilonStandalone.execute(Epsilo nStandalone.java:40)
at org.epsilon.eol.runfromjava.EvlStandalone.main(EvlStandalone .java:25)

/*********************************************************** ****************/

I have tried many ways to convert the uri, changing the type of the input
parameters of createEmfModel(), then converting the URI.tostring()...but I
can't make it work. I'm doing something wrong? I mean, does it work for
you or it's a bug?

Thanks!
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #384266 is a reply to message #384265] Wed, 23 July 2008 10:22 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Have you registered the metamodel you are trying to use first? When
running Eclipse, metamodels get registered automatically (either via EMF
itself or via the Register EPackages menu). When running standalone you
have to register your metamodels before you can reference them by URI.

I've uploaded an example of registering a metamodel and then using it
from Epsilon on the CVS
(examples/org.eclipse.epsilon.examples/standalone/src/org/ec lipse/epsilon/examples/standalone/eol/EolStandaloneMetamodel ByUri.java)

Cheers,
Dimitrios




Héctor Iturria wrote:
> Hi,
> When I try what you said I get these errors:
>
> /*********************************************************** *****************/
>
> URI: http://prueba/1.0 (This line is the output for:
> System.out.println("URI: " +
> properties.getProperty(EmfModel.PROPERTY_METAMODEL_URI));
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
> at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
> at
> org.epsilon.eol.runfromjava.EpsilonStandalone.createEmfModel (EpsilonStandalone.java:61)
>
> at
> org.epsilon.eol.runfromjava.EvlStandalone.getModels(EvlStand alone.java:37)
> at
> org.epsilon.eol.runfromjava.EpsilonStandalone.execute(Epsilo nStandalone.java:40)
>
> at
> org.epsilon.eol.runfromjava.EvlStandalone.main(EvlStandalone .java:25)
>
> /*********************************************************** ****************/
>
>
> I have tried many ways to convert the uri, changing the type of the
> input parameters of createEmfModel(), then converting the
> URI.tostring()...but I can't make it work. I'm doing something wrong? I
> mean, does it work for you or it's a bug?
>
> Thanks!
> Héctor
>
>
>
Re: [Epsilon] Launch EVL validations programmatically [message #384267 is a reply to message #384266] Wed, 23 July 2008 12:15 Go to previous messageGo to next message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Ok, now it works :)

Before I registered packages with right click -> Register EPackages.

Thanks a lot!
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #384368 is a reply to message #384267] Wed, 23 July 2008 12:53 Go to previous messageGo to next message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
I'm sorry, I was wrong, the problem remains.

Maybe it's becuase of the version of the plugins? I've noticed that in the
examples your imports are like: org.eclipse.epsilon.* and mine are
org.epsilon.*...

I've checkout the CVS plugins and noticed than version of that plugins
(the name is like the ones you use in your examples) are 0.8 while the
ones I downloaded from you update site are 1.36

Is there any imcompatibility?

The errors I get are:
/*********************************************************** /
Exception in thread "main" java.lang.NullPointerException
at org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
at
org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.createEmf Model(EpsilonStandaloneByURI.java:66)
at
org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.getM odels(EvlStandaloneMetamodelByUri.java:31)
at
org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.execute(E psilonStandaloneByURI.java:44)
at
org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.main (EvlStandaloneMetamodelByUri.java:18)
/*********************************************************** **/

Thanks,
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #384369 is a reply to message #384368] Wed, 23 July 2008 13:42 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Héctor,

As strange as it may sound, 0.8.0 is newer than 1.3.6. The reason is
that Epsilon now conforms with the incubation process which (among other
things) requires version numbers to be < 1.0 and the namespace change
you noticed (org.epsilon.* -> org.eclipse.epsilon.*).

We haven't built a binary version of 0.8.0 yet - but this will happen
within the next couple of days. If you can't wait until then, I'd
suggest checking out the code from the CVS (which btw I think is
generally a better idea as you'll be able to pick up future features and
bug-fixes faster).

Cheers,
Dimitrios

Héctor Iturria wrote:
> I'm sorry, I was wrong, the problem remains.
>
> Maybe it's becuase of the version of the plugins? I've noticed that in
> the examples your imports are like: org.eclipse.epsilon.* and mine are
> org.epsilon.*...
>
> I've checkout the CVS plugins and noticed than version of that plugins
> (the name is like the ones you use in your examples) are 0.8 while the
> ones I downloaded from you update site are 1.36
>
> Is there any imcompatibility?
>
> The errors I get are:
> /*********************************************************** /
> Exception in thread "main" java.lang.NullPointerException
> at
> org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
> at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
> at
> org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.createEmf Model(EpsilonStandaloneByURI.java:66)
>
> at
> org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.getM odels(EvlStandaloneMetamodelByUri.java:31)
>
> at
> org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.execute(E psilonStandaloneByURI.java:44)
>
> at
> org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.main (EvlStandaloneMetamodelByUri.java:18)
>
> /*********************************************************** **/
>
> Thanks,
> Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #384371 is a reply to message #384369] Thu, 24 July 2008 06:32 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
I see. I have already checkout the plugins from CVS, so next step is
changing the plugin dependeces and the imports to the newer version. If I
can't make it work, I will wait for the binaries.

Many Thanks!
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #618525 is a reply to message #384260] Tue, 22 July 2008 10:19 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Héctor,

You can find an example of launching EVL programmatically at
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmt/eps ilon/examples/org.eclipse.epsilon.examples.standalone/src/or g/eclipse/epsilon/examples/standalone/evl/EvlStandaloneExamp le.java?revision=1.1&root=Technology_Project&view=ma rkup

Cheers,
Dimitrios

Héctor Iturria wrote:
> Hello,
> I'm trying to launch EVL validations programmatically. I found an
> example of how to run EOL from java, and I'm using it for loading de EMF
> model and setting its properties. I made some proofs with EOL to ensure
> the correct loading and now I'm defining an EvlModule.
>
> It's OK? Or is there an easier way to do it? How do I set the evl file
> that contais the validation to the EvlModule to execute it?
>
> Thanks,
> Héctor
>
Re: [Epsilon] Launch EVL validations programmatically [message #618527 is a reply to message #384261] Tue, 22 July 2008 12:50 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Many Thanks!

Now I'm trying to modify the code to work with metamodel URIs (no file
based)

Thanks,
Héctor.
Re: [Epsilon] Launch EVL validations programmatically [message #618528 is a reply to message #384262] Tue, 22 July 2008 13:08 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
To do this you'll need to modify

properties.put(EmfModel.PROPERTY_METAMODEL_FILE,getFile(meta model).getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");

to the following :

properties.put(EmfModel.PROPERTY_METAMODEL_URI,YOUR_URI_HERE );
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "false");

Cheers,
Dimitrios

Héctor Iturria wrote:
> Many Thanks!
>
> Now I'm trying to modify the code to work with metamodel URIs (no file
> based)
>
> Thanks, Héctor.
>
>
>
Re: [Epsilon] Launch EVL validations programmatically [message #618532 is a reply to message #384263] Wed, 23 July 2008 09:07 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Hi,

When I try what you said I get these errors:

/*********************************************************** *****************/
URI: http://prueba/1.0 (This line is the output for:
System.out.println("URI: " +
properties.getProperty(EmfModel.PROPERTY_METAMODEL_URI));

Exception in thread "main" java.lang.NullPointerException
at org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
at
org.epsilon.eol.runfromjava.EpsilonStandalone.createEmfModel (EpsilonStandalone.java:61)
at
org.epsilon.eol.runfromjava.EvlStandalone.getModels(EvlStand alone.java:37)
at
org.epsilon.eol.runfromjava.EpsilonStandalone.execute(Epsilo nStandalone.java:40)
at org.epsilon.eol.runfromjava.EvlStandalone.main(EvlStandalone .java:25)

/*********************************************************** ****************/

I have tried many ways to convert the uri, changing the type of the input
parameters of createEmfModel(), then converting the URI.tostring()...but I
can't make it work. I'm doing something wrong? I mean, does it work for
you or it's a bug?

Thanks!
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #618534 is a reply to message #384265] Wed, 23 July 2008 10:22 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Have you registered the metamodel you are trying to use first? When
running Eclipse, metamodels get registered automatically (either via EMF
itself or via the Register EPackages menu). When running standalone you
have to register your metamodels before you can reference them by URI.

I've uploaded an example of registering a metamodel and then using it
from Epsilon on the CVS
(examples/org.eclipse.epsilon.examples/standalone/src/org/ec lipse/epsilon/examples/standalone/eol/EolStandaloneMetamodel ByUri.java)

Cheers,
Dimitrios




Héctor Iturria wrote:
> Hi,
> When I try what you said I get these errors:
>
> /*********************************************************** *****************/
>
> URI: http://prueba/1.0 (This line is the output for:
> System.out.println("URI: " +
> properties.getProperty(EmfModel.PROPERTY_METAMODEL_URI));
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
> at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
> at
> org.epsilon.eol.runfromjava.EpsilonStandalone.createEmfModel (EpsilonStandalone.java:61)
>
> at
> org.epsilon.eol.runfromjava.EvlStandalone.getModels(EvlStand alone.java:37)
> at
> org.epsilon.eol.runfromjava.EpsilonStandalone.execute(Epsilo nStandalone.java:40)
>
> at
> org.epsilon.eol.runfromjava.EvlStandalone.main(EvlStandalone .java:25)
>
> /*********************************************************** ****************/
>
>
> I have tried many ways to convert the uri, changing the type of the
> input parameters of createEmfModel(), then converting the
> URI.tostring()...but I can't make it work. I'm doing something wrong? I
> mean, does it work for you or it's a bug?
>
> Thanks!
> Héctor
>
>
>
Re: [Epsilon] Launch EVL validations programmatically [message #618535 is a reply to message #384266] Wed, 23 July 2008 12:15 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
Ok, now it works :)

Before I registered packages with right click -> Register EPackages.

Thanks a lot!
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #618537 is a reply to message #384267] Wed, 23 July 2008 12:53 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
I'm sorry, I was wrong, the problem remains.

Maybe it's becuase of the version of the plugins? I've noticed that in the
examples your imports are like: org.eclipse.epsilon.* and mine are
org.epsilon.*...

I've checkout the CVS plugins and noticed than version of that plugins
(the name is like the ones you use in your examples) are 0.8 while the
ones I downloaded from you update site are 1.36

Is there any imcompatibility?

The errors I get are:
/*********************************************************** /
Exception in thread "main" java.lang.NullPointerException
at org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
at
org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.createEmf Model(EpsilonStandaloneByURI.java:66)
at
org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.getM odels(EvlStandaloneMetamodelByUri.java:31)
at
org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.execute(E psilonStandaloneByURI.java:44)
at
org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.main (EvlStandaloneMetamodelByUri.java:18)
/*********************************************************** **/

Thanks,
Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #618538 is a reply to message #384368] Wed, 23 July 2008 13:42 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Héctor,

As strange as it may sound, 0.8.0 is newer than 1.3.6. The reason is
that Epsilon now conforms with the incubation process which (among other
things) requires version numbers to be < 1.0 and the namespace change
you noticed (org.epsilon.* -> org.eclipse.epsilon.*).

We haven't built a binary version of 0.8.0 yet - but this will happen
within the next couple of days. If you can't wait until then, I'd
suggest checking out the code from the CVS (which btw I think is
generally a better idea as you'll be able to pick up future features and
bug-fixes faster).

Cheers,
Dimitrios

Héctor Iturria wrote:
> I'm sorry, I was wrong, the problem remains.
>
> Maybe it's becuase of the version of the plugins? I've noticed that in
> the examples your imports are like: org.eclipse.epsilon.* and mine are
> org.epsilon.*...
>
> I've checkout the CVS plugins and noticed than version of that plugins
> (the name is like the ones you use in your examples) are 0.8 while the
> ones I downloaded from you update site are 1.36
>
> Is there any imcompatibility?
>
> The errors I get are:
> /*********************************************************** /
> Exception in thread "main" java.lang.NullPointerException
> at
> org.epsilon.eol.models.emf.EmfUtil.collectDependencies(EmfUt il.java:46)
> at org.epsilon.eol.models.emf.EmfModel.loadModel(EmfModel.java: 138)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:78)
> at org.epsilon.eol.models.emf.EmfModel.load(EmfModel.java:72)
> at
> org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.createEmf Model(EpsilonStandaloneByURI.java:66)
>
> at
> org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.getM odels(EvlStandaloneMetamodelByUri.java:31)
>
> at
> org.epsilon.eol.runfromjava.EpsilonStandaloneByURI.execute(E psilonStandaloneByURI.java:44)
>
> at
> org.epsilon.eol.runfromjava.EvlStandaloneMetamodelByUri.main (EvlStandaloneMetamodelByUri.java:18)
>
> /*********************************************************** **/
>
> Thanks,
> Héctor
Re: [Epsilon] Launch EVL validations programmatically [message #618542 is a reply to message #384369] Thu, 24 July 2008 06:32 Go to previous message
Hector Iturria is currently offline Hector IturriaFriend
Messages: 60
Registered: July 2009
Member
I see. I have already checkout the plugins from CVS, so next step is
changing the plugin dependeces and the imports to the newer version. If I
can't make it work, I will wait for the binaries.

Many Thanks!
Héctor
Previous Topic:[Epsilon] Launch EVL validations programmatically
Next Topic:OAW xpt and counters
Goto Forum:
  


Current Time: Fri Mar 29 08:00:05 GMT 2024

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

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

Back to the top