[great-users] global variable

Aditya Agrawal aagrawa at us.ibm.com
Tue Apr 5 13:57:56 CDT 2005


Global namespace in GReAT are defined using a UML Package with a root 
element. This package is marked as global which means that GReAT will 
manage the single instance of this namespace within the rules. 

you can create an arbitrary type system in the global package. For 
example, you could have new classes with attributes, associations and all 
the works of a normal UML class diagram. Then in the rules you can access 
the root element of this global namespace without having to get it from an 
input port.

If you have a reference of the root type in the rule GReAT will provide 
you this root element. From here on it is regular great semantics, you can 
find other entities of your type system by traversing through the global 
root element and access these types and their attributes in the Guard and 
Attribute mapping code. 

Attila, please correct me if I am wrong.

Thanks,
Adi

-----------------------------------
Aditya Agrawal
Researcher
IBM T. J. Watson
mailto:aagrawa at us.ibm.com
+1 (914) 784-6068 (TL 863)


great-users-bounces at list.isis.vanderbilt.edu wrote on 04/05/2005 12:27:58 
PM:

> Hey,
> 
> last time I faced this problem I had to hack that into some 
> attribute of a class. Dirty trick but works. This functionality 
> would be definitely useful, but I guess it could be used to pass 
> information without following the event passing semantics.
> 
> Gabe
> 
> -----Original Message-----
> From: Gábor Bátori (IJ/ETH) [mailto:Gabor.Batori at ericsson.com] 
> Sent: Tuesday, April 05, 2005 11:22 AM
> To: great-users
> Subject: [great-users] global variable
> 
> 
> Is it possible to create 'global variables' in GReat, which are 
> accessible in the AtrributeMappings of different rules? For instance
> a counter which counts the sub-tree elements of a model, but the 
> counter is not part of the source and the target meta-models.
> 
> Thanks in advance,
> 
> Gabor Batori
> 
> _______________________________________________
> great-users mailing list
> great-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/great-users
> _______________________________________________
> great-users mailing list
> great-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/great-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/great-users/attachments/20050405/0e8c2c49/attachment.htm


More information about the great-users mailing list