Automation Engine Script Guide > Ordered by Function > Read or Modify Objects > :ATTACH_SYNC

:ATTACH_SYNC

Script Statement: Assigns a Sync objectIt synchronizes executable objects based on defined states and actions. A particular Automation Engine object type. to a taskAn executable object that is running. Tasks are also referred to as activities.

Syntax

:ATTACH_SYNC [Object type], [RunID], Sync Object, [Start Action], [Abend Action], [End Action], Other, [NEXT_OBJECT]

Syntax

Description/Format

Object type

Short Label of an executable objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task
Format: script literal or script variable

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 .

Run number (RunID) of the object
Format: scriptA particular Automation Engine object type. literal, script variableA placeholder for a value within a script. or number

Sync object

Name of a Sync object with which the task should be synchronized
Format: script literal or script variable

Start actionActions are predefined building blocks for recurring activities. They are commonly used for managing third party systems or in deployment scenarios.

Action that should be carried out when the task starts
Format: script literal or script variable

Abend action

Action that should be carried out when the task ends abnormally
Format: script literal or script variable

End action

Action that should be carried out when the task ends
Format: script literal or script variable

Other

Task handling if neither Start Action, Abend Action nor End Action can be processed.

Format: script literal or script variable

Allowed values: "A", "W" or "S"

"A" - Abnormal end (Abend)
"W" - Wait
"S" - Skip

NEXT_OBJECT

The Sync object should be assigned to the direct childA subordinate task (such as a task that runs in a workflow). in 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."]
Format: script literal or script variable

Comments

With this script statement, a Sync object can be added to a task that has already been activated. This is a temporary assignment - it is only valid for the particular execution. Object type is an optional parameter as the object typeAn individual object is provided for the individual activities: There are User, UserGroup, Notification, Cockpit, CodeTable, Documentation, Event, Agent, FileTransfer, Group, Include, Job, Workflow, Calendar, Login, Client, RemoteTaskManager, Schedule, Script, Server, Sync, Variable and TimeZone objects can be clearly identified by its run number (RunID).

You can also use this script statement to assign a Sync object to one of the following tasks of a workflow, thereby influencing further processing. 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). must be activated in tasks whose scripts contain a script statement. The following task - to which a Sync object should be assigned - must already have been activated and have its own RunID.Thus, the option Generate at runtime must not be activated. The parameter NEXT_OBJECT can be used to assign a Sync object to the direct child of a task in a workflow. The only restriction is that there must not be more than one child.

This script statement can also be used to assign a Sync object to the own task. The corresponding Sync object conditions can vary. Indicating the parameter RunID  is optional. A comma for this non-used parameter, however, has to be set in any case. The option Generate at runtime must not be activated in this case as the check for Sync objects is already finished when the script is being executed.

This script element does not affect Script objects. Script objects are complete after their generation stage and the synchronization process takes place at a later point in time.

Assigning a Sync object to a different task that has already been activated, is only possible with particular states. Either the task has not yet been started (system return codeThe value that represents the result of tasks and script functions. < 1540) or is still in a waiting condition (system return code between 1600 and 1700). Any other task statusThis represents the condition of a task (such as active, blocked, generating). results in a runtime error and the script is canceled.

Examples

In the first example, the Sync object "SYSTEM_0001_EXCLUSIVE_SYNC" is added to the jobAn Automation Engine object type for a process that runs on a target system. "ARCHIVE01". If the indicated actions cannot be executed, the job is canceled.

:SET &RUNNR# = GET_UC_OBJECT_NR(ARCHIVE01)
:ATTACH_SYNC &RUNNR#,"SYSTEM_0001_EXCLUSIVE_SYNC","USE","RELEASE","RELEASE","A"

In the second example, the Sync object is assigned to the directly succeeding task in the workflow.

:ATTACH_SYNC ,"SYSTEM_0001_EXCLUSIVE.SYNC","USE","RELEASE","RELEASE","A","NEXT_OBJECT"

 

See also:

Script element Description

SET_SYNC

Executes the defined action of a Sync object
GET_SYNC Queries the current condition or value of a Sync object

Script Elements - Reading or Modifying Objects

Sync Objects
System Return Codes of Executable 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