Skip to main content


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 14:34 Go to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
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 15:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
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 04:36 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
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 19 01:43:44 GMT 2024

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

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

Back to the top