Application events

The rules-based approach used by ZIETrans enables you to customize screens by applying certain actions upon a screen recognition event. You can also associate actions with other ZIETrans events, known as application events. Application events include application occurrences such as connecting and disconnecting from the host server, starting or stopping your ZIETrans application, or when your application encounters an error or an unrecognized host screen. You can configure these application events to perform certain actions when they occur.

To access the application events, go to the ZIETrans Projects view and double click the Project Settings of your ZIETrans project and select the Events tab. On the Events tab in the Application Events section, click the link for an event to open its editor.

Each application event has various actions associated with it.

The following list provides descriptions of the ZIETrans application events and when they might occur along with their associated actions

Start
A start event occurs when starting your ZIETrans application. There is no default action for the start event.
You can specify the following actions for the start event:
  • Execute business logic
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Perform macro transaction
  • Pause
Connect
A connect event occurs when your ZIETrans application connects to the host server. For example, upon connecting you might want to configure your project to run a macro to bypass certain screens to display a logon screen. The default action for the connect event is to obtain a connection. The actions of the connect event always run after the start event.
You can specify the following actions for the connect event:
  • Obtain default connection
  • Execute business logic
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Play macro
  • Perform macro transaction
  • Disconnect
  • Pause
Blank screen
A blank screen event allows you to specify what actions you would like to perform on the default connection whenever the host screen is blank. This optional event contains no actions by default, and is ignored. If your application often displays a blank screen and requires the user to press the Refresh button, you might add a Pause action to this event to allow the host more time to complete drawing its host screens. If you do specify actions for this event, it is checked after exhausting the list of screen events you've provided in the screen event priority list, and just before running the unmatched screen event.
You can specify the following actions for the blank screen event:
  • Execute business logic
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Play macro
  • Perform macro transaction
  • Disconnect
  • Pause
There are also special settings you can use to specify how to handle a blank screen received when initially connecting to the host. For more information, see Screen Handling.
Unmatched screen
An unmatched screen event occurs when ZIETrans receives a screen from the host application that does not match any screen events in the ZIETrans application. If you have configured your ZIETrans application to use the default rendering for some screens, then this is a normal occurrence. If you have tried to recognize all possible host screens in screen events, you can configure the unmatched screen event to show a URL that tells the user he has reached an unexpected screen, asks how he got to it, and offers paths back into the proper screens. The default action for the unmatched screen event is to show the default transformation.
You can specify the following actions for the unmatched screen event:
  • Apply transformation
  • Execute business logic
  • Extract global variable
  • Insert data
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Play macro
  • Perform macro transaction
  • Send key
  • Disconnect
  • Pause
Error
An error event occurs when ZIETrans encounters an application or host error. You might want to add an action that displays an error in the GUI when an error event occurs. The default action for the error event is to show a URL (error.jsp for Web applications).
You can specify the following actions for the error event:
  • Execute business logic
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Play macro
  • Perform macro transaction
  • Pause
Disconnect
A disconnect event occurs when your ZIETrans application disconnects from the host server. The default action for the disconnect event is to release the default connection.
You can specify the following actions for the disconnect event:
  • Release the default connection
  • Execute business logic
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Play macro
    Note: For steps to take if a macro times out while playing as part of the disconnect event, see the description of the Stop event below.
  • Perform macro transaction
  • Pause
Stop
A stop event occurs after stopping your ZIETrans application. The default action for the stop event is to show a URL (stop.jsp for Web applications).
You can specify the following actions for the stop event:
  • Execute business logic
  • Set global variable
  • Remove global variable
  • Show URL (Web-only)
  • Forward to URL (Web-only)
  • Play macro
  • Perform macro transaction
  • Pause
Note: If a macro times out and fails to complete while playing as part of the disconnect event, the disconnect event fails to complete, and the ZIETrans connection is not disconnected. Macro time outs are typically caused when the macro encounters an unknown host screen. To configure the Stop event to successfully terminate the host connection when this occurs, perform the following steps:
  1. Click the link for the Stop event to open its editor.
  2. In the editor click the Source tab.
  3. Add the <release enabled="true"/> action prior to the <show/> action.
  4. The Stop event source should look like the following example:
    <?xml version="1.0" encoding="UTF-8"?>
    <event description="" type="stop">
        <actions>
            <release enabled="true"/>
            <show enabled="true" page="stop.jsp" url="/stop.jsp"/>
        </actions>
    </event> 
  5. Save the project settings file and restart the application.