Home » Modeling » Epsilon » Calling EOL from Java
|
Re: Calling EOL from Java [message #443168 is a reply to message #442964] |
Fri, 31 July 2009 14:08 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Edd,
You should call the prepare() method of the module before executing the
operation (module.execute() does this by default):
EolOperation operation = module.getDeclaredOperations().get(3);
module.prepare();
operation.execute(null, parameters, module.getContext());
Cheers,
Dimitris
Edward Turner wrote:
> Hi all,
>
> I'm currently playing with running Epsilon (specifically an EOL file)
> from Java, using the org.eclipse.epsilon.examples.standalone examples
> provided by Epsilon as a starting point, and I've just come into a
> little stumbling point.
>
> I find that when I call a specific EOL operation (as per the example in
> org.eclipse.epsilon.examples.standalone.eol), it successfully executes
> only when the EOL operation definition does not make calls to other EOL
> operations. A code snippet is below:
>
> -- overriden method of EpsilonStandaloneExample in
> org.eclipse.epsilon.examples.standalone
> protected Object execute(IEolExecutableModule module) throws
> EolRuntimeException {
> ...
> // get third operation defined in the EOL file, and execute it
> EolOperation operation = module.getDeclaredOperations().get(3);
> operation.execute(null, parameters, module.getContext());
> ...
> }
>
> Am I doing something wrong or I need to somehow explicitly load all used
> operations first?
>
> Any pointers would be greatly appreciated.
>
> Best,
>
> Edd
>
|
|
|
Re: Calling EOL from Java [message #443458 is a reply to message #443168] |
Fri, 31 July 2009 14:48 |
No real name Messages: 92 Registered: July 2009 |
Member |
|
|
> Hi Edd,
Hia Dimitris, thanks for your swift reply!
> You should call the prepare() method of the module before executing the
> operation (module.execute() does this by default):
> EolOperation operation = module.getDeclaredOperations().get(3);
> module.prepare();
> operation.execute(null, parameters, module.getContext());
Great -- yes that was the solution.
Just a note, this didn't work straight off because
org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExa mple defines
the variable,
protected IEolExecutableModule module;
.. and the interface, IEolExecutableModule does not require definition of
the prepare() method. Instead of adding this method to the interface, I
just changed the example so that module is defined (in
org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExa mple) as:
protected EolModule module;
And so then, calling prepare() is fine.
Anyway -- many thanks for your help.
> Cheers,
> Dimitris
Cheers,
Edd
|
|
|
Re: Calling EOL from Java [message #572071 is a reply to message #442964] |
Fri, 31 July 2009 14:08 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Edd,
You should call the prepare() method of the module before executing the
operation (module.execute() does this by default):
EolOperation operation = module.getDeclaredOperations().get(3);
module.prepare();
operation.execute(null, parameters, module.getContext());
Cheers,
Dimitris
Edward Turner wrote:
> Hi all,
>
> I'm currently playing with running Epsilon (specifically an EOL file)
> from Java, using the org.eclipse.epsilon.examples.standalone examples
> provided by Epsilon as a starting point, and I've just come into a
> little stumbling point.
>
> I find that when I call a specific EOL operation (as per the example in
> org.eclipse.epsilon.examples.standalone.eol), it successfully executes
> only when the EOL operation definition does not make calls to other EOL
> operations. A code snippet is below:
>
> -- overriden method of EpsilonStandaloneExample in
> org.eclipse.epsilon.examples.standalone
> protected Object execute(IEolExecutableModule module) throws
> EolRuntimeException {
> ...
> // get third operation defined in the EOL file, and execute it
> EolOperation operation = module.getDeclaredOperations().get(3);
> operation.execute(null, parameters, module.getContext());
> ...
> }
>
> Am I doing something wrong or I need to somehow explicitly load all used
> operations first?
>
> Any pointers would be greatly appreciated.
>
> Best,
>
> Edd
>
|
|
|
Re: Calling EOL from Java [message #572099 is a reply to message #443168] |
Fri, 31 July 2009 14:48 |
No real name Messages: 92 Registered: July 2009 |
Member |
|
|
> Hi Edd,
Hia Dimitris, thanks for your swift reply!
> You should call the prepare() method of the module before executing the
> operation (module.execute() does this by default):
> EolOperation operation = module.getDeclaredOperations().get(3);
> module.prepare();
> operation.execute(null, parameters, module.getContext());
Great -- yes that was the solution.
Just a note, this didn't work straight off because
org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExa mple defines
the variable,
protected IEolExecutableModule module;
.. and the interface, IEolExecutableModule does not require definition of
the prepare() method. Instead of adding this method to the interface, I
just changed the example so that module is defined (in
org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExa mple) as:
protected EolModule module;
And so then, calling prepare() is fine.
Anyway -- many thanks for your help.
> Cheers,
> Dimitris
Cheers,
Edd
|
|
|
Goto Forum:
Current Time: Fri Apr 19 09:36:01 GMT 2024
Powered by FUDForum. Page generated in 0.03292 seconds
|