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

Bug identified for history states when using self-transitions #45

Open
Bab64 opened this issue Apr 4, 2017 · 0 comments
Open

Bug identified for history states when using self-transitions #45

Bab64 opened this issue Apr 4, 2017 · 0 comments

Comments

@Bab64
Copy link

Bab64 commented Apr 4, 2017

var sm = new scion.Statechart({
states: [
{
id: 'A',
transitions: [
{
event: 't2',
target: ‘A’ // Using 'History' here has same effect...
}
],
states: [
{
id: 'History',
$type: 'history',
isDeep: true,
transitions: [
{
target: 'A1'
}
]
},
{
id: 'A1',
transitions: [
{
event: 't1',
target: 'A22'
}
]
},
{
id: 'A2',
states: [
{
id: 'A21'
},
{
id: 'A22'
}
]
}
]
}
]
});

sm.start();
alert('Current: ' + sm.getConfiguration()[0]); // A1
sm.gen('t1');
alert('Current: ' + sm.getConfiguration()[0]); // A22
sm.gen('t2'); // Self-transition
alert('Current: ' + sm.getConfiguration()[0]); // A22 expected but A1 is displayed, why?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant