One G2 can switch or reroute a Telewindows connection to another G2 process. That is, the KB running on one G2 can pass the information associated with a Telewindows connection to another G2, where the same Telewindows attempts a new connection to that G2. To the user, the new connection represents a continuation of the previous application session that took place via the (now rerouted) connection to the previous G2.
To accomplish this, G2 supports opening and closing Telewindows connections in a programmatic manner:
g2-reroute-window and g2-system-command) support connecting and disconnecting a Telewindows session programmatically.
G2-WINDOW class support rerouting Telewindows connections.
twtour.kb, shipped with your G2 product, demonstrates the basic features that a distributed G2 application should support, while also supporting reroutable Telewindows connections. See the Telewindows User's Guide for an overview of this KB.G2-window-management-type attribute has the value remote. Such a g2-window item has other attributes whose values include, in order:
-user-name, -user-mode, -password, -language).
A Telewindows command line option,
-discard-user-settings, exists to override the transfer of user information during rerouting. Telewindows users who do not want to transfer their user information should start the initial Telewindows session with this command line option:
% tw -discard-user-settings
g2-system-command system procedure to close a Telewindows connection programmatically. This procedure allows your G2 application to perform several G2 system-level operations that are otherwise available only using configurations.
g2-system-command system procedure the symbol close-telewindows-connection as the first argument and the g2-window item (associated with the Telewindows connection itself) as the second argument.
g2-reroute-window system procedure. g2-reroute-window opens a new Telewindows connection and the new target G2 associates that connection with a g2-window item in its own current KB, using the attribute values of the existing Telewindows connection's associated g2-window item.
Two attributes of a g2-window item support rerouting Telewindows connections:
G2-window-initial-window-configuration-string attribute contains a text value that the KB running in the target G2 uses to set up the user's access to that KB.
G2-window-initial-window-configuration-string value that represents the state of that user's activity within the application.
G2-window-reroute-problem-report attribute is a read-only attribute that presents an error message returned from an unsuccessful rerouting (via the g2-reroute-window system procedure) of a Telewindows user's session to another G2.
g2-system-command and g2-reroute-window system procedures, and the relevant attributes of the g2-window class, provide very specific capabilities. The KBs that comprise your distributed G2 application must perform the bulk of the work required to reroute a Telewindows connection. The following subsections outline these requirements and offer recommendations on how to proceed.
For example, the application can represent each G2 to which the application user can connect as a room in a virtual building that represents the scope of the application. This helps the user to understand intuitively that, in an actual building, he or she cannot occupy more than one room at a time.
Available candidates for rerouting: The application must support presenting to the application user a list of G2 processes that are suitable targets for rerouting.
Failed attempts at rerouting: The application must manage a failed attempt at rerouting a Telewindows connection, as in the case where no more available Telewindows connections were authorized for a particular G2 on a particular machine.
Depending on the licensing arrangements for G2 and Telewindows that the application users' organization has purchased, you might authorize one machine that runs G2 to allow connections with a maximum number of Telewindows users, while authorizing other machines that support your application to allow fewer concurrent Telewindows connections.
Continuity: The application can provide a continuing context (such as a history list of connections) for the application user, as the application opens and closes Telewindows connections on one machine after another.
For instance, the application can use the
G2-window-initial-window-configuration-string attribute to accumulate information that the distributed KBs can use to reroute the application user's Telewindows back to some starting point.