[
https://issues.apache.org/jira/browse/SCXML-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662798#action_12662798
]
Mike Tillberg commented on SCXML-105:
-------------------------------------
That would work for the test case, it wouldn't be sufficient if there are
parallel states. Although it may be possible to look at Action.getParent to
see if it's an OnEntry and compare the current state against
getParentTransitionTarget to derive the real current state. Would it make
sense to change:
semantics.executeActions();
updateStatus(step);
to
semantics.executeExitActions();
semantics.executeTransitionActions();
try {
updateStatus(step);
semantics.executeEntryActions();
} catch (ModelException me) {
restoreStatus(step); // using step's beforestatus
throw me;
}
updateStatus changes both the current state list and event list, so it may
make sense to split that as well to prevent recalculating the ancestor closure.
> Current status updated after onentry is called
> ----------------------------------------------
>
> Key: SCXML-105
> URL: https://issues.apache.org/jira/browse/SCXML-105
> Project: Commons SCXML
> Issue Type: Bug
> Affects Versions: 0.9
> Reporter: Mike Tillberg
> Priority: Minor
> Fix For: 0.10
>
> Attachments: custom-state-01.xml, CustomActionTest.patch,
> GetStateAction.java
>
>
> When retrieving the current state using a custom action in the onentry
> section of a state, the state is incorrect. The state retrieved is the
> previous state. The problem appears to be in SCXMLExecutor.triggerEvents,
> where updateStatus() is called after semantics.executeActions(). Adding an
> additional updateStatus() before executeActions() seems to fix the problem,
> and all tests still pass.
> Attached is a test case showing the problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.