Disconnect Terminal

Declaration

<AMDISCONNECTTERM SESSION="text" />

See Also

Connect Terminal | Control Terminal | Get Terminal Text | Send Terminal Text | Wait Terminal

Description

Disconnect from a Terminal session previously established with the Connect Terminal action.

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 3rd party software.

Parameters

General Properties

Property

Type

Req'd

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 Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane 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 />

 

↑ [Top of Page]