Generation
Executable objects go through four execution stages. The first one is the Activation stage. After it has finished, the task enters the generation stage. Both the activation and the generation stages prepare the object for execution, which takes place during the next (Processing) stage.
One of the steps that take place during this stage is the generation of the script (if available). When you configure an object, you must decide the exact moment during the generation stage in which the script will be generated. You do this on the Attributes page by setting either Generate Task at: Activation time or Generate Task at: Runtime.
This setting has an essential role in the execution of the object.
-
Generate Task at: Activation time
The script is generated at the beginning of the generation stage
-
Generate Task at: Runtime
The script is generated later in the generation stage
It is important to understand the sequence in which the generation steps happen, particularly so if you use script elements to enhance the logic of your Jobs.
Examples:
-
Assigning a Sync object through the :ATTACH_SYNC statement to an already activated task only works if the script is generated beforethe Sync check step takes place (Generate at Activation option).
-
Using :READ statements also only works with the Generate at Activation option, when the script is generated at the beginning of this phase. If you use them and select Generate at Runtime, the script is processed after the system calls the :READ statements; as a result, the resulting requests are never displayed.
To explain what happens during the generation stage, this topic provides both lists and graphics. First, a list specifies and briefly describes the individual steps. Then, various graphics illustrate these steps.
For more information about the Generate Task at: Activation time/Runtime options, see:
Generation Stage Overview
This graphic represents the generation time line and indicates when the most important steps take place:
(Click to expand)
Generation Stage In Detail - List
-
The generation stage starts.
-
Generate Task at Activation time: The script is generated now.
This list outlines the steps that take place when the script is generated:
-
If available, PromptSets and :READ statements are called.
Note: Modifying the default values of PromptSets via scripts is not possible. This is because PromptSets are called immediately before the script is generated.
-
Agent Group is resolved.
Note: If the Agent Group cannot be resolved because no agent is available and a Job is set with Generation at Activation, the activation timestamp is updated to the moment it can be resolved.
-
Variables are resolved.
-
(Jobs) The script on the Pre Process page is generated.
-
The Header Includes are processed.
-
The script on the Process page is generated.
-
(Jobs) JCL commands are generates and transferred to the Agent. The JCL can still be modified.
-
Trailer Includes are processed.
For details about the individual steps, see Script Generation in Detail.
For more information about header and trailer Includes, see Include Objects in Headers and Trailers.
-
-
Workflow check.
Does the object run in a Workflow?
-
Yes: The task status is set to Waiting for predecessor.
Workload balancing takes place. All tasks in the Workflow are active and the Agents are allocated, so the workload can now be balanced.
Tasks with this status undergo additional processing steps. For more information, see Steps for Tasks in Waiting for Predecessor Status.
-
No: Go to next step.
-
-
Job Group check.
Is the object part of a Job Group?
-
Yes: The task status is set to Registered.
Tasks with this status undergo additional processing steps. For more information, see Steps for Tasks in Registered Status.
-
No: The task status is set to Ready to generate.
Tasks with this status undergo additional processing steps. For more information, see Steps for Tasks in Ready to Generate, Ready to Start, or Waiting for Manual Release Status.
-
-
Manual release check.
Is the task released?
No: Task status is set to Waiting for manual release. Tasks with this status undergo additional processing steps. For more information, see Steps for Tasks in Ready to Generate, Ready to Start, or Waiting for Manual Release Status.
Yes: Go to next step.
-
Queue assignment.
Is the Queue active?
-
No: The task status is set to STOP - Queue processing has been stopped.
-
Yes: Are there free Queue slots available?
- No: Task status is set to Waiting for Queue slots.
- Yes: Go to next step.
-
-
Sync check.
Does the object have a Syn object associated to it?
-
No: Go to next step.
-
Yes: The Sync condition is evaluated.
The status of tasks that are waiting for the Sync condition to be met is set to Waiting for Sync.
When the Sync condition is met, processing continues with the next step.
-
-
Maximum number of simultaneous executions check.
If simultaneous executions are allowed, the order in which tasks are executed is based on the Automation Engine priority, their completion rate and FIFO.
If the number of allowed simultaneous executions is exceeded, the task status is set to Waiting for start of parallel task.
-
Generate Task at Runtime: The script is generated now
This list outlines the steps that take place when the script is generated:
-
If available, PromptSets and :READ statements are called.
Note: Modifying the default values of PromptSets via scripts is not possible. This is because PromptSets are called immediately before the script is generated.
- Agent Groups are resolved.
- Variables are resolved.
- (Jobs) The script on the Pre Process page is generated.
- The Header Includes are processed.
- The script on the Process page is generated.
- (Jobs) JCL commands are generates and transferred to the Agent.
- Trailer Includes are processed.
For details about the individual steps, see Script Generation in Detail.
-
-
Is the object a Job or a File Transfer?
No: The task status is set to Active.
Yes: The next check takes place.
- The generation stage ends.
Note: Not all types of scripts are processed in the generation stage. The following types of scripts are processed at later stages:
-
Event processes and child post processes are executed in the processing stage,
For more information, see Events (EVNT) and Child Post-Process Page.
-
Post Processes are processed in the completion stage.
For more information, see Post Process Page.
Generation Stage In Detail - Graphics
The following graphics illustrate the steps outlines in the previous list.
Preparing for Generation
Immediately after the activation stage has finished, the task is either waiting for user input or it enters the generation stage. The following graphic illustrates in more detail what happens at the beginning of the generation stage:
At this point, the task can have one of the following statuses:
- FAULT already running
- Waiting for predecessor
- Registered
- Ready for start
Steps for Tasks in Ready to Generate, Ready to Start, or Waiting for Manual Release Status
If the task reached this point in the generation with one of these statuses, the following validations and actions take place:
Steps for Tasks in Waiting for Predecessor Status
If the task reached the Waiting for Predecessor status, the following validations and actions take place:
Steps for Tasks in Waiting for Start Time Status
If the task reached the Waiting for start time status, the following validations and actions take place:
Steps for Tasks in Registered Status
If the task reached the Registered status, the following validations and actions take place:
These are the steps that take place when the script is executed:
-
If available, PromptSets and :READ statements are called.
Note: Modifying the default values of PromptSets via scripts is not possible. This is because PromptSets are called immediately before the script is generated.
-
The Agent Group is resolved.
If the object runs in an Agent Group, the specific Agent on which it will run is assigned.
Note: Since the Agent Group resolution happens at the very beginning of the script generation, it is not possible to set it through script elements.
-
Object variables are resolved.
-
(Only for Jobs) The script that is written on the Pre Process page is processed.
At this point, it is still possible to modify the object attributes (Agent, Login objects) through script elements that you enter on the Pre-Process page.
-
(Only if the object is executed manually and with the Generate Task at: Activation time option)
The attributes dialog that lets you modify the object configuration is displayed.
-
(Only for Jobs) The header Includes and the related user Includes are processed.
-
The script that is written on the Process page is processed.
From now on it is not possible to modify the object attributes anymore.
-
(Only for Jobs) JCL commands are generated and transferred to the Agent. The commands are then ready to run on the target computer during the Processing stage.
Important!
-
The commands do not run on the target computer during the generation stage.
-
The generated JCL can be modified until the Job starts on the target computer. However, these affect the current execution only.
The report contains the original JCL and the modified one with an extra line indicating who changed the content.
-
-
(Only for Jobs) The Trailer Includes and the related user Includes are processed.
This image illustrates what happens during script processing in the generation phase:
Next Stage
When the generation stage has finished, the task enters the Processing stage.
See also: