RE: Potential Bug in scxml Interpreter-Algorithm

Hello Tim,

  can you add simple SCXML document that demonstrates the bug.

Aleš

-----Original Message-----
From: Tim Langner [mailto:tim.langner@metralabs.com] 
Sent: Tuesday, June 05, 2012 1:36 PM
To: www-voice@w3.org
Subject: Potential Bug in scxml Interpreter-Algorithm

Hi,

I found a potential bug in the pseudo algorithm of the scxml interpreter.

In procedure
addStatesToEnter(state,root,statesToEnter,statesForDefaultEntry)

there is a if clause for history states:

if historyValue[state.id]:
   for s in historyValue[state.id]:
     addStatesToEnter(s,statesToEnter,statesForDefaultEntry)
       for anc in getProperAncestors(s,state):
         statesToEnter.add(anc)

However calling getProperAncestors(s,state) for state where state is a history state will collect all ancestors up to the scxml root element because history states have no childs. This results in leaving and entering all parent states (up to the scxml root) when going back into a history state.
I propose to fix this by calling:
getProperAncestors(s,state.parent):


Best Regards,
Tim Langner

--
MetraLabs GmbH
Neue Technologien und Systeme

Dipl.-Inf. Tim Langner
Software-Engineering

E-mail:	Tim.Langner@MetraLabs.com
Phone:	+49 - 36 77 - 667 431 32
Fax: 	+49 - 36 77 - 667 431 99

Internet: http://www.MetraLabs.com
Address: Am Vogelherd 22, D-98693 Ilmenau Trade register : Amtsgericht Jena, HRB 305694 Managing Director: Dr. Andreas Bley, Matthias Merten European VAT ID: DE214004108

This e-mail including the attached documents are confidential and may contain privileged information. The unauthorized use of such information is illegal. If you are not the intended recipient, please delete this Email and notify the sender. The content of the e-mail and its attachments are protected by copyright law.

Received on Wednesday, 6 June 2012 09:41:37 UTC