[ATL] Troubles with xmiIDs, rule inheritance [message #698304] |
Tue, 19 July 2011 04:37  |
Eclipse User |
|
|
|
Hi,
I'm currently trying to perform a UML to "my UML-like metamodel" transformation. To accomplish that I need to extract xmiIDs from UML elements, and assign them to each created target element. As you may have figured out, I'm stuck.
First, as mentioned in a previous topic (eclipse.org/forums/index.php/t/210173/), it seems impossible to export xmiIDs using EMF-specific VM. Well, I found two cases where I could get them properly : either by storing them into String Attributes, or by removing every link of the element with others (for instance, my root Element "Model", has a xmiID). Those are not solutions however.
Also, I'm using rule inheritance since I have in my metamodel an abstract Element, which every other elements inherit from. While I can access xmiIDs (well, at least there is no error) with the simple assignment "__xmiID__ -> uml.__xmiID__" in any matched rule, I can't extend an abstract rule that uses this assignment because I get an error as soon as I save the ATL file :
org.eclipse.m2m.atl.engine.emfvm.VMException: Unable to access __xmiID__ on OclUndefined
at process_checkSubRules#31(ATLCompiler.atl[685:5-685:33])
local variables: self=IN!abstractElt, forEach=Sequence {IN!Package, IN!Class, IN!Operation}, subRule=IN!Operation, forEach=Sequence {IN!<unnamed>}, ipe=IN!<unnamed>
at process_matcher#188(ATLCompiler.atl[597:7-597:38])
local variables: self=IN!abstractElt, forEach=Sequence {IN!<unnamed>}, ipe=IN!<unnamed>
at process#6(ATLCompiler.atl[552:3-552:28])
local variables: self=IN!abstractElt
at process#2066(ATLCompiler.atl[463:3-463:24])
local variables: self=IN!uml2uml4tst
at main#37(ATLCompiler.atl)
I'm very new to this tool/language. Maybe I'm doing it all wrong ?
Thank you,
A. Vernotte.
|
|
|
Re: [ATL] Troubles with xmiIDs, rule inheritance [message #698325 is a reply to message #698304] |
Tue, 19 July 2011 05:17  |
Eclipse User |
|
|
|
I found why it wasn't working with rule inheritance...
"ATL guide"
- input pattern variables names have to be the same in super and sub rules.
- output pattern variables names have to be the same in super and sub rules for output pattern you want the union.
I can now use inheritance properly, sorry for posting before looking in the manual...
I still have xmiID problems though.
A.Vernotte.
|
|
|
Powered by
FUDForum. Page generated in 0.04507 seconds