[MOFScript] How to express: if ( pseudostate.kind = uml.PseudostateKind(deepHistory) ) { ... } [message #379562] |
Thu, 30 August 2007 13:58  |
Eclipse User |
|
|
|
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 15:26  |
Eclipse User |
|
|
|
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 15:26  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.21416 seconds