|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.speakright.core.FlowBase
org.speakright.core.flows.BasicFlow
org.speakright.core.flows.SRApp
public class SRApp
The base class for the outermost "app" flow object. It is the application, and it creates sub-flows that make up the callflow. Sub-flows can of course create their own sub-flows, creating a tree of flow objects with the "app" flow object at the root of the tree. Flow objects share data using a model, which is a field named M in each flow object class. The model contains application-defined data that needs to be shared among the flow objects. This class must handle all possible events, since it's an error for an event to bubble up the flow stack without being handled. Also implements a default fail approach of transferring to an "operator" -- a live person who can help the caller.
| Field Summary |
|---|
| Fields inherited from class org.speakright.core.flows.BasicFlow |
|---|
m_L |
| Constructor Summary | |
|---|---|
SRApp()
|
|
SRApp(java.lang.String name)
|
|
| Method Summary | |
|---|---|
protected IFlow |
createGoodbye()
Return the final flow object, that is executed after the main loop exits. |
protected LoopFlow |
createMainLoop()
|
protected IFlow |
createWelcome()
Return the first flow object, which is usually a welcome prompt. |
protected LoopFlow |
getMainLoop()
Get the loop flow returned by createMainLoop. |
protected void |
initMainLoop(LoopFlow flow)
Return the main loop sub-flow. |
protected boolean |
isAppEvent(ThrowEvent event,
java.lang.String eventName)
Called from onCatch to determine if we're catching a given app-event |
void |
onBegin(IFlowContext context)
Invokes getWelcome, getMainLoop, and getGoodbye. |
IFlow |
onCatch(IFlow current,
SRResults results,
java.lang.String eventName,
ThrowEvent event)
The default implementation of onCatch is to transfer to the operator. |
IFlow |
onDisconnect(IFlow current,
SRResults results)
The default implementation of onDisconnect is to transfer to the operator. |
IFlow |
onNoInput(IFlow current,
SRResults results)
The default implementation of onNoInput is to transfer to the operator. |
IFlow |
onPlatformError(IFlow current,
SRResults results)
The default implementation of onPlatformError is to transfer to the operator. |
IFlow |
onTransferFailed(IFlow current,
SRResults results)
The default implementation of onTransferFailed is to transfer to the operator. |
IFlow |
onValidateFailed(IFlow current,
SRResults results)
The default implementation of onValidateFailed is to transfer to the operator. |
protected IFlow |
transferToOperator()
Transfer the call to the operator. |
| Methods inherited from class org.speakright.core.flows.BasicFlow |
|---|
add, addPromptFlow, findSubFlow, getFirst, getNext, getSubFlowAfter, SubFlowCount |
| Methods inherited from class org.speakright.core.FlowBase |
|---|
createRenderer, execute, executionCount, fixupGrammar, fixupPrompt, log, logError, name, onComplete, onEnd, promptGroup, setExecutionCount, setName, setPromptGroup, shouldExecute, validateInput |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SRApp()
public SRApp(java.lang.String name)
| Method Detail |
|---|
public void onBegin(IFlowContext context)
onBegin in interface IFlowonBegin in class FlowBaseprotected IFlow createWelcome()
protected LoopFlow createMainLoop()
protected void initMainLoop(LoopFlow flow)
protected LoopFlow getMainLoop()
protected IFlow createGoodbye()
protected boolean isAppEvent(ThrowEvent event,
java.lang.String eventName)
event - eventName - name of the app event
protected IFlow transferToOperator()
public IFlow onDisconnect(IFlow current,
SRResults results)
onDisconnect in interface IFlowonDisconnect in class FlowBasecurrent - the currently executing flow object.results - the results of current's execution. In this case results will
contain a Disconnect result code. User input may be present, if the caller spoke before hanging
up. Some applications may want to process this final utterance before terminating.
public IFlow onNoInput(IFlow current,
SRResults results)
onNoInput in interface IFlowonNoInput in class FlowBasecurrent - the currently executing flow object.results - the results of current's execution. In this case results will
contain a Disconnect result code. User input may be present, if the caller spoke before hanging
up. Some applications may want to process this final utterance before terminating.
public IFlow onCatch(IFlow current,
SRResults results,
java.lang.String eventName,
ThrowEvent event)
onCatch in interface IFlowonCatch in class FlowBasecurrent - the currently executing flow object.results - the results of current's execution.eventName - name of the event. most event handling can be done using just the name.event - event object. advanced event handling may require the actual event object
public IFlow onPlatformError(IFlow current,
SRResults results)
onPlatformError in interface IFlowonPlatformError in class FlowBasecurrent - the currently executing flow object.results - the results of current's execution. In this case results will
contain a PlatformFailed result code.
public IFlow onTransferFailed(IFlow current,
SRResults results)
onTransferFailed in interface IFlowonTransferFailed in class FlowBasecurrent - the currently executing flow object.results - the results of current's execution. In this case results will
contain a TransferFailed result code.
public IFlow onValidateFailed(IFlow current,
SRResults results)
onValidateFailed in interface IFlowonValidateFailed in class FlowBasecurrent - the currently executing flow object.results - the results of current's execution. In this case results will
contain the user input that failed validation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||