A SERVICE OF

logo

Logon Components,Connections and Connection Pools
95
20 Optionally check the Reuse connection only if expression is true control.
This control allows you to enter an ECMAScript expression that evaluates to
true or false based on some test of the launch screen. The purpose of the
expression is to check to make sure the launch screen is the proper one each
time a new 5250 Component is about to reuse an active free connection.
Under circumstances unrelated to your Composer service, its possible that
the launch screen will be replaced by the host with a different screen. For
instance, if there is a system ABEND on the host, the launch screen in the
Logon Component may be replaced by a System Message screen.
NOTE: For instructions on how to create this expression, see the section
entitled: Handling System Messages on page -128 of this Guide. Also refer
to Maximizing Performance of 5250 Logon Connection in this Chapter.
The following is a sample Custom Script used to see if a particular screen is
present. If it is not, the script writes a message to the console stating that the
screen is bad and the Logon Connection is being released. This function is
called from the Reuse connect only if expression is true control on the
Pool Info dialog.
21 Click OK to return to the Connection Info panel.
22 Click Finish and the Logon Connection is saved.
function checkValidLaunchScreen(ScreenDoc)
{
var screenText = ScreenDoc.XPath("SCREEN").item(0).text
if((screenText.indexOf( "MENU") != -1 || screenText.indexOf("APLS") != -1) &&
(screenText.indexOf("COMMAND UNRECOGNIZED") == -1 ||
screenText.indexOf("UNSUPPORTED FUNCTION") == -1))
{
return true;
}
else
{
java.lang.System.out.println("Warning - Releasing logon connection at bad screen");
java.lang.System.err.println("Warning - Releasing logon connection at bad screen");
return false;
}
}