Rank: Newbie
Joined: 4/25/2016 Posts: 1 Location: Waalre
|
I use the onEntry function at many (composite) states and observed that these functions are all executed when an initial state has a connection to such a (composite) state. This item has already been discussed: https://www.altova.com/forum/default.aspx?g=posts&t=1203
So, to workaround this unwanted feature, I changed the onEntry function to a "do / function()" . However, also this do-function() is executed when the first trigger causes an Initialize(). In the generated code the do-function() is indeed called in a generated snippet: public override void entryState() { my-do-function }
So, this is fairly illogical : a "do" has nothing to do with initialization.
Is there a way to still use the do function as intended, or must we workaround around this bug in the same way as the mentioned onEntry discussion ?
|
Rank: Advanced Member
Joined: 9/28/2005 Posts: 371 Location: Vienna
|
Hi Tis!
According to the UML specification:
Quote:doActivity: Behavior[0..1] An optional behavior that is executed while being in the state. The execution starts when this state is entered, and stops either by itself or when the state is exited whichever comes first. {Subsets Element::ownedElement} => directly after handling "onEntry", "do" is executed. There is no hidden "inbetween substate" to handle the first but not the second one.
So if you are unhappy with the UML specification, you might have to use one of the discussed workarounds.
|