Skip to main content



      Home
Home » Archived » GMT (Generative Modeling Technologies) » [MOFScript] Navigable Asociation
[MOFScript] Navigable Asociation [message #380331] Thu, 08 November 2007 06:30 Go to next message
Eclipse UserFriend
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 08:38 Go to previous messageGo to next message
Eclipse UserFriend
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 03:47 Go to previous messageGo to next message
Eclipse UserFriend
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 09:08 Go to previous message
Eclipse UserFriend
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 08:38 Go to previous message
Eclipse UserFriend
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 03:47 Go to previous message
Eclipse UserFriend
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 09:08 Go to previous message
Eclipse UserFriend
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: Wed Jul 02 19:07:01 EDT 2025

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

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

Back to the top