Class: SkillVC

SkillVC

new SkillVC(config)

Creates an instance of SkillVC. Most uses of SkillVC are better instantiated by using one of the methods in SkillVCFactory. However, if none of those functions provide the functionality required, or if more customization of SkillVC is required, this constructor should be used. SkillVC, by default, requires the objects defined in SVContext#appConfig be set. However, if any of the SkillVC functions have been overridden, the functionality and required configuration would change.
Parameters:
Name Type Description
config SVContext.appConfig The configuration to initialized SkillVC with. As this configuration is made available throughout the execution of SkillVC it can also be used as a means to inject objects into SkillVC to be used by objects downstream.
Source:

Methods

getContext() → {SVContext}

Returns the current SkillVC context instance
Source:
Returns:
The SVContext of this instance of SkillVC
Type
SVContext

handler(event, context)

The handler() function should be invoked by the index.js of the skill to transfer control of the skill execution into SkillVC. Upon execution the SVContext.session and SVContext.callback will be reset to provide a clean execution state. The configured FilterChainExecutor~execute will be invoked
Parameters:
Name Type Description
event Object The Lambda event
context Object The Lambda context
Source:

init(event, context, initCallback) → {SkillVC}

Initializes SkillVC. This is only called once (unless SkillVC is dumped from memory and recreated). The execution series of SkillVC is as follows: * Clear the appSession * Place the lambda information (event, context) into the SVContext * Register the @{link ResponseManager} * Register the @{link SessionHandlerManager} * Register the @{link FilterManager} * Register the @{link IntentHandlerManager} * Record that init completed (so it doesn't fire ever again) * Call the initCallback.success function
Parameters:
Name Type Description
event Object The Lambda event
context Object The Lambda context
initCallback SkillVC~callback The callback used when initialization completes
Source:
Returns:
This instance of SkillVC for use in builder style calling
Type
SkillVC

registerFilterManager(svContext, callback)

Called when SkillVC is looking to register/load the FilterManager. By default this method uses the FilterManager specified by svContext.appConfig.filterManager Extending SkillVC and overriding this method will allow for a more customized approach
Parameters:
Name Type Description
svContext SVContext The svContext. As this is called during initialization, not all objects may be available in the context
callback SkillVC~callback The callback to use when registration has completed
Source:

registerIntentHandlerManager(svContext, callback)

Called when SkillVC is looking to register/load the IntentHandlerManager. By default this method uses the IntentHandlerManager specified by svContext.appConfig.intentHandlerManager. To have the IntentHandlerManager by part of the execution cycle the passed in IntentHandlerManager is wrapped by a IntentHandlerFilter. When creating an IntentHandler, if you specifiying an intent name of 'launch' it will cause the IntentHandler to be invoked on a @link{http://tinyurl.com/jpdl5cc|LaunchRequest} Extending SkillVC and overriding this method will allow for a more customized approach but will need to take into consideration that SkillVC requires a IntentHandlerFilter to actually execute
Parameters:
Name Type Description
svContext SVContext The svContext. As this is called during initialization, not all objects may be available in the context
callback SkillVC~callback The callback to use when registration has completed
Source:

registerResponseManager(svContext) → {ResponseManager}

Called when SkillVC is looking to register/load the ResponseManager. By default this method uses the ResponseManager specified by svContext.appConfig.responseManager. Extending SkillVC and overriding this method will allow for a more customized approach
Parameters:
Name Type Description
svContext SVContext The svContext. As this is called during initialization, not all objects may be available in the context
Source:
Returns:
The ResponseManager to use
Type
ResponseManager

registerSessionHandlerManager(svContext) → {SessionHandlerManager}

Called when SkillVC is looking to register/load the SessionHandlerManager. By default this method uses the SessionHandlerManager specified by svContext.appConfig.sessionHanlerManager. Extending SkillVC and overriding this method will allow for a more customized approach
Parameters:
Name Type Description
svContext SVContext The svContext. As this is called during initialization, not all objects may be available in the context
Source:
Returns:
The SessionHandlerManager to use
Type
SessionHandlerManager

Type Definitions

callback

Type:
  • Object.<string, function()>
Properties:
Name Type Description
success function
Properties
Name Type Description
result JSON The results of the successful registration
failure function
Properties
Name Type Description
error JSON The result of an unsuccessful registration
Source: