Executing Objects: The Generation Stage

generate task at runtime,runtime,runtime stage,execution stages,execution steps

Executable objects go through four execution stages. The first one is the Executing Objects: The Activation Stage stage. After it has finished, the task enters the generation stage. Both the activation and the generation stages prepare the object for the execution, which takes place during the next (Executing Objects: The Processing Stage) 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

generate task at runtime,runtime,runtime stage,execution stages,execution steps

This graphic represents the generation time line and indicates when the most important steps take place:

(Click to expand)

Generation Stage In Detail - List

generate task at runtime,runtime,runtime stage,execution stages,execution steps

This list illustrates the order in which the individual generation steps take place:

  1. The generation stage starts.

  2. Generate Task at Activation time: The script is generated now.

    This list outlines the steps that take place when the script is generated:

    1. 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.

    2. 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.

    3. Variables are resolved.

    4. (Jobs) The script on the Pre Process page is generated.

    5. The Header Includes are processed.

    6. The script on the Process page is generated.

    7. (Jobs) JCL commands are generates and transferred to the Agent. The JCL can still be modified.

    8. 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 (JOBI) Objects in Headers and Trailers.

  3. 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.

  4. Job Group check.

    Is the object part of a Job Group?

  5. 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.

  6. 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.
  7. 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.

  8. 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.

  9. Generate Task at Runtime: The script is generated now

    This list outlines the steps that take place when the script is generated:

    1. 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 long before the scripts are generated.

    2. Agent Groups are resolved.
    3. Variables are resolved.
    4. (Jobs) The script on the Pre Process page is generated.
    5. The Header Includes are processed.
    6. The script on the Process page is generated.
    7. (Jobs) JCL commands are generates and transferred to the Agent.
    8. Trailer Includes are processed.

    For details about the individual steps, see Script Generation In Detail.

  10. Is the object a Job or a File Transfer?

    No: The task status is set to Active.

    Yes: The next check takes place.

  11. 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:

Generation Stage In Detail - Graphics

generate task at runtime,runtime,runtime stage,execution stages,execution steps

The following graphics illustrate the steps outlined in the previous list.

Preparing for Generation

generate task at runtime,runtime,runtime stage,execution stages,execution steps

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:

Graphic illustrating the validation checls and actions that tasks undergo when preparing for generation.

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

generate task at runtime,runtime,runtime stage,execution stages,execution steps

If the task reached this point in the generation with one of these statuses, the following validations and actions take place:

Graphic that illustrates the validation checks and actions that tasks undergo during generation when they have one of these statuses: Ready to Generate, Ready for Start, or Waiting for Manual Release

Steps for Tasks in Waiting for Predecessor Status

generate task at runtime,runtime,runtime stage,execution stages,execution steps

If the task reached the Waiting for Predecessor status, the following validations and actions take place:

Graphic that illustrates the validation checks and actions that tasks undergo during generation when they reach the Waiting for predecessor status.

Steps for Tasks in Waiting for Start Time Status

generate task at runtime,runtime,runtime stage,execution stages,execution steps

If the task reached the Waiting for start time status, the following validations and actions take place:

Graphic that illustrates the validation checks and actions that tasks undergo during generation when they reach the Waiting for start time status.

Steps for Tasks in Registered Status

generate task at runtime,runtime,runtime stage,execution stages,execution steps

If the task reached the Registered status, the following validations and actions take place:

Graphic that illustrates the validation checks and actions that tasks undergo during generation when they reach the Registered status.

Script Generation In Detail

generate task at runtime,runtime,runtime stage,execution stages,execution steps

These are the steps that take place when the script is executed:

  1. If the script contains :READ statements, they are called now. A request is displayed in the Requests view and you have to enter the necessary data. If you have defined standard values for the :READ statements, these values are used and no manual intervention is needed.

  2. 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.

  3. Object variables are resolved.

  4. (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.

  5. (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.

  6. (Only for Jobs) The header Includes and the related user Includes are processed.

  7. The script that is written on the Process page is processed.

    From now on it is not possible to modify the object attributes anymore.

  8. (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 Executing Objects: The Processing Stage 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.

  9. (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:

Graphic that illustrates the validation checks and actions that take place during generation when the scripts in Jobs are processed.

Next Stage

When the generation stage has finished, the task enters the Executing Objects: The Processing Stage stage.

See also: