Scope
- Job Streams are a means to implement dependencies with jobs. This feature improves existing forward dependencies (job chains) by introducing backward dependencies (conditions).
- Job Streams bring a number of new objects to the user interface:
- Events
- Events are tokens that are created on-the-fly to signal execution of jobs. Such Events can be used later on by successor jobs to check conditions that result in the current job being executed or not.
- Global Events are the events that are created for the execution of jobs among any Master Cluster configuration. These are the tokens that are created on-the-fly to signal execution of jobs on another JobScheduler Master.
- In Conditions
- A job can have a number of In Conditions that control if the job will be executed. Therefore an In Condition includes a number of Expressions that are evaluated to become true or false. The result true will cause a job to start, the result false will not cause a job to start. Therefore a false result of an In Condition will put on hold the Job Stream, i.e. further execution of subsequent jobs.
- Expressions in In Condition typically check the existence of Events. A number of Events can be evaluated including logical operators such as And, Or.
- Out Conditions
- A job can have a number of Out Conditions that are checked after job execution. Out Condition includes a number of Expressions and depending on the result of the check an Out Condition adds or deletes an Event that can be checked by In Conditions of later jobs.
- Expressions in an Out Condition typically check the result of job execution, for example, checks the return code of job execution.
- Events
- A graphical representation of Job Streams is available with JOC Cockpit to monitor job execution and to manage conditions and events.
- Using the Job Streams view in JOC Cockpit offers three types of display
- The left symbol (highlighted) displays the graphical view that is used for the following explanations.
- The middle symbol displays the card view.
- the right symbol displays the list view similar to what you see from the Jobs view.
- Using the Job Streams view in JOC Cockpit offers three types of display
For a good understanding of Job Streams, the user should
know the technical terms like what is Job and Job Chain, etc. and know how to work with JobScheduler Master and JOC Cockpit.
- not start with this article if you are new to the JobScheduler. In this case please start with the Product Knowledge Guides.
- have basic knowledge of how to create jobs.
- FEATURE AVAILABILITY STARTING FROM RELEASE 1.13.0
Objects used by Job Streams
The Job Streams feature introduces a number of objects:
- Jobs
- Jobs are the basic unit for the processing of executable files (programs, scripts, commands, etc.).
- Jobs are represented with a rectangular shape and grey background color. The status of a job is visible with the Job Stream. Each job status is represented with a different border color.
- Pending - Yellow
- Running - Green
- Stopped - Red
Events
- Events are tokens that are created on-the-fly to signal execution results of jobs.
- The JobScheduler supports two types of events:
- Local Events
- Global Events
- Events are represented by a hexagon. An event has the following states:
- Exist - If the event exists then the background color changes to grey and the border style depends on two factors:
- Solid border → if the event is created by a job in the current Job Stream
- Dotted Border → if the event is created by a job in another Job Stream than the current.
- Not Exist - If the event does not exist then the background color is white.
- Exist - If the event exists then the background color changes to grey and the border style depends on two factors:
Out Conditions
- Out Conditions include a number of Expressions that are evaluated after job execution and that result in true or false. If an Expression results in true then according to the Event List (Create Event or Delete Event) it creates and/or deletes the events. If the Expression result is false then it puts on hold further execution of the job stream if these Events are used by In Conditions of successor jobs.
- Out Conditions are represented by right inclined parallelograms with a grey background color. The border color changes to green if the Expression results to true. The text color of the Expression also changes to green and black if the respective part of the Expression result is true or false.
In Conditions
- In Conditions include a number of Expressions that can result in executing a Command to either start a job or to write a log file entry. If the Expression result is true then it executes the Command, and if the result is false then it does not execute the Command.
- In Conditions are represented by left inclined parallelograms with a grey background color. The border color changes to green if the Expression results to true. The text color of the Expression changes to green and black if the Expression result is true or false respectively.
- In Conditions can be consumed or not consumed:
- An In Condition is defined as being consumed when the job has once started by the result of In Condition. The consumed In Condition is represented by a white background color.
- An In Condition is defined as being not consumed if it has not yet been used to start a job. The not consumed In Condition is represented by a grey background color.
Off-Page-Connector
- The Off-Page-Connector is an icon which is used to show whether there is a reference to another Job Stream then the current. The icon is represented by a pentagon at the top right corner of the In Condition or Out Condition.
- The Off-Page-Connector is displayed for an
- In Condition → if an Out Condition that is not part of the current job stream creates an event that is consumed by an expression in the In Condition.
- Out Condition → if an In Condition that is not part of the current job stream consumes an event that is created by the Out Condition
Implementation
Getting Started with Job Streams
Job Streams View GUI Representation
How to enable Job Streams functionality
How to add or edit Conditions to a job
How to add or remove an Event from a Job Stream
How to import and export Job Streams
Expressions for Conditions in Job Streams
Global Events
Use Cases
Use Case 1: Implement simple Backward Dependencies
- A Job Stream to implement a linear Backward Dependency could look like this:
Explanation
- The name of the Job Stream is job_stream1.
- The Use-Case job_stream1 is used to show a linear backward dependency.
- Here when the job1 runs it creates an event job1. The job2 gets executed automatically as it has an In Condition which checks whether the event job1 is created or not.
- Similarly the jobs job3 and job4 are started when the event job2 and job3 are created.
No. | Job Name | Condition | Expression | Command / Event |
---|---|---|---|---|
1. | job1 | In Condition | - | - |
Out Condition | rc:0 | job1 | ||
2. | job2 | In Condition | job1 | startjob: now |
Out Condition | rc:0 | job2 | ||
3. | job3 | In Condition | job2 | startjob: now |
Out Condition | rc:0 | job3 | ||
4. | job4 | In Condition | job3 | startjob: now |
Out Condition | rc:0 | job4 | ||
Use Case 2: Implement the Split & Join Workflow Pattern
A Job Stream to implement the split & join workflow pattern could look like this:
Explanation
- The name of the Job Stream is test.
- The Job Stream includes two split operations, at first job1 is split into job2 and job3, and then job3 is split into job4 and job5.
- The job1, when executed if the Out Condition results to true then the Event job1 is created.
No. | Job Name | Condition | Expression | Command |
---|---|---|---|---|
1. | job1 | In Condition | - | - |
Out Condition | rc:0 | job1 | ||
2. | job2 | In Condition | job1 | startjob: now |
Out Condition | rc:0 | job2 | ||
3. | job3 | In Condition | job1 | startjob: now |
Out Condition | rc:0 | job3 | ||
4. | job4 | In Condition | job3 | startjob: now |
Out Condition | rc:0 | job4 | ||
5. | job5 | In Condition | job3 | startjob: now |
Out Condition | rc:0 | job5 | ||
6. | job6 | In Condition | job4 and job5 | startjob: now |
Out Condition | rc:0 | job6 | ||
7. | job7 | In Condition | job2 and job6 | startjob: now |
Out Condition | rc:0 | job7 | ||
8. | job8 | In Condition | job7 | startjob: now |
Out Condition | - | - |
Use Case 3: Implement a Job Stream across Folders
An example to implement a job stream with jobs from different folders.
S. No. | Folder | Job Streams | Job Name | Condition | Expression | Command |
---|---|---|---|---|---|---|
1. | test-conditions-1 | test1 | job1 | In Condition | - | - |
Out Condition | rc:0 | job1 | ||||
2. | test-conditions-2 | test1 | job1 | In Condition | job1 | startjob: now |
Out Condition | rc:0 | |||||
job2 | In Condition | event1 | startjob: now | |||
Out Condition | rc:0 | event2 | ||||
3. | test-conditions-2 | test2 | job3 | In Condition | test1.event2 | startjob : now |
Out Condition | rc:0 | event3 |
Use Case 4: Use Job Streams for Job Monitoring
- The running job can be monitored in two ways:
- The border color of the job becomes green.
- The Task will be listed in the Running Task list and will be removed automatically once the job completed.
- The Task Queue tab is used to monitor the tasks that are queued for future execution:
- The Task History tab is used to monitor the history of tasks including information about successful or failed executions:
Explanations
- The name of the Job Stream is js1.
- The Job Stream includes two jobs, job1 and job2.
- The job1, when executed and completed causes the Out Condition to result to true and to create the Event eve1.
- After that, if the In Condition of job2 results to true then it will set job2 to the pending state as the In Condition of the job2 is configured for the command "startjob" with the parameter "now + 3600".
- Therefore, job2 will wait for it's start time 3600 seconds later.
- During this period, the task will be displayed in the Task Queue list and will be removed automatically once job2 will start.
- In this way, tasks can be monitored to be running, queued, failed or completed successfully.
S.No. | Job Name | Condition | Expression | Command |
---|---|---|---|---|
1. | job1 | In Condition | - | - |
Out Condition | rc:0 | eve1 | ||
2. | job2 | In Condition | eve1 | startjob: now + 3600 |
Out Condition | rc:0 | eve2 |
Roadmap
The Job Streams feature is subject to future improvement:
We will add editing capabilities for jobs and job-related objects in order to replace the JOE Job Editor.
- The XML Editor will be migrated to JOC Cockpit.
References
Further Resources
Pages
- Getting Started with Job Streams
- How to enable the Job Streams Functionality
- How to add or edit Conditions to a Job
- How to add or remove Events from a Job Stream
- How to import and export Job Streams
- Expressions for Conditions in Job Streams
- Global Events
- Job Streams View GUI Representation
- Job Stream Starter
- Scope of Events
- Run-time of jobs in a Job Stream
- Additional Features with 1.13.5
Navigation