IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

do function at state machine initialize Options · View
Tis
Posted: Monday, April 25, 2016 11:01:39 AM
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 ?
cor
Posted: Thursday, April 28, 2016 6:43:16 AM
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.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.