You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 82 Next »

Scope

  • JobScheduler supports event handling using In Conditions and Out Conditions for jobs, see  JOC-712 - Getting issue details... STATUS
  • Introducing job streams provides better support for backward dependencies with the JobScheduler. 
  • The job streams bring a number of new objects to the user interface: 
    • Event
      • 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.
    • In Condition
      • 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 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 Condition
      • A job can have a number of Out Conditions that are checked after job execution.Out Condition include 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.
    • Graphical representation:
      • The graphical representation of job streams is available with JOC Cockpit to manage conditions and expressions..
  • The user should:

    • Know the technical terms like what is Job, Event and Job Chain, etc. and working of the JobScheduler and JOC Cockpit. 

    • Not start with this article if he/she is new to the JobScheduler. 
    • Have the basic knowledge on how to create the jobs.

Motivation

  • What is this feature good for? 
    • The end users can implement backward dependency for jobs using In Conditions, Out Conditions, write the expressions and can add or remove events. 
    • This feature allows graphical configuration of job dependencies. 
  • What problem does it solve? 
  • This feature was developed to add better backward dependencies to JobScheduler. 
    • Backward dependenciesThe JobScheduler comes with a number of solutions to support backward dependencies for jobs and job chains. 
      • Check the job and job chain history for previously executed jobs and orders. 
      • Synchronize job chains. 
      • Job Streams. 
    • Forward dependenciesThe JobScheduler comes with built-in features for implementing forward dependencies for jobs and orders. 
      • Basic dependencies are implemented by the Objects for the Jobs, Job Chains and Orders. 
      • Successor jobs can be made to depend on the code returned by the current job. 
      • Create successor orders for job chains depending on the return code of the current job chain node. 

Feature Availability

FEATURE AVAILABILITY STARTING FROM RELEASE 1.13.0

Feature

The Job Streams include various feature:

  • 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. There is the status of a job in 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. 
    • Events are represented by a hexagon. The event has three status:
      • Exist - If the event exists then the background color changes to grey and the border depends on two factors:
        • Solid border → When the event is created by the job in the same Job Stream
        • Dotted Border → When the event with the same name already exists in some other Job Stream
    • Not Exist - It the event does not exist then the background color is white.
  • Out Condition

    • 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 or deletes the event. 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 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 Condition

    • 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 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 Condition can be consumed and unconsumed.
    • The In Condition is defined as consumed when the job has once started by the result of In Condition. The consumed In Condition is represented by a white color background.
    • The In Condition is defined as unconsumed if it is not yet used to start a job. The unconsumed In Condition is represented b grey color background.


  • Off-Page-Connector

    • The Off-Page-Connector is an icon which is used to show the reference whether the defined In Condition or Out Condition is from the same Job Stream or is from another Job Stream. 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 on an:
      • In Condition → When the out condition creates an event that is consumed by an expression in an In Condition that is not part of the actual job stream.
      • Out Condition → When the In Condition consumes an event that is created by an Out Condition that is not part of the actual job stream.


Implementation 

Use Cases

Use Case 1: Implement a simple Backward Dependency

  • A simple Job Stream to implement a linear Backward Dependency may 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






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 a Split & Join Workflow Pattern

A simple Job Stream to implement the split & join workflow pattern might 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

A simple example to implement a job stream across folders and Job Streams.

S. No.FolderJob StreamsJob NameConditionExpressionCommand







1.test-conditions-1test1job1In Condition--




Out Conditionrc:0job1







2.test-conditions-2test1job1In Conditionjob1startjob: now




Out Conditionrc:0



job2In Conditionevent1startjob: now




Out Conditionrc:0event2







3.test-conditions-2test2job3In Conditiontest1.event2startjob : now




Out Conditionrc:0event3


Use Case 4: Use Job Streams for Job Monitoring

  • A simple Job Stream to monitor the pending tasks may look like this:


Explanation

  • The name of the Job Stream is js1.
  • The Job Stream includes two jobs, "job1" and "job2".
  • The job1, when executed if the Out Condition results to true then the Event eve1 is created.
  • After that, if the In-Condition of the job2 results true then it will set the job2 into the pending state as the In-Condition of the job2 is configured with a command "startjob" with the parameters "now + 3600".
  • Therefore, the job2 will wait for it's time to get execute after 3600 seconds.
  • During this period, the task will be shown in the Task Queue list and will get removed automatically once the job2 will be executed.
  • In this way, the tasks can be monitored whether it's in running state, pending state, got failed or completed successfully.


S.No.Job NameConditionExpressionCommand





1.job1In Condition--


Out Conditionrc:0eve1





2.job2In Conditioneve1startjob: now + 3600


Out Conditionrc:0eve2


Roadmap

  • This feature is subject to future improvement:

    • Done: User can add and remove Events from the graphical representation. 

    • Add editing capabilities for jobs in order to replace JOE 

  • There will be a new tab named as "Job Streams" in the JOC Cockpit which will replace the JOE in the future. 

  • This "Job Streams" contains the working and explanation of the Jobs and Job Chains. 

  • User can create a Job by just drag and drop.  

  • Provide export functionality to display (print) job streams in PDF, PNG 


References





  • No labels