|
|
|
Re: Copying elements of EPackage to another EPackage [message #1800095 is a reply to message #1798361] |
Wed, 19 December 2018 20:31 |
Banafsheh Azizi Messages: 328 Registered: July 2016 |
Senior Member |
|
|
Hi there,
I have not any problem with copying elements when I run my program with EOL engine. However, when I run my program in standalone, I have an error in the last line, `Called feature name on undefined object`.
var emfTool : new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
var statement = ETL!ETLModule.all.first.preBlocks.body.statements.flatten.first;
var node = new Target!Node;
node.ref = emfTool.ecoreUtil.copy(statement);
node.ref.type().name.println;
This is to mention that when I change line 4 with the code bellow, I have not any error.
node.ref = new ETL!StringExpression;
I have `org.eclipse.epsilon.emc.emf` in my plugin dependencies. When I print `node.ref` it gives me `org.eclipse.epsilon.eol.metamodel.impl.ExpressionStatementImpl@1ed8d18c (uri: null)` . However, `node.ref.type()` gives null.
Best Regards,
Banafsheh
Member of MDSE Research Group
http://mdse.ui.ac.ir
[Updated on: Thu, 20 December 2018 07:27] Report message to a moderator
|
|
|
|
|
|
Re: Copying elements of EPackage to another EPackage [message #1800140 is a reply to message #1800135] |
Thu, 20 December 2018 11:42 |
Banafsheh Azizi Messages: 328 Registered: July 2016 |
Senior Member |
|
|
Hi Dimitris,
On the contrary, it works well through Epsilon but not through Java API.
To clarify, in case that I import all plugins of Haetae to eclipse and use its api in my plugin to generate the model then I run my EOL program in a standalone mode, I have the error.
Anyway, I do not think its related to haetae as the model is generated correctly and I have not any problem with eol statements other than the copy statements. I am trying to provide a minimal example.
Best Regards,
Banafsheh
Member of MDSE Research Group
http://mdse.ui.ac.ir
[Updated on: Thu, 20 December 2018 11:47] Report message to a moderator
|
|
|
Re: Copying elements of EPackage to another EPackage [message #1800158 is a reply to message #1800140] |
Thu, 20 December 2018 15:02 |
Banafsheh Azizi Messages: 328 Registered: July 2016 |
Senior Member |
|
|
Hi Dimitris,
I use Epsilon 1.3. I have added a ETLCodetoModel method to AbstractAST2ExLAction class of Haetae. To reproduce my problem you might want to do these steps.
1. importing files of the `first eclipse` folder to eclipse.
2. run it as an eclipse application
3. In the new eclipse, import the files of the `second eclipse` folder
4. right click on the `Families2Persons.etl` file and select `test` from the popup menu.
Then, you can see the error in the console of your first eclipse.
Best Regards,
Banafsheh
Member of MDSE Research Group
http://mdse.ui.ac.ir
[Updated on: Thu, 20 December 2018 15:09] Report message to a moderator
|
|
|
|
|
|
Re: Copying elements of EPackage to another EPackage [message #1800317 is a reply to message #1800196] |
Mon, 24 December 2018 12:32 |
|
Hi there,
Thanks for your patience, apologies - I am on holidays so access to emails is disrupted.
I would try the clone() operation in Epsilon, which is applicable on collections first. For example, in your code below:
var emfTool : new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
var statement = ETL!ETLModule.all.first.preBlocks.body.statements.flatten.first;
var node = new Target!Node;
node.ref = emfTool.ecoreUtil.copy(statement);
node.ref.type().name.println;
You could easily do :
var statement = ETL!ETLModule.all.clone().first.***
but my question is if you are constructing a graph model with reference to ETLElements, why use a clone instead of the original ETLElements?
Cheers,
Will
Research Associate
Department of Computer Science
University of York
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04315 seconds