[Epsilon] running a EOL operation from Java [message #380182] |
Fri, 26 October 2007 06:27 |
Eclipse User |
|
|
|
Originally posted by: firstname.name.gmail.com
Hello,
For the purpose of a Eclipse Plugin Project development (using UML plugin), I
would like to run some simple model manipulation/transformation from Java. I
read how epsilon may be used for that (Running EOL from Java). I am wondering if
I may call an EOL operation in a similar manner.
For example consider a simple operation such (i am not familiar with the EOL syntax)
operation simpleTransformation add(e : NamedElement, newName: String):Bag(NamedElement) {
e.name = newName
return Bag{e};
}
Is it possible to specify the operation to execute, instead of (with regards to
the runfromjava/Main.java example) module.execute(); and retrieve the return
value.
thanks in advance.
--
F. Lagarde
|
|
|
|
Re: [Epsilon] running a EOL operation from Java [message #380322 is a reply to message #380183] |
Fri, 26 October 2007 13:53 |
Eclipse User |
|
|
|
Originally posted by: firstname.name.gmail.com
In the last post, on 10/26 about 10h, "Dimitrios" (Dimitrios Kolovos) wrote:
Dimitrios> Hi François, Yes this is possible. Instead of module.execute()
Dimitrios> you should invoke
Dimitrios> module.getOperations().getOperation(...).execute(...).
It seems to be exactly what I need ;-).
I created a basic operation, but I am unable to execute it. I think that its
because I don't load properly the UML metamodel (from a java program).
In my context, the UML model is not in a file but in a resource, and i want to
provide the correct model element during the operation call.
any helps would be appreciated.
--
F. Lagarde
|
|
|
Re: [Epsilon] running a EOL operation from Java [message #380323 is a reply to message #380322] |
Fri, 26 October 2007 14:02 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi François,
If your model is an already loaded EMF Resource you'll need to use the
InMemoryEmfModel instead of the EmfModel like that:
Resource umlResource = ...;
InMemoryEmfModel model = new InMemoryEmfModel('UML', umlResource);
module.getContext().getModelRepository().add(model);
I hope this helps.
Cheers,
Dimitrios
François Lagarde wrote:
> In the last post, on 10/26 about 10h, "Dimitrios" (Dimitrios Kolovos) wrote:
>
> Dimitrios> Hi François, Yes this is possible. Instead of module.execute()
> Dimitrios> you should invoke
> Dimitrios> module.getOperations().getOperation(...).execute(...).
>
>
> It seems to be exactly what I need ;-).
>
> I created a basic operation, but I am unable to execute it. I think that its
> because I don't load properly the UML metamodel (from a java program).
>
> In my context, the UML model is not in a file but in a resource, and i want to
> provide the correct model element during the operation call.
>
> any helps would be appreciated.
>
|
|
|
|
Re: [Epsilon] running a EOL operation from Java [message #608178 is a reply to message #380183] |
Fri, 26 October 2007 13:53 |
Eclipse User |
|
|
|
Originally posted by: firstname.name.gmail.com
In the last post, on 10/26 about 10h, "Dimitrios" (Dimitrios Kolovos) wrote:
Dimitrios> Hi François, Yes this is possible. Instead of module.execute()
Dimitrios> you should invoke
Dimitrios> module.getOperations().getOperation(...).execute(...).
It seems to be exactly what I need ;-).
I created a basic operation, but I am unable to execute it. I think that its
because I don't load properly the UML metamodel (from a java program).
In my context, the UML model is not in a file but in a resource, and i want to
provide the correct model element during the operation call.
any helps would be appreciated.
--
F. Lagarde
|
|
|
Re: [Epsilon] running a EOL operation from Java [message #608179 is a reply to message #380322] |
Fri, 26 October 2007 14:02 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi François,
If your model is an already loaded EMF Resource you'll need to use the
InMemoryEmfModel instead of the EmfModel like that:
Resource umlResource = ...;
InMemoryEmfModel model = new InMemoryEmfModel('UML', umlResource);
module.getContext().getModelRepository().add(model);
I hope this helps.
Cheers,
Dimitrios
François Lagarde wrote:
> In the last post, on 10/26 about 10h, "Dimitrios" (Dimitrios Kolovos) wrote:
>
> Dimitrios> Hi François, Yes this is possible. Instead of module.execute()
> Dimitrios> you should invoke
> Dimitrios> module.getOperations().getOperation(...).execute(...).
>
>
> It seems to be exactly what I need ;-).
>
> I created a basic operation, but I am unable to execute it. I think that its
> because I don't load properly the UML metamodel (from a java program).
>
> In my context, the UML model is not in a file but in a resource, and i want to
> provide the correct model element during the operation call.
>
> any helps would be appreciated.
>
|
|
|
Powered by
FUDForum. Page generated in 0.02166 seconds