Terminal - Disconnect

Declaration

<AMTERMINAL ACTIVITY="disconnect" SESSION="TerminalSession1" />

Related Topics    

Description

Disconnects a terminal connection and ends a session previously established with the Terminal - Connect activity.

Practical usage

Used to disconnect from a transaction with a terminal. This step is always used in conjunction with other terminal actions such as Terminal - Connect and Terminal - Send text. The terminal actions are used in leu of terminal emulation software. Using the terminal actions, legacy systems can be automated in the background without the use of 3rd party software.

Parameters

General

Property Type Required Default Markup Description
Session Text (options) No TerminalSession1 SESSION="terminalsession2" The name of the session to disconnect. This session must have been created in a prior step using Terminal - Connect Session names allow several connections to be active simultaneously. If you are only using one connection at a time, do not specify a value other than the default.

Description

Error Causes

On Error

Examples

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Example 1

This sample task disconnects a terminal session.

Copy
<AMTERMINAL ACTIVITY="disconnect" SESSION="myTerminalSession" />

Example 2

This sample task uses an assortment of terminal activities to automate a terminal logon process. Examining the step parameters and properties of this task may assist you in creating your own terminal emulation task.

Copy
<AMVARIABLE NAME="theUsername" VALUE="Username" />
<AMVARIABLE NAME="thePassword" VALUE="password"></AMVARIABLE>
<AMTERMINAL HOST="linux.networkautomation.com" SESSION="TerminalSession1" SHOWTERMINALWINDOW="YES" EMULATION="vt220" ENCRYPTIONALGORITHMS="Any" AUTHENTICATIONMETHOD="Any" />
<AMTERMINAL ACTIVITY="waitfor" SESSION="TerminalSession1" TEXT="login" />
<AMTERMINAL ACTIVITY="sendtext" SESSION="TerminalSession1" TEXT="%theUsername% {ENTER}" />
<AMSHOWDIALOG MESSAGE="OK to proceed?"></AMSHOWDIALOG>
<AMTERMINAL ACTIVITY="waitfor" SESSION="TerminalSession1" TEXT="Password" />
<AMTERMINAL ACTIVITY="sendtext" SESSION="TerminalSession1" TEXT="%thePassword% {ENTER}" />
<AMSHOWDIALOG MESSAGE="OK to proceed?"></AMSHOWDIALOG>
<AMTERMINAL ACTIVITY="disconnect" SESSION="TerminalSession1" />