Skip to content
This repository was archived by the owner on Sep 25, 2018. It is now read-only.
This repository was archived by the owner on Sep 25, 2018. It is now read-only.

bug history state (again?) #55

@Bab64

Description

@Bab64

The state machine below does not work. We may however note that the bug is only present at the first time we re-enter A via a self-transition. The second time and next times, the state machine remembers well the prior active substate...

var sm = new scion.Statechart({
states: [
{
id: 'A',
transitions: [
{
event: 'x',
target: 'A'
}
],
states: [
{
id: 'H',
$type: 'history',
transitions: [
{
target: 'A1'
}
]
},
{
id: 'A1',
transitions: [
{
event: 'y',
target: 'A2'
}
]
},
{
id: 'A2'
}
]
}
]
});

sm.start();
//alert('Current: ' + sm.getConfiguration()[0]); // A1 -> OK
sm.gen('y');
//alert('Current: ' + sm.getConfiguration()[0]); // A2 -> OK
sm.gen('x'); // Self-transition
alert('Current (BUG): ' + sm.getConfiguration()[0]); // A2 expected but A1, why?
sm.gen('x'); // Self-transition
alert('Current: ' + sm.getConfiguration()[0]); // A2! This works the second time only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions