Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problem with defining global variables
[ATL] Problem with defining global variables [message #541234] Fri, 18 June 2010 19:17 Go to next message
katja  is currently offline katja Friend
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

Re: [ATL] Problem with defining global variables [message #541745 is a reply to message #541234] Tue, 22 June 2010 12:23 Go to previous message
katja  is currently offline katja Friend
Messages: 18
Registered: March 2010
Junior Member
Please! Can anybody help me! I can't do anything with global variables...
Previous Topic:Graphical Development of ATL
Next Topic:AML - Basic Tutorial
Goto Forum:
  


Current Time: Thu Apr 25 01:39:19 GMT 2024

Powered by FUDForum. Page generated in 0.03771 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top