Closed withinboredom closed 8 years ago
Example:
// create machine const task = new state.StateMachine('task'); // create psuedo states const initial = new state.PseudoState('initial', task, state.PseudoStateKind.Initial); const success = new state.PseudoState('success', task, state.PseudoStateKind.Terminate); const failure = new state.PseudoState('failure', task, state.PseudoStateKind.Terminate); // create states const parsed = new state.State('parsed', task) .entry((message, instance) => { console.log('parsed'); instance.parsed = false; }) .exit((message) => console.log('leaving parse')); const failParse = new state.State('parseFailed', task) .entry(() => { console.log('failed to parse') }); // create transitions parsed.to(failParse).when((message, instance) => instance.parsed == false); failParse.to(failure); // initialize all the things const instance = new state.StateMachineInstance("instance"); state.initialise(task, instance); state.evaluate(task, instance); // output the results console.log(instance.getCurrent(task.getDefaultRegion()).name);
I'd expect the name of the current state to be failure... however, I'm getting the name failParse though I see it in the output:
failure
failParse
instance enter task.default.failure
Am I doing something wrong or is this an actual bug?
:facepalm: The state machine does not exit any states ... read the uml spec again ...
The state machine does not exit any states
Example:
I'd expect the name of the current state to be
failure
... however, I'm getting the namefailParse
though I see it in the output:Am I doing something wrong or is this an actual bug?