[Epsilon] Launch EVL validations programmatically [message #384260] |
Tue, 22 July 2008 05:40  |
Eclipse User |
|
|
|
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 #618528 is a reply to message #384262] |
Tue, 22 July 2008 09:08  |
Eclipse User |
|
|
|
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 05:07  |
Eclipse User |
|
|
|
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 06:22  |
Eclipse User |
|
|
|
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 #618537 is a reply to message #384267] |
Wed, 23 July 2008 08:53  |
Eclipse User |
|
|
|
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 09:42  |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.07269 seconds