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

Compare with Current View Page History

« Previous Version 53 Next »

Scope

  • JobScheduler now supports event handling using In-Condition and In-Condition for the jobs. see  JOC-712 - Getting issue details... STATUS
  • The support for the conditions feature fills the gap of having a backward dependency in the JobScheduler. 
  • The conditions for the jobs with the branch 1.13.0 includes a number of gaps: 
    • 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 an In-Condition that controls 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 break 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 an Out-Condition, which is checked after job execution. The Out-Condition includes the number of Expressions and depending on the result of the check the Out-Condition adds or deletes an Event that can be consumed/checked by Out-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 is available with JOC Cockpit to manage/edit the expression for the condition.
  • This documentation covers the new feature to create Job Streams which provides a backward dependency. It includes, how we can implement different In-Condition and In-Condition. 
  • 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-Condition, In-Condition, 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 color background. There is the status of a job in Job Stream. Each job status is represented with different border color.
      • Pending - Yellow 
      • Running - Green
      • Stop - Red


  • Out-condition

    • Out-condition includes a number of expressions which gets evaluated after the job execution and result in true or false. If an expression results in true then according to the Event List (Create Event or Delete Event) it adds or deletes the for the job. If the expression result is false then it stops the further execution as these Events are used by successor jobs as an In-Conditions for the jobs will not be fulfilled. 
    • The Out-Condition is represented by right inclined parallelogram with the background color grey. The border-color changes to green if the expression results in true. The text color of the expression also changes to green and black if the expression result is true or false respectively.


  • In-condition

    • In -condition includes the number of expressions which executes a Command to either start a Job execution or to write a log. If the expression result is true then it executes the Command, and if the result is false then it does not execute the Command.
    • The In-Condition are represented by left inclined parallelogram with the background color grey. The border-color changes to green if the expression results in true.  The text color of the expression also changes to green and black if the expression result is true or false respectively.

Implementation 

  • How to ...... Articles 
    • How to enable Job Streams functionality?
      •  There was an event handling mechanism that works as an add on to the JobScheduler. Event handler determines on which condition what jobs should be started. 
      • Now this "Job Streams" feature adds a capability to the product which allows graphical configuration of job dependencies.
      • This feature is provided by a JobScheduler Plugin. 

        <plugin java_class="com.sos.eventhandlerservice.plugin.SOSConditionsPlugin"/> 

      • The above plugin should be enabled during the installation of the JobScheduler.

    • How to edit conditions for job execution in Job Streams? 
    • How to insert expressions in Job streams? 
    • How to add event in Job Streams? 
    • How to remove the event in Job Streams? 
    • How to include the Job Streams feature? 
    • How to enable the JobScheduler Conditions plugin? 
    • What is Graphical view and where it is located? 

Use Cases

Use Case 1: Implement a simple backward dependency

  • job1 → job2 → job3 → job4


Use Case 2: Implement split & join

A simple Job Stream to implement the split and join might look like this:


Explanation

  • The name of the Job Stream is test.
  • The Job Stream includes two splits, at first job1 is split into job2 and job3, and then the job3 is split into job4 and job5.
  • The job1, when executed if the out-condition expression results to true then the event job1 is created.




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-Conditionreturncode:0job1







2.test-conditions-2test1job1In-Conditionjob1startjob: now




Out-Conditionreturncode:0event1










job2In-Conditionevent1startjob: now




Out-Conditionreturncode:0event2







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




Out-Conditionreturncode:0event3
  • Step-1


  • Step-2


  • Step-3




Use Case 4: Use job streams for monitoring

Use Case 5: Use job streams to analyze job execution problems


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

  • Links to other articles
    • How to split and sync jobs in a job chain
  • Links  to JIRA
    • JOC-712 - Getting issue details... STATUS





  • No labels