Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » 'internal' vs 'local' transitions
'internal' vs 'local' transitions [message #1777014] Thu, 23 November 2017 15:35 Go to next message
Juergen Dingel is currently offline Juergen DingelFriend
Messages: 42
Registered: January 2015
Member
Good morning,

the 'Properties' view of a transition contains buttons for 'internal', 'local', and 'external' kinds.

Assuming the transition is inside a composite state s, my understanding is that a 'local' transition t
- has s as source and target (i.e., it is a self transition), and
- does not leave s, i.e., entry/exit of s are not executed, and
- can be taken from any (direct) substate in s (since its source is a composite state), and
- upon completion, reactivates the substate that was active right before t was taken (i.e., implicit return to (deep) history).

What is an 'internal' transition?

As usual, 'thank you'!

Juergen
Re: 'internal' vs 'local' transitions [message #1777015 is a reply to message #1777014] Thu, 23 November 2017 15:41 Go to previous messageGo to next message
Juergen Dingel is currently offline Juergen DingelFriend
Messages: 42
Registered: January 2015
Member
Perhaps I can answer my own question.

Is an 'internal' transition a transition just like a 'local' (see above), except that it leads to a (direct) substate of s, i.e.,
after the transition is taken, the targetted substate becomes active and we do not 'return to history'?

Juergen
Re: 'internal' vs 'local' transitions [message #1777027 is a reply to message #1777014] Thu, 23 November 2017 16:34 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
I think you have it backwards. What you are calling 'local' is internal and viceversa. From the UML 2.5 spec (formal-15-03-01, p. 312) [1]

Quote:

Transition kinds relative to source

The semantics of a Transition depend on its relationship to its source Vertex. Three different possibilities are defined, depending on the value of the Transition's kind attribute:

  • kind = external means that the Transition exits its source Vertex. If the Vertex is a State, then executing this Transition will result in the execution of any associated exit Behavior of that State.
  • kind = local is the opposite of external, meaning that the Transition does not exit its containing State (and, hence, the exit Behavior of the containing State will not be executed). However, for local Transitions the target Vertex must be different from its source Vertex. A local Transition can only exist within a composite State.
  • kind = internal is a special case of a local Transition that is a self-transition (i.e., with the same source and target States), such that the State is never exited (and, thus, not re-entered), which means that no exit or entry Behaviors are executed when this Transition is executed. This kind of Transition can only be defined if the source Vertex is a State.



[1] http://www.omg.org/spec/UML/2.5/

[Updated on: Thu, 23 November 2017 16:45]

Report message to a moderator

Re: 'internal' vs 'local' transitions [message #1777035 is a reply to message #1777027] Thu, 23 November 2017 20:06 Go to previous messageGo to next message
Juergen Dingel is currently offline Juergen DingelFriend
Messages: 42
Registered: January 2015
Member
Thanks (I guess I could have looked that up in the UML spec, too. Sorry about that)

Juergen
Re: 'internal' vs 'local' transitions [message #1777037 is a reply to message #1777035] Thu, 23 November 2017 20:15 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
No problem. The UML spec is a large document (it was even larger pre 2.5), but I am now quite used to looking up things there. And in any case questions like this are OK, because not all UML-RT concepts are UML concepts and it is not obvious which concepts are inherited from UML and which are new.

Re: 'internal' vs 'local' transitions [message #1777056 is a reply to message #1777037] Fri, 24 November 2017 07:51 Go to previous messageGo to next message
Peter Cigehn is currently offline Peter CigehnFriend
Messages: 49
Registered: September 2014
Member
Hi,

Another important aspect I would say is that an 'internal' transition, compared to 'local' and 'external' transitions, is that that it is not visualized as an edge in the diagram. An 'internal' transition is only shown in the internal transitions compartment of the composite state.

So when it comes to the special case of self-transitions for a composite state you have external self-transitons shown as edges on the "outside" of the composite state, you have internal self-transitions shown as edges on the "inside" of the composite state, and you have internal transitions shown in the internal transitions compartment (both on the "inside" and "outside") of the composite state.

So in practice there is a recommendation to use internal self-transitions instead of local self-transitions, as well as external self-transitions in the case the composite state does not have any entry or exit code, to reduce graphical "clutter".

/Peter Cigéhn

PS. The compartment for internal transitions on the "inside" of a composite state is unfortunately shown inside the state frame itself, which can cause issues in case you have entry and exit points on the bottom border of the state frame. The idea is to have the internal transitions shown in a "compartment" outside and below the state frame itself. See bug 511471 tracking an improvement in this area. DS.
Re: 'internal' vs 'local' transitions [message #1826958 is a reply to message #1777027] Tue, 05 May 2020 10:49 Go to previous messageGo to next message
Pieter Jan Bleichrodt is currently offline Pieter Jan BleichrodtFriend
Messages: 1
Registered: May 2020
Junior Member
I'm sorry for asking, but i'm trying to understand the difference between local and internal.
Isn't it so that an internal transition is a local transition viewed from a higher nesting level ?
Thanks for answering!
Re: 'internal' vs 'local' transitions [message #1826975 is a reply to message #1826958] Tue, 05 May 2020 14:38 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
No need to be sorry. You are allowed to ask. That's what the forums are for!

The difference comes from UML itself. See Message 1777027 in this thread.

An internal transition is just a special case of a local transition, one which is a "loop", i.e. a transition from a state to itself that does not exit the state.

For example, suppose there is a state machine with two states: S1 and S2. Furthermore, S1 is a composite state with substates S11 and S12. Suppose also that you have the following transitions:

- transition t1 from S1 to S2,
- transition t2 from S11 to S12,
- transition t3 from the boundary of S1 to S11,
- transition t4 from the boundary of S1 to itself, but inside S1 (that is, t4 is owned by S1), and
- transition t5 from the boundary of S1 to itself, but outside S1 (that is, t5 is owned by the top-level state machine, the container of S1)

Then, according to the UML 2.5 spec:
- t1 is external (to S1)
- t2 is external (to S11)
- t3 is local (to S1)
- t4 is internal (to S1)
- t5 is external (to S1)

In terms of syntax, the difference between t4 and t5 is the owner of the transition.

In terms of semantics, the difference between t4 and t5 is that if t5 is triggered, the machine exists S1, which means that it first exists whichever internal state of S1 was active (recursively) and S1's exit action is executed. Then the transition's action is executed, then S1's entry action, and then it goes to history, i.e. it enters the last active substate. On the other hand, if t4 is triggered, the machine exists from currently active substate of S1, but it does *not* exit S1. It's transition action is executed and then it goes to history (enters the last active substate) without executing S1's entry action.

A local transition such as t3 is like an internal one but instead of going to the boundary of the state, it goes to a substate directly. So while an internal transition, if triggered, goes to history, i.e. the last active substate, a local transition goes directly to a specific state, rather than history.

Previous Topic:Cannot open Papyrus model in eclipse model explorer
Next Topic:Multiplicity of a part with a relay port
Goto Forum:
  


Current Time: Thu Apr 25 06:31:07 GMT 2024

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

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

Back to the top