mmir.state.ManagerFactory
Factory for creating state manager, e.g. InputerManger and DialogManager instances.
Example
//initialization of a custom state manager/engine
var manager = require('mmirf/managerFactory')();
manager.init('mmirf/someStateManager', {modelUri: 'path/to/scxml/file'}, true).then(function(initResult){
var theEngine = initResult.engine;
var theManager = initResult.manager;
//do something ...
});
Requires
- module:mmir.require
- module:mmir._define
Methods
-
init(moduleId, modConf, isRegisterEngine){Deferred}
-
Name Type Description moduleId
String modConf
Object the module configuration with { modelUri: String, mode: "extended" | simple, engineId: String //OPTIONAL logLevel: Number | LogLevel //OPTIONAL }
isRegisterEngine
Boolean optional if the created state-machine should be registered with the moduleId
, so that it will be available viammir.require(moduleId)
Returns:
Type Description Deferred a promise that will be resolved with {manager:
, engine: } -
raise(eventName, eventData)
-
This function raises an event.
Name Type Description eventName
String The name of the event which is to be raised eventData
Object optional OPTIONAL Data belonging to the event Throws:
-
if this function is invoked while the internal event/state engine (i.e.
mmir.InputEngine
is not initialized yet - Type
- Error
-