Automation Engine Script Guide > Ordered by Function > Activate Objects > SYS_STATE_JOB_ACTIVE

SYS_STATE_JOB_ACTIVE

Script Function: Checks if a jobAn Automation Engine object type for a process that runs on a target system. has already been activated

Syntax

SYS_STATE_JOB_ACTIVE([Job])

Syntax

Description/Format

Job

Name of a job
Format: AE name, script literal or script variable


Return codes

"Y" - The job is in a statusThis represents the condition of a task (such as active, blocked, generating). with system return codeThe value that represents the result of tasks and script functions. < 1699 or 1701.
"N" - The job is in a status with system return code > 1699 and not 1701.
 

Comments

This scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… checks whether or not the specified job is in a status with a system return codebelow 1699 or equals the return code 1701. If none of the two parameters has been specified, the function checks the objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task in which it is used.

The check is made when the script line which contains this function is processed. A negative result does not provide the information whether or not the object will be activated later. Thus, this function cannot be used to synchronize processes. The information it supplies about object states is only valid for a limited period of time.

When you specify the name of the own object (= the object that is used to process the script element), your system considers this and always returns the return code "Y".

Example

In the example, it is tested if a job is currently active and the result is passed to a script variableA placeholder for a value within a script..

:SET &ACTIVE# = SYS_STATE_JOB_ACTIVE(MM.END.PROCESSING)

 

See also:

Script element Description

SYS_STATE_ACTIVE

Checks if an object has already been activated

SYS_STATE_JOBS_IN_GROUP

Returns the number of jobs that are registeredThis is the status of a task that runs within a group and is waiting for its start. in groups

SYS_STATE_JP_ACTIVE Checks if 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."] has already been activated

Script Elements - Activate Objects

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