EOL stansalone problem [message #1771894] |
Thu, 31 August 2017 15:49  |
Eclipse User |
|
|
|
Hi,
When I want to run the below code via standalone, I have an error. It is run via EOL configuration without any error.
I transform Families2Persons transformation to its equivalent model with Haetae. And I navigated this model namely ETL via eol program.
the part of code that caused the problem:
for (preblock in ETL!ETLModule.allInstances()-> first().preBlocks.body.statements)
{
}
error:
Called feature preBlocks on undefined object
at (bundleresource://2405.fwk254513404/org/eclipse/epsilon/examples/standalone/eol/Demo.eol@16:18-16:66)
at (bundleresource://2405.fwk254513404/org/eclipse/epsilon/examples/standalone/eol/Demo.eol@16:18-16:71)
at (bundleresource://2405.fwk254513404/org/eclipse/epsilon/examples/standalone/eol/Demo.eol@16:18-16:82)
at (bundleresource://2405.fwk254513404/org/eclipse/epsilon/examples/standalone/eol/Demo.eol@16:1-22:2)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:46)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:40)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:72)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:109)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:39)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:72)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:109)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:39)
at org.eclipse.epsilon.eol.dom.PropertyCallExpression.execute(PropertyCallExpression.java:72)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:109)
at org.eclipse.epsilon.eol.dom.ForStatement.execute(ForStatement.java:45)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:109)
at org.eclipse.epsilon.eol.dom.StatementBlock.execute(StatementBlock.java:43)
at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:109)
at org.eclipse.epsilon.eol.EolModule.execute(EolModule.java:55)
at org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExample.execute(EpsilonStandaloneExample.java:83)
at org.eclipse.epsilon.examples.standalone.EpsilonStandaloneExample.execute(EpsilonStandaloneExample.java:71)
.
The model is attached.
I have also statement such as below. Although it doesn't have an error, it doesn't go to the inner of for block.
for (tr in ETL!TransformationRule)
{
}
[Updated on: Thu, 31 August 2017 16:54] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: EOL stansalone problem [message #1772024 is a reply to message #1772009] |
Mon, 04 September 2017 04:56   |
Eclipse User |
|
|
|
Hi,
Yes, Haetae is not compatible with 1.4 however, I actually tried to create a minimal EOL standalone application that doesn't use any aspect of Haetae except the ETL.ecore and EOL.ecore metamodels. But your provided model still has errors. Anyway, I spend some time trying that in Epsilon 1.3 as well to confirm my understanding and indeed the same problem exists: your model is not parsing at my side (I tried all the versions you provided to far). And I think that you receive the exception you posted in your last message because of that. I actually receive the same exception when I use your model.
So, the importand bits:
1) As soon as you're loading an EMF model then you have to register the metamodels this model conforms to. So, if your model conforms to the ETL metamodel then you have to register it. If your model conforms to the Person metamodel then you have to register it, etc. Otherwise, Epsilon won't be able to execute the standalone program. The fact that you don't get the error when you run in a new Eclipse instance might be because Haetae registers the metamodels for you in one of its plugins that are loaded when the new Eclipse instance loads.
2) I created another example model, as your model doesn't work for me. Your demo.eol executes fine on this model. I actually changed it a bit (see below) as soon as my model doesn't have body statements***.
This is my Demo.eol
"hi".println();
var sys = Native("java.lang.System") ;
var startTime = sys.currentTimeMillis();
startTime.println("start ... ");
var package = new Ecore!EPackage;
package.name = 'Target';
var EolPrinter : new Native("org.eclipse.epsilon.eol.visitor.printer.impl.EolPrinter");
/* pre */
for (preblock in ETL!ETLModule.allInstances()-> first().preBlocks)
{
for (pre in preblock)
{
pre.println();
}
}
"bye".println();
And this is what it prints:
hi
start ... 1504514902120
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@14a4e18 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@12da18f (name: NamedBlock) (instanceClassName: null) (abstract: false, interface: false))
bye
Which is a valid output based on my model input: I have one Transformation Rule which has one preblock. The script enters in both loops and prints the preblock.
What I would suggest is try my model that I attach and verify that it works for you.
*** When I try to create a new model that conforms to the ETL.ecore provided in Haetae I get a (not very descriptive) NPE. As a result I cannot access the properties to create body statements. I don't know if you get this as well. My basic model still works though. In any case, I will ping William, the main developer of Haetae, to ask him about that and I will let you know. I am not familiar with Haetae at all and it might be something that I am doing wrong.
Attachment: thanos.model
(Size: 0.31KB, Downloaded 266 times)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: EOL stansalone problem [message #1772429 is a reply to message #1772364] |
Sat, 09 September 2017 03:25   |
Eclipse User |
|
|
|
when I remove the below line of my code it works well:
models.add(createEmfMetaModelByURI("ETL", "ETL_MM", "http://www.eclipse.org/epsilon/etl"));
protected EmfMetaModel createEmfMetaModelByURI(String name, String Aliases, String metamodel)
throws EolModelLoadingException, URISyntaxException {
EmfMetaModel emfMetaModel = new EmfMetaModel();
// emfMetaModel.getAliases().add(Aliases);
StringProperties properties = new StringProperties();
properties.put(EmfMetaModel.PROPERTY_NAME, name);
properties.put(EmfMetaModel.PROPERTY_METAMODEL_URI,
metamodel);
properties.put(EmfMetaModel.PROPERTY_ALIASES,
Aliases);
emfMetaModel.load(properties, (IRelativePathResolver) null);
return emfMetaModel;
}
It seems set aliases not works for me. It is not used in my code and I remove it.
Many thanks for your time and sorry for any inconvenience.
[Updated on: Sat, 09 September 2017 03:39] by Moderator
|
|
|
|
|
|
|
|
|
|
Re: EOL stansalone problem [message #1775304 is a reply to message #1775030] |
Fri, 27 October 2017 08:00  |
Eclipse User |
|
|
|
When I open an atl file in the editor and run the program, it doesn't have the last error but eclipse is crashed only in mac os.
According to error log, It seems the eclipse is crashed because of "libswt-cocoa-4530.jnilib". Do you know what should I do?
I have an "OS X EI captain", I downloaded eclipse mars from epsilon site (I want to use epsilon 1.3). Does higher version of eclipse solve my problem? Which another "eclipse modeling" can I download? I see https://www.eclipse.org/modeling/downloads/ but I cannot find the suitable version of it for my OS, also I see other platforms link.
Does epsilon1.3 support, the newer version of eclipse?
[Updated on: Fri, 27 October 2017 13:31] by Moderator
|
|
|