Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MOFScript » MOFScript and UML State machines
MOFScript and UML State machines [message #494798] Mon, 02 November 2009 16:52 Go to next message
ASN  is currently offline ASN
Messages: 6
Registered: November 2009
Junior Member
Hello,

I am using MOFScript to parse an UML model of a State Machine. I have been able to do it without major complications but for some reason I cannot access the "Trigger"s in the state transitions.

I can access other (I do not how to call them) elements in the transition such as "effect" and "guard". To get the Trigger I have tried many transformations without any success.

I am not sure if this is important but if in a transition I do a:
self.ownedElement.size()

I get only 2 (guard, effect) elements instead of 3 (guard, effect and trigger).

I am not UML savy, so probably I am doing a very silly mistake. Any ideas?

thanks,
Arturo S.
Re: MOFScript and UML State machines [message #495576 is a reply to message #494798] Thu, 05 November 2009 11:53 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 Arturo,

Does the following transformation?

uml.Transition::test(){
self.trigger->forEach(trigg:uml.Trigger){
trigg.triggerTest()
}
}
uml.Trigger::triggerTest(){
self.name
}

Cheers,
G
Re: MOFScript and UML State machines [message #495930 is a reply to message #495576] Fri, 06 November 2009 16:52 Go to previous messageGo to next message
ASN  is currently offline ASN
Messages: 6
Registered: November 2009
Junior Member
Hi,

Yes, it worked. It seems that I was doing something wrong when generating the diagram to UML2 (well, I think that was the reason) or in the previous version of my code.

Initially I tried the code you sent and it did not work. Then I did some changes in my translation script and in the diagram and it worked.

Thanks!
-as
Re: MOFScript and UML State machines [message #495931 is a reply to message #495576] Fri, 06 November 2009 16:54 Go to previous messageGo to next message
ASN  is currently offline ASN
Messages: 6
Registered: November 2009
Junior Member
Hi,

Yes, it worked. It seems that I was doing something wrong when generating the diagram to UML2 (well, I think that was the reason) or in the previous version of my code.

Initially I tried the code you sent and it did not work. Then I did some changes in my translation script and in the diagram and it worked.

Thanks!
-as
Re: MOFScript and UML State machines [message #580161 is a reply to message #495576] Fri, 06 November 2009 16:54 Go to previous messageGo to next message
ASN  is currently offline ASN
Messages: 6
Registered: November 2009
Junior Member
Hi,

Yes, it worked. It seems that I was doing something wrong when generating the diagram to UML2 (well, I think that was the reason) or in the previous version of my code.

Initially I tried the code you sent and it did not work. Then I did some changes in my translation script and in the diagram and it worked.

Thanks!
-as
Re: MOFScript and UML State machines [message #580180 is a reply to message #495576] Fri, 06 November 2009 16:54 Go to previous message
ASN  is currently offline ASN
Messages: 6
Registered: November 2009
Junior Member
Hi,

Yes, it worked. It seems that I was doing something wrong when generating the diagram to UML2 (well, I think that was the reason) or in the previous version of my code.

Initially I tried the code you sent and it did not work. Then I did some changes in my translation script and in the diagram and it worked.

Thanks!
-as
Previous Topic:MOFScript and UML State machines
Next Topic:Find the Target for a message
Goto Forum:
  


Current Time: Tue Sep 23 16:29:04 GMT 2014

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

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