Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [MOFScript] Navigable Asociation
[MOFScript] Navigable Asociation [message #380331] Thu, 08 November 2007 11:30 Go to next message
Eclipse User
Originally posted by: javjimgon.alum.us.es

Hello,

I would like to know when a end association isNavigable. On order to
generate an attribute only in the class which is in the navigable end of
the association.

Thank you in advance!!
Javier Jimenez
Re: [MOFScript] Navigable Asociation [message #380334 is a reply to message #380331] Fri, 09 November 2007 13:38 Go to previous messageGo to next message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hello Javier,

Considering UML.

I have seen different implementations of this so it depends on how your
model is created.

Using e.g. a model created in Papyrus UML or IBM RSM you traverse your
ownedAttributes and checks if association !null.

texttransformation NewTrans(in uml:"http://www.eclipse.org/uml2/2.1.0/UML")
{
uml.Class::main () {
stdout.println("Class Name: " + self.name)
self.ownedAttribute->forEach(p:uml.Property | p.association!=null){
stdout.println("Navigable Association: " + p.name)
stdout.println("Navigable AssociationType: " + p.type.name)
}
}
}

on:
class_0
Class_1 ------------>Class_0

Gives output:
Class Name: Class_0
Class Name: Class_1
Navigable Association: class_0
Navigable AssociationType: Class_0


/G
Re: [MOFScript] Navigable Asociation [message #380362 is a reply to message #380334] Wed, 14 November 2007 08:47 Go to previous messageGo to next message
Eclipse User
Originally posted by: javjimgon.alum.us.es

Gøran K. Olsen escribió:
> Hello Javier,
>
> Considering UML.
>
> I have seen different implementations of this so it depends on how your
> model is created.
>
> Using e.g. a model created in Papyrus UML or IBM RSM you traverse your
> ownedAttributes and checks if association !null.
>
> texttransformation NewTrans(in uml:"http://www.eclipse.org/uml2/2.1.0/UML")
> {
> uml.Class::main () {
> stdout.println("Class Name: " + self.name)
> self.ownedAttribute->forEach(p:uml.Property | p.association!=null){
> stdout.println("Navigable Association: " + p.name)
> stdout.println("Navigable AssociationType: " + p.type.name)
> }
> }
> }
>
> on:
> class_0
> Class_1 ------------>Class_0
>
> Gives output:
> Class Name: Class_0
> Class Name: Class_1
> Navigable Association: class_0
> Navigable AssociationType: Class_0
>
>
> /Gøran
>
>
> "Javier Jimenez" <javjimgon@alum.us.es> wrote in message
> news:fgurvs$938$1@build.eclipse.org...
>> Hello,
>>
>> I would like to know when a end association isNavigable. On order to
>> generate an attribute only in the class which is in the navigable end of
>> the association.
>>
>> Thank you in advance!!
>> Javier Jimenez
>
>

Hello Gøran,

thanks for your answer. Finally it was a problem of the UML editor that
I use (Topcased). There is a bug and when you tick the 'isNavigable'
option in an association, you can not save the model.

Other question there is more documentation about MOFScript. I can only
find the user manual.

Thank you in advance!!

Javier Jimenez
Re: [MOFScript] Navigable Asociation [message #380364 is a reply to message #380362] Wed, 14 November 2007 14:08 Go to previous message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hi Javier,

The user manual and the built in help functionality Help->Help Contents->
MOFScript should cover the functionality that is available.
There are also some simple example transformations in the repository folder
of the MOFScript editor plugin.

Since MOFScript handles models based on EMF, when it comes to navigating the
different metamodels e.g. UML, you will have to consult the metamodel
specification.

/G
Re: [MOFScript] Navigable Asociation [message #608249 is a reply to message #380331] Fri, 09 November 2007 13:38 Go to previous message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hello Javier,

Considering UML.

I have seen different implementations of this so it depends on how your
model is created.

Using e.g. a model created in Papyrus UML or IBM RSM you traverse your
ownedAttributes and checks if association !null.

texttransformation NewTrans(in uml:"http://www.eclipse.org/uml2/2.1.0/UML")
{
uml.Class::main () {
stdout.println("Class Name: " + self.name)
self.ownedAttribute->forEach(p:uml.Property | p.association!=null){
stdout.println("Navigable Association: " + p.name)
stdout.println("Navigable AssociationType: " + p.type.name)
}
}
}

on:
class_0
Class_1 ------------>Class_0

Gives output:
Class Name: Class_0
Class Name: Class_1
Navigable Association: class_0
Navigable AssociationType: Class_0


/G
Re: [MOFScript] Navigable Asociation [message #608256 is a reply to message #380334] Wed, 14 November 2007 08:47 Go to previous message
Eclipse User
Originally posted by: javjimgon.alum.us.es

Gøran K. Olsen escribió:
> Hello Javier,
>
> Considering UML.
>
> I have seen different implementations of this so it depends on how your
> model is created.
>
> Using e.g. a model created in Papyrus UML or IBM RSM you traverse your
> ownedAttributes and checks if association !null.
>
> texttransformation NewTrans(in uml:"http://www.eclipse.org/uml2/2.1.0/UML")
> {
> uml.Class::main () {
> stdout.println("Class Name: " + self.name)
> self.ownedAttribute->forEach(p:uml.Property | p.association!=null){
> stdout.println("Navigable Association: " + p.name)
> stdout.println("Navigable AssociationType: " + p.type.name)
> }
> }
> }
>
> on:
> class_0
> Class_1 ------------>Class_0
>
> Gives output:
> Class Name: Class_0
> Class Name: Class_1
> Navigable Association: class_0
> Navigable AssociationType: Class_0
>
>
> /Gøran
>
>
> "Javier Jimenez" <javjimgon@alum.us.es> wrote in message
> news:fgurvs$938$1@build.eclipse.org...
>> Hello,
>>
>> I would like to know when a end association isNavigable. On order to
>> generate an attribute only in the class which is in the navigable end of
>> the association.
>>
>> Thank you in advance!!
>> Javier Jimenez
>
>

Hello Gøran,

thanks for your answer. Finally it was a problem of the UML editor that
I use (Topcased). There is a bug and when you tick the 'isNavigable'
option in an association, you can not save the model.

Other question there is more documentation about MOFScript. I can only
find the user manual.

Thank you in advance!!

Javier Jimenez
Re: [MOFScript] Navigable Asociation [message #608257 is a reply to message #380362] Wed, 14 November 2007 14:08 Go to previous message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hi Javier,

The user manual and the built in help functionality Help->Help Contents->
MOFScript should cover the functionality that is available.
There are also some simple example transformations in the repository folder
of the MOFScript editor plugin.

Since MOFScript handles models based on EMF, when it comes to navigating the
different metamodels e.g. UML, you will have to consult the metamodel
specification.

/G
Previous Topic:[Announce] The EclipseCon 2008 Submission Deadline is Rapidly Approaching.
Next Topic:[TCS]:beginning TCS with Eclipse
Goto Forum:
  


Current Time: Sat Oct 25 23:50:11 GMT 2014

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

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