formaterror
Class TestFormatError

java.lang.Object
  extended by com.wrq.vhi.script.api.ModelEventHandler
      extended by formaterror.TestFormatError
All Implemented Interfaces:
com.wrq.vhi.script.api.EventHandler

public class TestFormatError
extends com.wrq.vhi.script.api.ModelEventHandler

Format Error event example.

This example illustrates three different ways to respond to the formatError event.

  1. Return a null (or empty list) result. This causes the Verastream server to report the original error, as-is.
  2. Return a replacement error message. In this case the one or more new messages replace what would otherwise have been reported.
  3. Change the error list, adding new errors (and perhaps removing existing ones).


Field Summary
static int clientConnectedTimeout
          Timeout in seconds for the clientConnected() event.
static int clientDisconnectedTimeout
          Timeout in seconds for the clientDisconnected() event.
static java.lang.String description
           
private static int errOpnBadDestination
          Navigation error: operation reached entity not defined as a destination.
private static int errOpnUserErrorDestination
          User-defined error message when operation reaches error entity.
static int errorReportedTimeout
          Timeout in seconds for the errorReported() event.
static int executeLoginTimeout
          Timeout in seconds for the executeLogin() event.
static int executeLogoutTimeout
          Timeout in seconds for the executeLogout() event.
static int formatErrorTimeout
          Timeout in seconds for the formatError() event.
static int moveCursorBackwardTimeout
          Timeout in seconds for the moveCursorBackward() event.
static int moveCursorForwardTimeout
          Timeout in seconds for the moveCursorForward() event.
static int moveCursorTimeout
          Timeout in seconds for the moveCursor() event.
private static java.lang.String[] msgPrefix
          Searching for an invalid last name generates two errors starting with these strings.
static int processStringTimeout
          Timeout in seconds for the processString() event.
static int unrecognizedScreenTimeout
          Timeout in seconds for the unrecognizedScreen() event.
 
Fields inherited from interface com.wrq.vhi.script.api.EventHandler
DEFAULT_TIMEOUT
 
Constructor Summary
TestFormatError()
           
 
Method Summary
 java.util.List formatError(com.wrq.vhi.script.api.FormatErrorEvent event)
          Change error messages returned to a client.
 
Methods inherited from class com.wrq.vhi.script.api.ModelEventHandler
clientConnected, clientDisconnected, errorReported, executeLogin, executeLogout, moveCursor, moveCursorBackward, moveCursorForward, processString, unrecognizedScreen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public static final java.lang.String description
See Also:
Constant Field Values

errOpnUserErrorDestination

private static final int errOpnUserErrorDestination
User-defined error message when operation reaches error entity.

See Also:
Constant Field Values

errOpnBadDestination

private static final int errOpnBadDestination
Navigation error: operation reached entity not defined as a destination.

See Also:
Constant Field Values

msgPrefix

private static final java.lang.String[] msgPrefix
Searching for an invalid last name generates two errors starting with these strings.


errorReportedTimeout

public static final int errorReportedTimeout
Timeout in seconds for the errorReported() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

formatErrorTimeout

public static final int formatErrorTimeout
Timeout in seconds for the formatError() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

clientConnectedTimeout

public static final int clientConnectedTimeout
Timeout in seconds for the clientConnected() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

clientDisconnectedTimeout

public static final int clientDisconnectedTimeout
Timeout in seconds for the clientDisconnected() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

unrecognizedScreenTimeout

public static final int unrecognizedScreenTimeout
Timeout in seconds for the unrecognizedScreen() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

executeLoginTimeout

public static final int executeLoginTimeout
Timeout in seconds for the executeLogin() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

executeLogoutTimeout

public static final int executeLogoutTimeout
Timeout in seconds for the executeLogout() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

moveCursorForwardTimeout

public static final int moveCursorForwardTimeout
Timeout in seconds for the moveCursorForward() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

moveCursorBackwardTimeout

public static final int moveCursorBackwardTimeout
Timeout in seconds for the moveCursorBackward() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

moveCursorTimeout

public static final int moveCursorTimeout
Timeout in seconds for the moveCursor() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values

processStringTimeout

public static final int processStringTimeout
Timeout in seconds for the processString() event. A value of DEFAULT_TIMEOUT means the event will use the model defined default event timeout.

See Also:
Constant Field Values
Constructor Detail

TestFormatError

public TestFormatError()
Method Detail

formatError

public java.util.List formatError(com.wrq.vhi.script.api.FormatErrorEvent event)
                           throws com.wrq.apptrieve.agent.ApptrieveException
Change error messages returned to a client.

This event handler will treat error messages it knows about, and report others as "unexpected".

Overrides:
formatError in class com.wrq.vhi.script.api.ModelEventHandler
Parameters:
event - the event instance
Returns:
a list of ErrorMessage objects
Throws:
com.wrq.apptrieve.agent.ApptrieveException