User Guide > Objects > Working with Objects > User Return Codes of Executable Objects

User Return Codes of Executable Objects

Individually defined return codes can be used in addition to system return codes. The names of the corresponding states are easily selectable (such as USER_100 with the userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management. return codeThe value that represents the result of tasks and script functions. 100).

These user-defined states can be used in Workflow and Schedule objects. They are defined in the Result tab (Schedule object) and Post Conditions tab (Workflow object) in the form of expected end states. You can also define states in the Dependencies tab (Workflow objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task) in order to react to return codes of preceding tasks.

Defining User Return Codes

User-defined return codes and their statusThis represents the condition of a task (such as active, blocked, generating). descriptions are stored in the table UC_ZUTYP. Modify or extend them in this AE databaseA database is an organized collection of data including relevant data structures. table. The returned code must be below 1000 and have 4 digits with leading zeros. Use alpha-numeric character chains for status descriptions. User return codes can be selected in all clients.

Examples:

Task Status/Condition

User Return Code

Description

USER_100

0100

An individual user return code (100) is assigned to the taskAn executable object that is running. Tasks are also referred to as activities. status USER_100.

USER_200_300

0200-0300

A range of user return codes (200-300) is assigned to the task status USER_200_300.

USER_301_401_501

0301,0401,0501

A listing of return codes (301, 401 and 501) is assigned to the task status USER_301_401_501.

 


Setting User Return Codes

Script

User return codes can be specified using the scriptA particular Automation Engine object type. statement :EXIT. If the option Generate at runtimeThe duration of a task's execution. It refers to the period between a task's start and end. It does not include its activation period (see also: activation and start). has been activated in the Attributes tab,  you can react to  user-defined return codes within a workflowAn object of the Automation Engine that can include several executable objects and which runs them in a specified order. [Formerly called "ProcessFlow" and "JobPlan."].

Reacting to conditions that a generated jobAn Automation Engine object type for a process that runs on a target system. can encounter in the target system is possible via the setting and evaluation of user return codes. Job messenger calls in the job trailers depend on whether a job ended normally or abnormally. If the job was canceled, the Job Messenger assumes the specified return code.

Windows

You can set a particular return code within a job. With this return code being specified, the job ends abnormally. The following syntax applies:

SET RETCODE=nnn
GOTO RETCODE

Instead of a fixed value, the MSDOS error variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. "Errorlevel" can also be used. Of course, this depends on the specifications of the operating system. The following syntax applies:

SET RETCODE=%ERRORLEVEL%
GOTO RETCODE

UNIX

A job in UNIX can be terminated with the statement EXIT nnn at any time.

BS2000

The BS2000 Job Messenger can retrieve the return code from a job variable or with a file command. The BS2000 trailer contains two labels where processing is made.

The use of job variables requires the assignment of a job variable of the name *RETCODE. The following syntax applies:

/DCLJV #RETCODE,LINK=*RETCODE
/SETJV #RETCODE,'421'
/SKIP .RETJV

If the return code should be retrieved with a file command, a file with the link name RETCODE must be assigned. The string "RETCODE" is searched for in the file name. The user return code has to follow the string. The following syntax applies:

/FILE #RETCODE421,LINK=RETCODE
/SKIP .RETTFT

 

See also:

System Return Codes of Executable Objects
Script Statement :EXIT

 


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

Copyright © 2016 Automic Software GmbH