org.speakright.core.tests
Class MyFlow

java.lang.Object
  extended by org.speakright.core.FlowBase
      extended by org.speakright.core.flows.BasicFlow
          extended by org.speakright.core.tests.MyFlow
All Implemented Interfaces:
java.io.Serializable, IFlow

public class MyFlow
extends BasicFlow

See Also:
Serialized Form

Field Summary
 Model M
           
 boolean m_addBinding
           
 boolean m_addBindingX
           
 boolean m_exitInGetNext
           
 boolean m_handleNoInput
           
 boolean m_shouldExecute
           
 boolean m_throwInExecute
           
 boolean m_throwInGetNext
           
 
Fields inherited from class org.speakright.core.flows.BasicFlow
m_L
 
Constructor Summary
MyFlow(java.lang.String name)
           
 
Method Summary
 void addSubFlow(IFlow flow)
           
 void execute(IExecutionContext context)
          The default implementation of execute is to render this object.
 IFlow getFirst(IFlowContext context)
          If there are sub-flows then return the first one, otherwise return self.
 IFlow getNext(IFlow current, SRResults results)
          get the next flow.
 void onBegin(IFlowContext context)
          The default implementation of onBegin is to do nothing.
 void onEnd(IFlowContext context)
          The default implementation of onEnd is to do nothing.
 IFlow onNoInput(IFlow current, SRResults results)
          The default implementation of onNoInput is to return null, indicating that this object does not handle no-input events.
 boolean shouldExecute()
          Used for optional sub-flows.
 
Methods inherited from class org.speakright.core.flows.BasicFlow
add, addPromptFlow, findSubFlow, getSubFlowAfter, SubFlowCount
 
Methods inherited from class org.speakright.core.FlowBase
createRenderer, executionCount, fixupGrammar, fixupPrompt, log, logError, name, onCatch, onComplete, onDisconnect, onPlatformError, onTransferFailed, onValidateFailed, promptGroup, setExecutionCount, setName, setPromptGroup, validateInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

M

public Model M

m_shouldExecute

public boolean m_shouldExecute

m_exitInGetNext

public boolean m_exitInGetNext

m_handleNoInput

public boolean m_handleNoInput

m_throwInGetNext

public boolean m_throwInGetNext

m_throwInExecute

public boolean m_throwInExecute

m_addBinding

public boolean m_addBinding

m_addBindingX

public boolean m_addBindingX
Constructor Detail

MyFlow

public MyFlow(java.lang.String name)
Method Detail

shouldExecute

public boolean shouldExecute()
Description copied from interface: IFlow
Used for optional sub-flows. A flow object can return false from this method if it wants to be skipped (that is, not execute). All the restrictions of optional-sub-flows apply, such as can't-be-last.

Specified by:
shouldExecute in interface IFlow
Overrides:
shouldExecute in class FlowBase
Returns:
true (default) to execute, false to not execute this flow object

execute

public void execute(IExecutionContext context)
Description copied from class: FlowBase
The default implementation of execute is to render this object. However the default rendering is a 'silent' voicexml page.

Specified by:
execute in interface IFlow
Overrides:
execute in class FlowBase
Parameters:
context - Contains the page renderer.

getFirst

public IFlow getFirst(IFlowContext context)
Description copied from class: BasicFlow
If there are sub-flows then return the first one, otherwise return self. BasicFlow supports optional sub-flows. An optional sub-flow can return null from it's getFirst method to indicate that it doesn't wish to run. BasicFlow must still adhere to the rule that SRRunner requires getFirst never return null; therefore at least one sub-flow's getFirst must return non-null. Detail: getFirst method of sub-flows may be called more than once.

Specified by:
getFirst in interface IFlow
Overrides:
getFirst in class BasicFlow
Returns:
an IFlow object to be executed.

getNext

public IFlow getNext(IFlow current,
                     SRResults results)
Description copied from class: BasicFlow
get the next flow. If there are sub-flows then return the next sub-flow.

Specified by:
getNext in interface IFlow
Overrides:
getNext in class BasicFlow
Parameters:
current - the currently executing flow object. More precisely, current is the flow object that this object most recently returned from getFirst or getNext.
results - the results of current's execution by the speech platform. Results contains user input and/or events such as disconnect or platform-error.
Returns:
the next flow to run, or null which means this flow object is finished.

onBegin

public void onBegin(IFlowContext context)
Description copied from class: FlowBase
The default implementation of onBegin is to do nothing.

Specified by:
onBegin in interface IFlow
Overrides:
onBegin in class FlowBase

onEnd

public void onEnd(IFlowContext context)
Description copied from class: FlowBase
The default implementation of onEnd is to do nothing.

Specified by:
onEnd in interface IFlow
Overrides:
onEnd in class FlowBase

onNoInput

public IFlow onNoInput(IFlow current,
                       SRResults results)
Description copied from class: FlowBase
The default implementation of onNoInput is to return null, indicating that this object does not handle no-input events.

Specified by:
onNoInput in interface IFlow
Overrides:
onNoInput in class FlowBase
Parameters:
current - 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.
Returns:
the next flow to run, or null which means this flow object does not handle this event.

addSubFlow

public void addSubFlow(IFlow flow)