Uploaded image for project: 'Commons SCXML'
  1. Commons SCXML
  2. SCXML-205

finalStep gets called twice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0
    • None
    • None

    Description

      In the current trunk version, finalStep and hence all onexit actions of the final state are called twice. The following scxml can be used to reproduce the problem.

      <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="Start" name="PublishEvent">
        <final id="Start">
          <onentry>
            <log expr="'Entering state Start'"></log>
          </onentry>
          <onexit>
            <log expr="'Leaving state Start'"></log>
          </onexit>
        </final>
      </scxml>
      

      The onexit log message appears twice when running this example.

      I digged a bit in the source code and through a debugger I could find the cause for this effect: The finalStep method of SCXMLSemanticsImpl gets called twice. One backtrace looks like this:

      SCXMLSemanticsImpl.finalStep(SCXMLExecutionContext) line: 215	
      SCXMLSemanticsImpl.firstStep(SCXMLExecutionContext) line: 132	
      SCXMLExecutor.reset() line: 331	
      SCXMLExecutor.go() line: 318	
      

      and the seconds looks like this:

      SCXMLSemanticsImpl.finalStep(SCXMLExecutionContext) line: 215	
      SCXMLExecutor.reset() line: 334	
      SCXMLExecutor.go() line: 318	
      

      I am not sure about what should be the correct behavior, but to my mind, the second call looks suspicious.

      Attachments

        Activity

          People

            ate Ate Douma
            languitar Johannes Wienke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: