W3C home > Mailing lists > Public > www-voice@w3.org > October to December 2012

scxml Historic ancestor entry states

From: Carlos Verdes <cverdes@gmail.com>
Date: Tue, 13 Nov 2012 01:03:40 +0000
Message-ID: <CAMZOHDMF8+G=uqwRz1U3goTPRRTVKz7hDS-B3XML7kKJ34weuA@mail.gmail.com>
To: "www-voice@w3.org" <www-voice@w3.org>

I have seen in the entryStates the next code:

procedure addStatesToEnter(state,root,statesToEnter,statesForDefaultEntry)

    if isHistoryState(state):
        if historyValue[state.id]:
            for s in historyValue[state.id]:
                *for anc in getProperAncestors(s,state):

Taking in account the next state machine:

Where h is a historic state and the current configuration is s,s2,s22.
There are two transition, one from s-->r (so the state s22 is saved) and
the other r-->h

If I understood well the proper configuration should be again s,s2,s22
after the 2 transitions.

When we execute the previous snippet we will add first the state s22:


And after we need to add the proper ancestors, which I understand that are
s2 and s.
But, if we execute the highlighted code what we will obtain?


*h will be never an ancestor of a saved state, maybe a sibling or an "aunt"*

I think the getProperAncestors should be called with the grandparent of the
history state because the parent of the history state is the parent of the
saved state but is also a state to be entered, so if we want
getProperAncestors to return s2 and s we should change for:


Tell me what do you thing please.

Best regards,
Carlos Verdes.
Received on Tuesday, 13 November 2012 01:18:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:42 UTC