[ATL] Problem with defining global variables [message #541234] |
Fri, 18 June 2010 19:17 |
katja Messages: 18 Registered: March 2010 |
Junior Member |
|
|
Hello everybody,
I have a problem with global variables. The same problem was discussed earlier here (see the link), but the solution does not work with my example.
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00609.html
I want only to optimize my transformations and they work without global variables, but I am really surprised, why they can't with them.
My example looks like this:
helper def : classes : Set(bpmn!Class) = Set{};
helper def : defineSpecialClasses : Set(bpmn!Class) =
bpmn!Class.allInstances()->select(a | a.name = '');
entrypoint rule Metamodel() {
to t : uml!Model(
packagedElement <- bpmn!BPool.allInstances()->collect(a | thisModule.r0(a))
do { thisModule.Model <- t;
thisModule.classes<-thisModule.classes->union(thisModule.defineSpecialClasses());
thisModule.classes->size().debug(' set size in model: ')
}}
unique lazy rule r0{
from X0 : bpmn!Pool
to Y0 : uml!Collaboration(
ownedAttribute <-X1.Lanes->select(a | thisModule.classes->exists(b | b.refImmediateComposite()=a))->collect(a | thisModule.r1(a)) )
do {
thisModule.classes->size().debug(' set size in colloboration: ')
}}
The output is:
set size in model: 18
set size in colloboration: 0
Could anybody explain me why do I have the second size 0?
I use Eclipse 3.4.2, ATL 3.0.1, EMF-specific VM.
Thank you in advanced!
[Updated on: Fri, 18 June 2010 19:20] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02234 seconds