Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSpecifying an action of a transition
https://www.eclipse.org/forums/index.php/mv/msg/485967/1052954/#msg_1052954
I want to specify an action for a transition of a state machine and I cannot figure out how to model it. I want to enter an expression as an action, for example "x=5". I found some diagrams, where exactly that was defined. Consider the "--key_count" operation in the following diagram
The "effect" attribute of a Transition can be a Behavior.
For example Activity and OpaqueBehavior are Behaviors.
I do not want to use Activity, because it is specified by an Operation or a Reception and not by an Expression.
I do not want to use OpaqueBehavior, because I do not want to stick to a specific language, but to abstract arithmetic expressions.
I would like to use org.eclipse.uml2.uml.Expression (a structured tree) or something similar instead.
]]>Simon Schwichtenberg2013-05-01T14:34:20-00:00Re: Specifying an action of a transition
https://www.eclipse.org/forums/index.php/mv/msg/485967/1052963/#msg_1052963
IMHO the UML Expression tree was a worthy historic attempt which OCL
demonstrated to be misguided. Expressions are much too interesting to
use a naive tree.
All expressions have an associated language. For instance Fortan gives
you **. Java gives you 32 bit silent wraparound. OCL is more
polymorphic, but still very specific once you get down to the details.
If you want naive expressions, it's probably easiest to use
OpaqueExpressions with an 'GoodGuyExpression' language for which you
will write a specification.
Regards
Ed Willink
On 01/05/2013 15:34, Goood Guy wrote:
> Hi,
>
> I want to specify an action for a transition of a state machine and I
> cannot figure out how to model it. I want to enter an expression as an
> action, for example "x=5". I found some diagrams, where exactly that
> was defined. Consider the "--key_count" operation in the following
> diagram
>
>
>
> Source:
> http://en.wikipedia.org/wiki/UML_state_machine#Actions_and_transitions
>
> The "effect" attribute of a Transition can be a Behavior.
> For example Activity and OpaqueBehavior are Behaviors.
>
> I do not want to use Activity, because it is specified by an Operation
> or a Reception and not by an Expression.
>
> I do not want to use OpaqueBehavior, because I do not want to stick to
> a specific language, but to abstract arithmetic expressions.
>
> I would like to use org.eclipse.uml2.uml.Expression (a structured
> tree) or something similar instead.
>
>]]>Ed Willink2013-05-01T15:29:24-00:00Re: Specifying an action of a transition
https://www.eclipse.org/forums/index.php/mv/msg/485967/1053454/#msg_1053454
You can use an OpaqueBehavior (with the effect behavior as a bunch of strings) or as a proper Activity. Don't worry about the Specification of a behavior. That is only used when a behavior is the method of an operation or reception. But behaviors can be used in other contexts as well, when the specification will not be set.