Terminal - Disconnect

Declaration

<AMDISCONNECTTERM SESSION="text" />

Description: Disconnect from a Terminal session previously established with the Connect Terminal 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 Connect Terminal and Send Terminal 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 third-party software.

General Parameters

Property

Type

Required

Default

Markup

Description

Session Name

Text (options)

No

TermSess1

SESSION="terminalsession2"

Specifies the session name to disconnect. This session must have been created in a prior step using Connect Terminal. 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 tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Examples

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Sample 1 - Disconnect terminal session named myTerminalSession.  

<AMDISCONNECTTERM SESSION="myTerminalSession" />

Sample 2 - A sample task that uses all available terminal actions. Examining the step parameters and properties of this task may assist you in creating your own terminal emulation task.

<AMVARIABLE NAME="thePassword">password</AMVARIABLE>
<AMCONNECTTERM EMULATION="VT220" HOST="linux.networkautomation.com" 
SHOWTERMINALWINDOW="YES" />
<AMWAITFORTERMTEXT TYPE="TEXT">login:</AMWAITFORTERMTEXT>
<AMSENDTERMTEXT>%theUsername%{ENTER}</AMSENDTERMTEXT>
<AMSHOWDIALOG>OK to proceed?</AMSHOWDIALOG>
<AMWAITFORTERMTEXT TYPE="TEXT">Password:</AMWAITFORTERMTEXT>
<AMSENDTERMTEXT>%thePassword%{ENTER}</AMSENDTERMTEXT>
<AMSHOWDIALOG>OK to proceed?</AMSHOWDIALOG>
<AMDISCONNECTTERM />