Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Specifying an action of a transition
Specifying an action of a transition [message #1052954] Wed, 01 May 2013 10:34 Go to next message
Goood Guy is currently offline Goood Guy
Messages: 124
Registered: September 2011
Senior Member
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

http://upload.wikimedia.org/wikipedia/en/thumb/c/c1/UML_state_machine_Fig2.png/660px-UML_state_machine_Fig2.png

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.

Re: Specifying an action of a transition [message #1052963 is a reply to message #1052954] Wed, 01 May 2013 11:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3843
Registered: July 2009
Senior Member
Hi

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.
>
>
Re: Specifying an action of a transition [message #1053454 is a reply to message #1052954] Mon, 06 May 2013 00:36 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Those are not actually expressions as expressions are not meant for side effects. Those are indeed behaviors.

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.

Cheers,

Rafael
http://abstratt.com/blog
Previous Topic:isAttribute always returns false
Next Topic:How to identify Exclusive and combined Enumeration in UML2.
Goto Forum:
  


Current Time: Fri Apr 18 06:35:28 EDT 2014

Powered by FUDForum. Page generated in 0.01724 seconds