unrecognizedscreen
Class UndefinedEntityHandler

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

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

Handle undefined screen event.

This example illustrates one way to implement an unrecognizedScreen event handler. The method used is to use the value of a model variable to choose the recovery method, and then to interact with the host application to navigate to a known screen (entity).

This example also shows how to dump the contents of an unrecognized screen to the system output. The same mechanism can be used to log the error to a file or to the event log.


Field Summary
private static java.lang.String clearKeySetting
          Model variable value for clear key recovery.
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
           
static int errorReportedTimeout
          Timeout in seconds for the errorReported() event.
private static java.lang.String eventVariableName
          Model variable name used to communicate recovery options.
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.
static int processStringTimeout
          Timeout in seconds for the processString() event.
private static java.lang.String reconnectSetting
          Model variable value for host disconnect-reconnect recovery.
static int unrecognizedScreenTimeout
          Timeout in seconds for the unrecognizedScreen() event.
 
Fields inherited from interface com.wrq.vhi.script.api.EventHandler
DEFAULT_TIMEOUT
 
Constructor Summary
UndefinedEntityHandler()
           
 
Method Summary
 void unrecognizedScreen(com.wrq.vhi.script.api.UnrecognizedScreenEvent event)
          Handle the arrival at an unrecognized screen.
 
Methods inherited from class com.wrq.vhi.script.api.ModelEventHandler
clientConnected, clientDisconnected, errorReported, executeLogin, executeLogout, formatError, moveCursor, moveCursorBackward, moveCursorForward, processString
 
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

eventVariableName

private static final java.lang.String eventVariableName
Model variable name used to communicate recovery options.

See Also:
Constant Field Values

reconnectSetting

private static final java.lang.String reconnectSetting
Model variable value for host disconnect-reconnect recovery.

See Also:
Constant Field Values

clearKeySetting

private static final java.lang.String clearKeySetting
Model variable value for clear key recovery.

See Also:
Constant Field Values

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

UndefinedEntityHandler

public UndefinedEntityHandler()
Method Detail

unrecognizedScreen

public void unrecognizedScreen(com.wrq.vhi.script.api.UnrecognizedScreenEvent event)
                        throws com.wrq.apptrieve.agent.ApptrieveException
Handle the arrival at an unrecognized screen.

The method should do whatever it needs to in order to recover the host session or return an intelligible error message:

  1. Send one or more keystrokes that will return the application to a recognized screen.
  2. Tell the Host Integrator server which entity it should consider as the current.
  3. Throw an exception describing a problem that cannot be handled.

This example illustrates two ways to implement the first alternative.

If the model variable with the name given by eventVariableName is set to the value given by reconnectSetting the event handler will disconnect from the host and then reconnect to recover from the navigation error.

If the model variable value is set to the value given by clearKeySetting the event handler will send a CLEAR key to cause the host application to return to the Main entity.

Overrides:
unrecognizedScreen in class com.wrq.vhi.script.api.ModelEventHandler
Parameters:
event - the event instance
Throws:
com.wrq.apptrieve.agent.ApptrieveException