Scope

The Starter is used to start a Job Stream. The Starter starts a Job Stream based on the run-time provided to it (the Starter can also be started manually using the "Start Now" operation from it's action menu). The Starter creates an instance of the Job StreamEach instance has its own Instance ID. Events are created per instance. An event created with e.g. Instance A does not have access to Instance B, the two instances are independent even if they are used in the same Job Stream.

FEATURE AVAILABILITY STARTING FROM RELEASE 1.13.4

Advantages of Job Stream Starter


The Starter adds a number of advantages to Job Streams:

  1. Assigning Run-time to the Starter
    The Job Stream Starter allows assigning a run-time to the Job Stream. Earlier it was not possible to run a Job Stream more than once without using the "Reset Job Stream" operation. Now we can run the Job Stream more than once, e.g. every 5 minutes. We don't need to specify the run-time with the first job of the Job Stream to make other jobs in the Job Stream start accordingly. 
    A Job Stream can have more than one Starter and can have different run-times assigned to each Starter.
  2. Assigning Parameters to the Starter
    The Job Stream Starter can carry a set of parameters, i.e. we can assign parameters to the Starter and the parameters will be available to each job in the Job Stream. The parameters can only be accessed by the job in the Job Stream instance which is created by this Starter. For example, a parameter [name': 'value1'] will be available for each job of the Job Stream if it is assigned to the Starter. Without the Starter, we need to define the parameters for each job in the Job Stream.
  3. Starting more than 1 Job at a specific time
    The Job Stream Starter is assigned the first job in the Job Stream. If there is more than one job that should start at begin of the Job Stream at the same time then we can assign the Starter a number of jobs that will be executed in parallel at the specified run-time.
  4. Specific Job Stream History for each run
    The Job Stream when executed with the Starter creates an instance with its own Instance ID. The Job Stream history of each instance run is stored individually.
  5. Access Events within the scope of a Job Stream run 
    The Job Stream Starter instance is the scope for which events are created. Events can be accessed as long as the Job Stream execution is not completed, i.e. we can access the event for the lifetime of a Job Stream run.
    Please refer to Scope of Events for reference.
  6. Accessing Events from another Job Stream 
    Until release 1.13.3 the event eventA, when created in a Job Stream jsStreamA, can be consumed by all In Conditions in all Job Streams using the expression eventA. To access the events from another Job Stream in release 1.13.4 we have to reference the Job Stream, i.e. when using the eventA created in jsStreamA it has to be accessed with the expression jsStreamA.eventA.

How to create a Job Stream Starter

The Starter can be added in two ways. It can be added either when creating the Job Stream or it can be added to an existing Job Stream.

Adding the Starter when creating the Job Stream

  1. Login to the JOC Cockpit, switch to the Job Streams tab.

  2. Click on the button Add Job Stream to add a Job Stream.


  3. A Window opens to create the Job Stream 


  4. Add details for the Job Stream.
    • Job Stream: Enter the Job Stream name.
    • Enter the Job Stream Starter detail:
      • Title: Enter the Starter title.
      • Add the job details:
        • Job Name: Select a job from the drop-down menu that will be assigned the Starter.
        • Delay: This accepts a value in seconds. The delay refers to the time after which the job will be executed when the Starter is started.
      • Add another Job: A Job Stream starter can have more than one job. Click Add another job to add details of another job that will be assigned the Starter.
      • Parameter: Click on Parameter to add Job Stream parameters. Refer to How to add parameters to the Job Stream Starter for reference.
      • Run-Time: Click on Run-time to add a run-time to the Job Stream. Refer to How to add a run-time to a Job Stream Starter for reference.

  5. Click the Submit button to add the Job Stream.

  6. For example, with the below details a Job Stream will be created with a name jobstream1 with a starter name JSStarter. The Starter includes on job /testcase1/job1 with a delay of 10 seconds i.e. when the Starter is started then the job /testcase1/job1 will be executed 10 seconds later.




Note: A Job Stream requires a minimum of one Starter. We cannot create a Job Stream without a Starter.

Adding a Starter to an existing Job Stream

  1. Click on the action menu of the job stream name from the right panel and select Add New Starter.


  2. A window opens to create a new Starter.


  3. Add details for the Starter and click the Submit button.

  4. For example, if we add another Starter to an existing Job Stream jobstream1 which we created in the above example with the details Title: JSStarter2, Job Name: /testcase1/job2 then the Starter will be added to the Job Stream like this.


    Note: We can add two or more Starters to the same job.


How to start the Job Stream Starter

When a Job Stream Starter is started then it creates a new instance. This instance has its own events, i.e. if the same Job Stream is executed twice then two instances will be created with a timestamp (say instance A and instance B). If any event is created in instance A then this does not affect instance B.

Selecting an Instance from the List

The Starter when started creates an instance. You can see the instances when using the Started At date rangeIt will display the list of instances created between the dates specified by From and To.

How to add parameters to a Job Stream Starter

The parameters added to a Starter are accessible to all jobs in the Job Stream. Each job in an instance can access the parameters assigned to the Starter throughout the Job Stream run. 

The parameters can be added in two ways: they can be created when creating the Job Stream or they can be added to an existing Job Stream.

Note: If a job contains its own parameters then both parameter sets (from Starter and from job) can be used by the job at the time of execution.

Adding parameters when creating a Job Stream Starter

  1. Login to the JOC Cockpit, switch to the Job Streams tab.

  2. Click the button Add Job Stream to add a new Job Stream.


  3. A window to create a Job Stream opens. After adding the details for Job Stream, Starter, Job Name, Delay (if required) click the Parameter button.



  4. A new pop-up window will open. Add the parameters as required and click the Close button. 



  5. The parameter is added to the Starter. Click the Submit button. 

Adding Parameters to an existing Starter

If you want to add parameters to an existing Starter then please follow the below steps.

  1. Login to the JOC Cockpit, switch to the Job Streams tab.
  2. Click on the Job Stream for which the Starter is available. 



  3. When hovering with the mouse over the Starter (JSStarter) the action menu will appear.



  4. Click the action menu and select the Edit operation.



  5. A pop-up window will open. Click the Parameter button to add parameters to the Job Stream. 



  6. A pop-up window will open to add parameters to the Job Stream. Click the Close button.



  7. Click the Submit button to save changes to the Job Stream.



How to add a Run-time to the Job Stream Starter

The run-time added to a Starter is used to start the Job Stream automatically at the given time. 

Note: If a job in a Job Stream contains its own run-time and the Starter starts the execution then it waits for the run-time of the job. But as the job will be executed by JobScheduler Master its execution will not be known to the Job Stream instance, i.e. the events created by this job cannot be accessed by this instance.

Adding a run-time when creating a Job Stream

  1. Login to the JOC Cockpit, switch to the Job Streams tab.

  2. Click the button Add Job Stream to add a new Job Stream.


  3. A window opens to create a Job Stream. After adding the details for Job Stream, Starter, Job Name, Delay (if required) click the Run-Time button.



  4. A pop-up window will open to add a run-time to the Job Stream. Add the run-time as required and click the Submit button. 



  5. The run-time is added to the Starter.

     

Add run-time to existing Starter

If you want to add a run-time to an existing Starter please follow the below steps.

  1. Login to the JOC Cockpit, switch to the Job Streams tab.

  2. Click on Job Stream for which a Starter is available. 


  3. When hovering with the mouse over the Starter (JSStarter) the action menu will appear.



  4. Click the action menu and select the Set Run-time operation.

     

  5. A pop-up window will open to add a run-time to the Starter. Click the Submit button to save your changes. 



  6. The run-time is added to the Starter.


Note: The run-time works in the same way as for jobs and orders. If a calendar is assigned without a period for the job at the point in time when the Job Stream is running then the job will be skipped. The Out Condition will be executed as if the job had completed with exit code 0. Refer to the article Run-time for jobs in a Job Stream for further reference.

History of Instances

The tab Instances displays Job Stream instances that are executed for the selected date range. Clicking on an instance will open the Task History tab for that instance.



  • No labels