Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Transition name from different states to the same state(Transition name from different states to the same state)
Transition name from different states to the same state [message #1800846] Wed, 09 January 2019 02:05 Go to next message
Selvaganesh Murugan is currently offline Selvaganesh MuruganFriend
Messages: 14
Registered: December 2018
Junior Member
While trying to use the same transition name ("ToState3") for transitioning from different states (State1, State2) to a single state (State3), I am getting a validation error about the names being indistinguishable (see attached picture).

Please clarify if this is a limitation in Papyrus-RT or is there a way to have the same transition name for transitioning to the same state?
Re: Transition name from different states to the same state [message #1800900 is a reply to message #1800846] Wed, 09 January 2019 14:16 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi,

This is the UML standard namespace constraint for distinguishable members: the transitions are members of the namespace that is the region containing them. See §7.8.10.7 of the UML 2.5.1 specification. This constraint is defined in terms of the membersAreDistinguishable() operation, which in turn depends on the NamedElement::isDistinguishableFrom(...) operation that is redefined by various kinds of NamedElement (for example, by BehavioralFeature §9.9.8.7 to distinguish by signature as well as by name). Transition (§14.5.11.7) and Region (§14.5.8.5) don't appear to override the operations that compute this constraint, so it looks like it is just required that all transitions in a region have different names.

However, it is up to an application (such as your model-to-model or model-to-text transformations) to interpret the significance of this constraint to its own needs.

HTH,

Christian
Re: Transition name from different states to the same state [message #1800930 is a reply to message #1800900] Wed, 09 January 2019 23:31 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
To add to Christian's answer, the problem is indeed that you have to transitions with the exact same name, in the same namespace, and this is problematic for the tool, the code generator and the user.

The code generator will generate functions corresponding to transitions based on their names, so that could result in functions with the same name, which may not compile. Well, the code generator actually uses the qualified name of the element, and for transitions it will use the names of the source and target states, but only if no name has been given to the transition, so giving them the same name will result in conflicting names in the generated code.

From the point of view of the user, it is also confusing. Usually transition names have the purpose of documentation. If you have two transitions with the same name, how can a user looking at the diagram distinguish them? They can be differentiated by their source, target and/or trigger, but a user that sees the same name will be left wondering what's different about them. From a design methodology point of view it would be recommendable to use a different name.
Re: Transition name from different states to the same state [message #1800932 is a reply to message #1800930] Thu, 10 January 2019 01:34 Go to previous message
Selvaganesh Murugan is currently offline Selvaganesh MuruganFriend
Messages: 14
Registered: December 2018
Junior Member
Thanks!
Previous Topic:Exit out of Composite State
Next Topic:Local transitions
Goto Forum:
  


Current Time: Thu Apr 25 13:44:18 GMT 2024

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

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

Back to the top