ATL does not like EList in operation parameters [message #1748495] |
Wed, 23 November 2016 10:36  |
Eclipse User |
|
|
|
Hi all,
I am writing some transformations between metamodels that I defined using Ecore.
In one of those metamodels I defined some operations, using OCL. In particular I defined the following operation:
evaluate(assignments tmdl::core::Assignment[*]) : ecore::EInt
This translates into the following signature from the generated code:
int evaluate(EList<Assignment> assignments);
ATL correctly recognizes the existence of this operation, but it throws an exception every time I try to call it using a collection of 'Assignment' objects as a parameter, e.g.:
value <- tm.value.evaluate(TMDLEX!Assignment.allInstances()->asSequence())
throws:
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: template!<unnamed>.evaluate(java.util.ArrayList)
It appears that ATL is not able to match EList objects against its collections types. I am aware of the genmodel option to "Suppress EMF Types", and in fact it works correctly if I select that option. However I am afraid of the impact of this option, which as I understand is not recommended.
Also, it seems more like a bug in ATL, because it is able to properly handle EList objects in other situations, for example as fields of model elements.
Do you have any suggestions?
Thanks,
Leonardo.
|
|
|
|
|
Re: ATL does not like EList in operation parameters [message #1748640 is a reply to message #1748515] |
Fri, 25 November 2016 10:18   |
Eclipse User |
|
|
|
Hi Dennis,
Thank you for your quick and accurate response!
I did not know about EMFTVM, I tried it and it seems to solve that problem about ELists. However, I am having several other issues, it seems that the compiler is more strict than the "normal" one, is it true?
I managed to solve most of them, but now I am struggling with the following problem.
I have a lazy abstract rule that looks like the following:
lazy abstract rule Marking {
from
tm : SANT!Marking
to
m : SAN!Marking
}
where SAN!Marking and SANT!Marking are both abstract classes, from different metamodels. This rule is then extended by several other lazy rules. This was working perfectly with the normal compiler, but now I get:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.IllegalArgumentException: The class 'Marking' is not a valid classifier
Any suggestions?
Thanks,
Leonardo.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10869 seconds