Syntax
SWITCHTO expression [ DATA expression ] [ PARTITION expression ] [ BYE ] [ CLEAR ] [ INHERIT ]
Parameters
SwitchTo can be abbreviated as SWT.
expression
The name of the compiled destination system:
For an MCP-based system, a valid window name, or an asterisk (*) for the default window name.
For a Windows-based system, the name of the generated target System.
If it is an invalid application name, and the Bye command option is not specified, the current user interface of the originating application is displayed with a message about the unavailability of the target application.
If it is an invalid application name, and the Bye command option is specified, the user is logged off from the originating application.
DATA expression
DATA can be abbreviated as DA. Specifies an expression to pass to the target application.
This expression is limited to a maximum length of 1850 characters.
If the first 5 characters of the data comprise the name of a valid ispec, and are followed by data in NOF format, the normal prepare and Main methods of that ispec are invoked. If the first 5 characters of the data comprise the name of a valid ispec, but are not followed by data in NOF format (that is, the sixth character is not a 'T'), the normal Construct method of that ispec is invoked.
For an MCP-based system, if the first 5 characters of the data do not contain a valid Ispec name:
The data is processed as for a normal station, that has received invalid data or System command.
If no data is sent, and if the ?OPEN notification is set, and you are going on to the window for the first time, the Fireup Ispec is displayed. If no data is sent, and the ?ON notification is set, and you have been on the same window previously, the previous Ispec is displayed. (You must also have either Output protection or Logging set.)
Otherwise, the Ispec Selection screen (Page 2) is displayed (you are in fact signed on to the destination system).
For a non-runtime application, the data should be in the format expected by the application.
PARTITION expression
PARTITION can be abbreviated as PA. Specifies the partition name for Component Enabler.
This name is limited to a maximum length of 19 characters.
If the Partition command option is executed on a terminal that is not using Component Enabler, the command option is ignored.
Refer to Component Enabler for more information on use of the SwitchTo logic command with Component Enabler.
For an MCP-based system, the Fireup Ispec is displayed when you switch back, unless an Ispec is explicitly specified using the Data command option with the SwitchTo command.
BYE
Log off from the originating application.
It is possible to log off from the application even if a report is running. If the report attempts to access the terminal that has been logged of, it will terminate abnormally.
For an MCP-based system, if you sign back onto the original System, an ?OPEN notification is sent, and the Fireup Ispec is displayed. If you switch back to the System with data, the data you send with the SwitchTo command overrides the ?OPEN notification.
CLEAR
CLEAR can be abbreviated as CL. The Clear command option is not supported on applications deployed to Windows.
INHERIT
INHERIT can be abbreviated as IN. The Inherit command option is not supported on applications deployed to Windows.
Description
The SwitchTo logic command programmatically switches from the current application to another application at runtime. The other application can be:
Another runtime application
Another application running Component Enabler
A default user interface; for example, a log on or log off user interface
Use the SwitchTo logic command to perform tasks outside the current application without having to log off the application and then log on to another Agile Business Suite or external application. Once the task is complete, switch back to the former user interface in the current application, or to a default user interface.
The SwitchTo logic command functions similarly to the Recall logic command. It is only valid where a Recall logic command is valid. Like the Recall logic command, the specified application is not switched to until the current logic has completed.
Upon execution, the SwitchTo logic command sets the Glb.Error built-in segment attribute to "*****".
All logic following the SwitchTo logic command is executed.
If more than one Recall or SwitchTo logic command is specified in the logic, then only the last Recall or SwitchTo logic command is executed.
The SwitchTo logic command is ignored when processing an OLTP transaction. The server receives no user indication. The client receives an error condition that sets the Glb.Status built-in segment attribute to "*****" and the Glb.HubStatus built-in segment attribute to "S" (SWITCH CMD).
Refer to Switching Between Applications for more information on switching during a debug session.
Note: The use of SwitchTo logic command is invalid in Reports and Messengers.
Runtime requirements
For SwitchTo to work in Runtime the system must be correctly defined in the config.xml file (located at <Developer installation folder>\Unisys\NGEN\Bin). Refer to the Agile Business Suite Installation and Configuration Guide for more information on Runtime configuration.
Restrictions
The following restrictions apply to use of the SwitchTo logic command:
It only switches to applications that are located under the same parent directory. For example, it is possible to switch between D:\absuite\app1 and D:\absuite\app2. However, it is not possible to switch between D:\absuite\app1 and D:\payrsys\app2.
The Glb.Work built-in segment attribute is not shared between the two applications, so it cannot be used to share information. The value of Work in the originating application is not affected by any logic executed in the target application. To send state information to the target application, use the Data command option.
It is ignored by GLI, OFFLINE, HUB, and OLTP transactions.
It is not available in reports. It sets the Glb.Error built-in segment attribute to "*****".
On MCP-based systems, you cannot switch to the Report Output Control System (ROC). Use the Roc command instead.
Example
This example uses the SwitchTo logic command on an application deployed to Windows.
SwitchTo SD_System