Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [MOFScript] How to express: if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) { ... }
[MOFScript] How to express: if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) { ... } [message #379562] Thu, 30 August 2007 17:58 Go to next message
Ondrej Rohlik is currently offline Ondrej Rohlik
Messages: 13
Registered: July 2009
Junior Member
Hello!

I am trying to query my UML model to find out whether a pseudostate in a
state machine is a deepHistory, shallowHistory, choice, or intial.

In UML metamodel there is PseudostateKind enumeration which contains
(among others) values deepHistory, shallowHistory, choice, or intial.

In UML metamodel there is a Pseudostate that has a "kind" of type
PseudostateKind.

Is there a way in MOFScript to write a condition like the one below?

uml.Region::getHistoryState() : uml.Pseudostate {
var pseudostate : uml.Pseudostate = self.getPseudostateFromRegion()
if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) {
stdout.println("Muhaha! The deepHistory found !")
result = pseudostate
}
}

The line in question is the third one.

Any hints welcome. Thanks you in advance.

Best regards,
Ondrej
Re: [MOFScript] How to express: if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) { ... } [message #379563 is a reply to message #379562] Thu, 30 August 2007 19:26 Go to previous message
Ondrej Rohlik is currently offline Ondrej Rohlik
Messages: 13
Registered: July 2009
Junior Member
Answer is as simple as:

if (st.kind = "deepHistory" ) { ... }



Ondrej Rohlik wrote:
>
> Hello!
>
> I am trying to query my UML model to find out whether a pseudostate in a
> state machine is a deepHistory, shallowHistory, choice, or intial.
>
> In UML metamodel there is PseudostateKind enumeration which contains
> (among others) values deepHistory, shallowHistory, choice, or intial.
>
> In UML metamodel there is a Pseudostate that has a "kind" of type
> PseudostateKind.
>
> Is there a way in MOFScript to write a condition like the one below?
>
> uml.Region::getHistoryState() : uml.Pseudostate {
> var pseudostate : uml.Pseudostate = self.getPseudostateFromRegion()
> if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) {
> stdout.println("Muhaha! The deepHistory found !")
> result = pseudostate
> }
> }
>
> The line in question is the third one.
>
> Any hints welcome. Thanks you in advance.
>
> Best regards,
> Ondrej
Re: [MOFScript] How to express: if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) { ... } [message #607070 is a reply to message #379562] Thu, 30 August 2007 19:26 Go to previous message
Ondrej Rohlik is currently offline Ondrej Rohlik
Messages: 13
Registered: July 2009
Junior Member
Answer is as simple as:

if (st.kind = "deepHistory" ) { ... }



Ondrej Rohlik wrote:
>
> Hello!
>
> I am trying to query my UML model to find out whether a pseudostate in a
> state machine is a deepHistory, shallowHistory, choice, or intial.
>
> In UML metamodel there is PseudostateKind enumeration which contains
> (among others) values deepHistory, shallowHistory, choice, or intial.
>
> In UML metamodel there is a Pseudostate that has a "kind" of type
> PseudostateKind.
>
> Is there a way in MOFScript to write a condition like the one below?
>
> uml.Region::getHistoryState() : uml.Pseudostate {
> var pseudostate : uml.Pseudostate = self.getPseudostateFromRegion()
> if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) {
> stdout.println("Muhaha! The deepHistory found !")
> result = pseudostate
> }
> }
>
> The line in question is the third one.
>
> Any hints welcome. Thanks you in advance.
>
> Best regards,
> Ondrej
Previous Topic:[MOFScript] How to express: if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) { ... }
Next Topic:[Announce][Epsilon] Prototype tool support for user-defined wizards in GMF-based editors
Goto Forum:
  


Current Time: Thu Oct 02 08:24:14 GMT 2014

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

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