Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [papyrus-rt-dev] State machine inheritance

Hi,

Some comments inline below.

/Peter Cigéhn

On 5 March 2017 at 22:17, Bran Selic <selic@xxxxxxx> wrote:


On Mon, Feb 27, 2017 at 3:07 AM, Peter Cigéhn <peter.cigehn@xxxxxxxxx> wrote:
Hi,

Some comments inline below.

/Peter Cigéhn

On 27 February 2017 at 04:03, charles+zeligsoft.com <charles@xxxxxxxxxxxxx> wrote:
I’ve been using: http://download.eclipse.org/papyrus-rt/updates/nightly/neon/ for the nightly builds - others will correct me if wrong…

/Charles

​Regarding the latest nightly, I suggest to base it on the tester setup, i.e. follow the instructions on the Tester wiki page regarding installing with the Oomph papyrus-rt-tester.setup file. Then all needed update sites will be ensured automatically. But yes, that .setup-file uses the http://download.eclipse.org/papyrus-rt/updates/nightly/neon/ repo for the nightly builds (along with a bunch of other repos).

[bvs] I did my best to follow the process described therein. It turned out to be anything but simple, and I am still unsure whether I got the right image. For one, it required a new Java VM (release 8), and I had to remind myself how to get a copy of that. Once I got that done, (I think) I followed the instructions carefully (although some of the screen shots did not match what I was getting), and, somehow, ended up with a Mars version of Papyrus RT. After some more fumbling around, I think I managed to get a proper Neon version, but I am not sure. For example, the version I am using does not allow me to create transitions using the drag handles (or whateer they are called) nor could I create parts using elements form the palette. Also, system SAPs could only be created by dragging appropriate protocols from the ​model explorer (as opposed to using the port tool from the tool palette). So, I have the uneasy feeling that what I have is not what you folks have.

[bvs] Once again, I must rail against the complexity of getting a valid copy of Papyrus RT. It is never simple and I am never sure of the results. This has got to be fixed.

​Yes, getting a tester version of Papyrus-RT ​for the nightly build is hard (I actually argued at one point that it could be made simpler, e.g. that it should be possible to use the simple mode for the Eclipse Installat, and not required to use the advanced mode, but others have argued that since it is only experienced tester that ever should use this installation, it is "allowed" to be more complex).  

And yes, from your description, it does not sound like you have gotten the right thing installed (the diagram assistant handles should work for creating transitions, SAPs based on system protocol should be possible to be selected directly on the popup menu both when use the new child menu in the model explorer as well as the port tool from the palette in the capsuel structure diagram, in case you have a model with the C++ language set, e.g. by creating a model based on the "UML-RT for C++" template). When checking Help > Installation Details you should have something like this installed:

Inline images 2

The versions for the Papyrus-RT should be reasonable late, i.e. from today (or yesterday) when you have installed.

The core essence regarding the installation of the tester version is that it is the https://www.eclipse.org/papyrus-rt/content/setup/papyrus-rt-tester.setup that is used in the Eclipse Installer. Did you use this a the "Resource URI" when configuring the .setup file in the Eclipse Installer?

Getting a end-user installation for a released version of Papyrus-RT should be much more smooth though.
 



On 2017-02-26, at 16:20 , Bran Selic <selic@xxxxxxx> wrote:

Hi Peter,

Sorry for the late reply, but I was on a business trip all of last week. Also, I didn't notice that my preious responses to you did not get to the papyrus-rt discussion list, since I don't have the right privileges (will register for it later). So, I have explicitly copied Ernesto, Charles, and Christian on this reply, since they were interested in the discussion.

On Thu, Feb 23, 2017 at 7:08 AM, Peter Cigéhn <peter.cigehn@xxxxxxxxx> wrote:
Hi Bran,

Okay, if you haven't seen the video, then start with that. Christian have published three videos so far:


​[bvs] I have no seen the videos (thanks for pointing me to them). I have two comments:

(1) I still think that it should not be required of the modeler to explicitly create a new state machine on a capsule that is a subclass of a capsule that alread​y has a state machine. Instead, this should be done automatically when the modeler decides to make a change to the inherited state machine. (I realize that there are some practical issues with how this is to be done, but I will leave that discussion for later, if we decide to have it.)
​I think it is rather crucial that we understand this about "automatically when the modeler decides to make a change to the inherited state machine".​ Yes, there are practical issues around this (depending on what you mean with it). I feel that we *first* need to understand what this means, before deciding if we shall have it. Not the other way around. Too me this statement is far too abstract and I cannot spin my head around what it would mean in practice.

​[bvs] Fair enough. Let me be clearer: Let's say I create a subclass of a capsule class. At that point, it inherits all the members of the namespace of the parent capsule, including its classifier behavior state machine. If I now I decide to view the state machine that I inherited, the following should happen: A redefining state machine should be created, automatically, and a new state machine diagam should appear for this state machine with the inherited bits​
 
​shown according to the standard convention for inherited bits. ​One tool-specific issue is: how do I open up the new state machine if one does not yet exist? I can think of at least two different ways that this could be done, but I will leave that for a separate discussion.

​But it is these two different ways that I want to understand what you mean. Further down you say that it that one option is to automatically create a redefining state machine when the generalization is created. Should I interpret that this is one of these two different ways? What is then the other? 

But, I woudl say that in the vast majority of cases, when you subclass a capsule class that has a classifier behavior state machine, in practically all cases, you will want to modify the inherited state machine. So, one option is to automatically create a redefining state machine when the generalization to the parent is created.

​From your earlier comments, I must then have misunderstood you completely. I thought that you did not like this automatic creation of a redefining state machine, already when the generalization was created (in the corresponding way as it is done in the legacy tooling). But if we can agree on that this is something that we actually want, then a lot of things becomes so much easier. Good to see that we actually agree here.​
 


I also feel that this is vert much related to one of my later follow ups: 

I just realized, that one aspect that needs to be considered (since Ernesto want the semantic to be clear), and that is when classifierBehavior of the subclass capsule is assigned. As can be seen from my screen shot below, the classifierBehavior is not set for Capsule2, in the situation when it only have inherited the state-machine (via inheritedMember). But to be able to assign classifierBehavior the capsule needs an ownedBehavior (since classifierBehavior is a subset of ownedBehavior), i.e. it is not until you actually have created the redefining state-machine in the subclass capsule that you can assign its classiferBehavior.
So if we are going to be "strict" with the definition of classifierBehavior, you always need to create the redefining state-machine in the subclass, to semantically state that it has a classifierBehavior.

I am not sure about how strict we shall be about classifierBehavior being assigned in the subclass or not, but if I understand all this correctly, then we *must* create on owned redefining state machine in the subclass to be able to assign its classifierBehavior. Then I would assume that we should automatically create the redefining state-machine already when the generalization is established, i.e. the user should not have to explicitly create a state-machine as a next step (as shown in Christian's video), and then also assign classifierBehavior for the subclass, directly when the generalization is established.

​​
[bvs] That is one possibility (see my response above).
 

(2) it is stated in one of the videos that pseudostates are not redefinable/excludable, which is not true for UML-RT models (by the way, there is an issue before the OMG requiring that all state machine Vertices be made kinds of redefinable elements). I wrote a section on this point in the UML-RT profile document (section 3.1.3). Is there some reason why this capability is not supported in current Papyrus RT?
​I think that we have some confusion here. A long time ago we had lots of discussion around this how we should handle redefinition/exclusion and how to handle this about pseudostate not being redefinable in UML. My understanding of the conclusions from those discussions was that, yes, and issue should be raised with OMG (which you have done). We also discussed whether a new redefinition/exlucision mechanism should be introduced (you proposed a completely new profile with a very generic redefinition/exclusion mechanism, replacing the use of the RTRedefinedElement stereotype).

​[bvs] I may be "mis-remembering", but the mechanism I introduced was copied from the mechanism used in RSA RTE. So, it was not new.​

Yes, the mechanism was copied from the legacy tooling, so it is not new. *But* the mechanism is *only* used for excluding a trigger in the legacy tooling, and nothing else​. And since we did not introduce a new mechanism, it just feels strange to take a mechanism that is a special case of defining a trigger guard (with a "hard-coded" Literal-false, instead of an Opaque _expression_) for also excluding other non-redefinable elements, like pseudo-states.

 
 
But in the end we decided that Papyrus-RT should not introduce any any new redefinition/exclusion mechanism, but instead do how the legacy tooling were doing for non-redefinable elements, e.g. the constraint with a literal-false specificaton for handling exclusion of triggers. But keep in mind that the constraint with literal-false is *only* used for triggers (it actually fits in exactly with how trigger guards work, the only difference is that a trigger guard with a false-literal can be "evaluated" during code-generation and thus be seen as an exclusion, whereas a trigger guard specified by an opaque _expression_ needs to be "deferred" to run-time to be evaluated).

​​
[bvs] You may be right about the compatibility of the mechanism with how guards work, but this is mere
​​
serendipitious coincidence. It does not change the fact that this is a kludge to work around a UML limitation.

​Well, I am not really sure that is a ​"​serendipitious coincidence". Yes, it is a kludge to work arund a UML limitation that triggers are not redefinable, and thus not possible to exclude. Keep in mind also that this mechanism is *only* used for *excluding* triggers. The trigger itself is still non-redefinable, and the only way to "redefine" a trigger is to first exclude it, and then add a new (local) trigger exactly as examplified in Figure 4 in the UML-RT profile document.

Keep in mind also that we have decided that such a Constraint element, with a Literfal-false specificaiton, should have the RTGuard stereotype applied.

How should a Constraint with a Literal-false specification be stereotyped when it is going to be used to exclude pseud-states? It can't have the RTGuard stereotype obviously, since it is not a (trigger) guard.

 

The constraint with literal-false specification is not being used for pseudostates in the legacy tooling. Yes, the UML-RT profile document mentions pseudo-states in this paragraph, but for me this is an oversight. If I would have paid closer attention when reviewing I would have commented on that this special construct is only used for excluding triggers. I and Christian had some discussions about this bug 511060 and we then actually asked you for a clarification of this about a month ago. And then you did agree on that we should not introduce exclusion for pseudostate:

​​
[bvs] I am not sure what I agreed with (apologies), but it may have been driven by practical considerations as opposed to theoretical ones. This is why we decided to fix UML so that the redefinable elements are all vertices and not just Regions, States, and Transitions.

​Yes, we decided to try to fix it UML with the issue you raised to OMG. But we also decided in the short term to not introduce any new mechanisms for redefinition/exclusion in Papyrus-RT and only use what the legacy tooling had. And legacy tooling only had a mechanism for excluding triggers (which is just a special case of adding a local guard ​to an inherited trigger)..
 
 

Thanks, Peter. I no longer recall, but my guess is that I added pseudostates in that list based on an assumption, as opposed to a concrete use case. On first thought, I cannot think of a use case for excluding psuedostates. And, considering that the capability was not missed by Ericsson, it is probably best to avoid it.

​So I really think that we should stick to this, i.e. we do not introduce a new mechanism for excluding pseudostates and align with legacy.

​​
[bvs] I see that as an implementation-specific decision. Remember that, in the future editions of UML, pseudostates will be redefinable.

Yes, completely agree that it is an implementation-specific decision. ​Yes, both pseudo-states, and then also triggers, should be redefinable in future version of UML. And then we can adopt using standard UML, and we can get rid of the Constraint with Literal-false specification, and replace it with standard UML support for excluding triggers. But I don't see that we should spend development and testing time on this in the short term, and introduce exclusion of pseudo-states using a "kludge" from the legacy tooling that was never used for excluding pseudo-states.

This is just my personal opinion. I think that I will have to rest my case here. I still think that having the implicit exclusion in the legacy tooling (as described below) is "good enough" for now. If there is an absolute need for *explicitly* excluding also pseudo-states, then we at least should think through if we need some additional stereotype or similar to formally identify these Constraints with Literal-false specifications being used for excluding pseudo-states (in a similar way as we identify them as excluding triggers using the RTGuard stereotype).

 ​
 

What the legacy tooling do support however is the implicit exclusion of pseudostates, i.e. if all incoming/outgoing transitions of a pseudostate is excluded, leaving a "dangling" pseudostate, then the pseudostate itself is graphically hidden from the subclass diagram, i.e. from an end-user perspective you achieve the "exclusion" anyway (at least from a graphical point of view and reducing "clutter" in the subclass diagram). I think that this is "good enough" when it comes to excluding pseudostates.
Cheers... Bran
 


Back to the top