Automation Engine Script Guide > Ordered by Function > Error Handling and Messages > :STOP

:STOP

Script Statement: It cancels the processing of a scriptA particular Automation Engine object type.

Syntax

:STOP [Stop Mode]

Syntax

Description/Format

Stop Mode

You can pass on the following parameters to the :STOP statement in the form of Stop Modes:

"No specification"
It cancels the processing of a script and writes the message "U0010014" to the activation reportA report provides more detailed information about a task's execution or a component..

NOMSG, Message Number[, Message Text]
Cancels the activation of an objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task without an error. A message can be created for this purpose.

MSG, Error Number, Error Text
Cancels the activation of an object and gives an error message.

Comments

:STOP cancels the activation of an object. Therefore, this script element cannot be used in the Post Process tab. Automic recommends using the statement :MODIFY_STATE instead.

Stop Mode NOMSG

The :STOP statement with Stop Mode NOMSG can be used in objects which do not require an agentA program that enables the de-centralized execution of processes (such as deployments) on target systems (computers or business solutions) or a service that provides connectivity to a target system (such as for databases or middleware). An agent is also an object type in the Automation Engine. [Formerly called "Executor."] See also: host for processing. It is therefore possible to work only with script statements (to set variables, for example).

You can also create a message by using the parameter Stop Mode NOMSG. The Message Number is syntactically necessary but is not evaluated. The Message Text is stored in the statisticsThis is a list of a task's previous runs. and sent as part of the confirmation when a call is made via the CallAPIA programming interface that processes a script in the Automation Engine system. It can be called directly from within the program itself or from a different program.. As a result thereof, the run number (RunIDShort for "run number". It is a number that provides unique information about a task's execution. The RunID can include 7 to 10 digits. It is assigned by the Automation Engine component .) of a started taskAn executable object that is running. Tasks are also referred to as activities. can be returned to the CallAPI.

Because Stop Mode NOMSG ends task activations without errors, these tasks will not appear as canceled tasks in the statistics.

Stop Mode MSG

Stop Mode MSG can be used to cancel the activation of an object with an error message. You can define an Error Number and an Error Text. This is especially important for objects that start via the AE CallAPI. The returned information is the only information about the script execution. Error numbers 50 to 59 are reserved for users.

Return code 4 is used for the error number 50 and return codeThe value that represents the result of tasks and script functions. 8 for the numbers ranging from 51 to 59.

Note that you can only use the error numbers 50 - 59. Using other error numbers will cause the script to abort with an error message that informs you that the specified error number is not valid.

Because Stop Mode MSG cancels task activations with an error, these tasks are listed in the statistics as canceled tasks .

If you use the :STOP statement without any parameters or with Stop Mode MSG, script processing will abort with an error and a databaseA database is an organized collection of data including relevant data structures. rollback takes place. All transactions that were not specifically executed will be rolled back. If you have used script variables, it can happen that the Variable objects that are located at the beginning of the script already include their new values but those located at the script end won't.

The system writes transactions to the AE database (commit) when script processing is interrupted. This occurs:

You can use the script statement :WAIT 0 in order to force an interruption in script processing and also, to force a database commit.

Examples

The following example returns an error message that informs you whether a jobAn Automation Engine object type for a process that runs on a target system. was correctly activated or not.

:SET &ACTNR# = ACTIVATE_UC_OBJECT(JOBS, MM)
:
IF &ACTNR# = "0"
:
STOP MSG, 50, "Error in activating the job MM."
:
ELSE
:
PRINT "The job MM was activated with the activation number &ACTNR#."
:
ENDIF

 

See also:

Script element Description

:EXIT

Terminates the processing of a script and sends a return code.

:WAIT

This is used to stop processing of the script for a specified period of time. Meanwhile, other tasks are completed.

Script Elements - Activate Objects
Script Elements - Error Handling and Messages

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH