Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Scope

  • Components for dependency handling
  • Download & Deployment information

Download & Deployment

  • JobScheduler
    • Display feature availability
      EndingWithRelease1.8
      StartingFromRelease1.7

    • This feature requires Java 1.7 to be available. It will not work with Java 1.8 and therefore not with JobScheduler releases starting from 1.9.
    Patch
    • This patch is available from the attached file com.sos.csi.patch.jar

    • To deploy this patch

    • copy the jar file to the directory $SCHEDULER_HOME/patch (create this folder if is does not existi)
    • open the file $SCHEDULER_DATA/config/factory.ini
    • navigate to the section java
    • change the class_path configuration to
      class_path = ${SCHEDULER_HOME}/patch/com.sos.csi.patch.jar:${SCHEDULER_HOME}/lib:....
    • restart JobScheduler
  • Dependency
    • Attached archive contains the below mentioned files for the dependency folder: dependency.zip
    • The archive should be extracted to a subfolder of the JobScheduler live/sos directory, i.e. g. $SCHEDULER_DATA/config/live/csisos/dependency.

...

Global Setting:

...

 scheduler.ignore_sync_jobs_in_stopped_jobchains

  • Dependency handling requires This patch contains the new option scheduler.ignore_sync_jobs_in_stopped_jobchains
  • Enabling this option by setting the scheduler variable in the configuration file $SCHEDULER_DATA/scheduler.xml to true will ignore synchronization nodes that are part of stopped job chains for all instances of synchronization jobs.

    Code Block
    languagexml
    titleConfiguration in file scheduler.xml
    <spooler>
        <config>
            <param name="scheduler.ignore_sync_jobs_in_stopped_jobchains" value="true"/>
    ...
  •  It is also possible to enable this option per job by adding a job parameter like this:

    Code Block
    languagexml
    titleConfiguration by job parameter
    <job  order="yes">
        <params >
            <param  name="scheduler.ignore_sync_jobs_in_stopped_jobchains" value="true"/>
        </params>
    ...

Folder: dependency

  • This folder provides the components required to implement dependency handling.
  • This folder should be located below the JobScheduler live directory.

Function Set: dependency.js

  • This function set provides basic capabilities for dependency checking
  • This function set is used by the following job Monitor Scripts:
    • jobnet_check_predecessor.js
    • jobnet_check_successor.js

Job: jobnet_check_predecessor.job.xml

Usage

  • Sample job for a job step that provides dependency checking.
  • This job is added to the beginning of a job chain.
  • This job step is added the job node state jobnet_start.

Sample

Job Implementation

  • The job implements an arbitrary job body.
  • Dependency handling is implemented by the Monitor Script.
    • The Monitor Script includes two files:
      • jobnet_check_predecessor.js
      • dependency.js
    • When creating individual job implementations then no invidual implementation of the Monitor Script should be effected but the below-mentioned script files should be included as they are subject to future improvement.

...

Code Block
languagexml
titleJob: jobnet_check_predecessor.job.xml
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>
<job  order="yes" stop_on_error="no" title="check jobnet predecessors">
    <script  language="javax.scriptjava:rhinojavascript">
        <![CDATA[
spooler_log.info("checking jobnet predecessors");
        ]]>
    </script>
    <monitor  ordering="0" name="monitor">
        <script  language="javax.scriptjava:rhinojavascript">
            <include  file="config/live/csisos/dependency/jobnet_check_predecessor.js"/>
            <include  file="config/live/csisos/dependency/dependency.js"/>
        </script>
    </monitor>
    <run_time />
</job>

...

Code Block
languagejs
titleMonitor Script: jobnet_check_predecessor.js
collapsetrue
function spooler_process_after( spooler_process_result ) {

    spooler_log.info( "spooler_process_after(): checking jobnet predecessor" );


    if ( spooler_process_result ) {
        // check if predecessor job chains exists and will start in period
        if ( isPredecessorJobChainInPeriod() ) {
            spooler_log.info( "spooler_process_after(): predecessor job chain will start later in period, order execution postponed, moving order to final state: " + getStateSkip() );
            var order = spooler_task.order();
            order.set_state( getStateSkip() );
        } else {
            spooler_log.info( "spooler_process_after(): no predecessor job chain found for consideration that will start later in period, order is continued" );
		}
    } else {
        spooler_log.info( "spooler_process_after(): no predecessor checking due to failed job processing" );
    }


    return spooler_process_result;
}

 

Job: jobnet_check_successor.job.xml

Usage

  • Sample job for a job step that provides dependency checking.
  • This job is added to the end of a job chain.
  • This job step is added the job node state jobnet_end.

Sample

  • see job jobnet_check_successor from the above screenshot

Job Implementation

  • This job implements an arbitrary job body.
  • Dependency handling is implemented by the Monitor Script.
    • The Monitor Script includes two files:
      • jobnet_check_successor.js
      • dependency.js
    • When creating individual job implementations then no invidual implementation of the Monitor Script should be effected but the below-mentioned script files should be included as they are subject to future improvement.

...

Code Block
languagexml
titleJob: jobnet_check_successor.job.xml
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>
<job  order="yes" stop_on_error="no" title="check jobnet successors">
    <script  language="javax.scriptjava:rhinojavascript">
        <![CDATA[
spooler_log.info("checking jobnet successors");
        ]]>
    </script>
    <monitor  ordering="0" name="monitor">
        <script  language="javax.script:rhino">
            <include  file="config/live/csisos/dependency/jobnet_check_successor.js"/>
            <include  file="config/live/csisos/dependency/dependency.js"/>
        </script>
    </monitor>
    <run_time />
</job>

...

Code Block
languagejs
titleMonitor Script: jobnet_check_successor.js
collapsetrue
function spooler_process_after( spooler_process_result ) {

    spooler_log.info( "spooler_process_after(): checking jobnet successor" );


    if ( spooler_process_result ) {
        // start orders for successor job chains
        var numOfOrders = startSuccessorJobChains();
        if ( numOfOrders > 0 ) {
            spooler_log.info( "spooler_process_after(): " + numOfOrders + " orders for successor job chains started" );
        } else {
            spooler_log.info( "spooler_process_after(): no successor job chain found for consideration, no orders started" );
        }
    } else {
        spooler_log.info( "spooler_process_after(): no successor checking due to failed job processing" );
    }


    return spooler_process_result;
}

Anchor
jobnet_reset_job_chains
jobnet_reset_job_chains
Components for Job Chain Resets

  • The following components are included with the folder dependency

Job Chain: jobnet_reset_job_chains.job_chain.xml

  • The job chain makes use of only one job jobnet_reset_job_chains.job.xml, see below.

Job: jobnet_reset_job_chains.job.xml

Usage

  • Standard job that is used to toggle the state of job chains for dependency checking. Job chains present one of these states:
    • running: the job chain is active and dependency checking is performed
    • stopped: the job chain is inactive, no dependency checking is performed.

Job Implementation

  • This job implements the operations to toggle the state of one or multiple job chains.
  • The effective processing is implemented by JavaScript.

...

Code Block
languagexml
titleJob: jobnet_reset_job_chains.job.xml
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>

<job  order="yes" stop_on_error="no" title="reset job chaines to unstopped or stopped state">
    <script  language="javax.scriptjava:rhinojavascript">
        <include  file="config/live/csi/dependency/jobnet_reset_job_chains.js"/>
        <include  file="config/live/csi/dependency/dependency.js"/>
    </script>
    <run_time />
</job>

...

Code Block
languagejs
titleJavaScript: jobnet_reset_job_chains.js
collapsetrue
function spooler_process( ) {
    spooler_log.info( "spooler_process(): reset job chains in jobnet" );
    
    var numOfModifiedJobChains = toggleJobChainState();
    
    spooler_log.info( "spooler_process(): " + numOfModifiedJobChains + " job chains modified" );
    return true;
}

Order: jobnet_reset_job_chains.order.xml

  • This is a sample order that shows how job chains could be selected for activation and deactivation.
  • Parameters
    • operation: the toggling operation
      • Values
        • activate: modify the state of stopped job chains to running
        • deactivate: modify the state of running job chains to stopped
      • Default Value
        • activate
    • input_list:
      • Values
        • A comma separated list of job chain paths
      • Default Value
        • none
    • input_file
      • Values
        • the location of a file that contains one job chain path per line
      • Default Value
        • none
  • Behaviour
    • Without parameters being specified all job chains will be activated.
    • Without the parameters input_list and input_file being specified the operation is applied to all job chains.
    • Should in addition to the parameter input_list the  parameter an input_file be specified then both specifications of job chains are merged.

...

Code Block
languagexml
titleOrder: jobnet_reset_job_chains.order.xml
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>

<order  title="reset job chaines to unstopped or stopped state">
    <params >
        <param  name="operation" value="deactivate"/>
        <param  name="input_list" value="csijobnet/examples/JobChain_B/job_chain_B,csi/examples/JobChain_D/job_chain_D"/>
        <param  name="input_file" value="csijobnet/jobnet_reset_job_chains.txt"/>
    </params>
    <run_time  let_run="no">
        <period  single_start="24:00"/>
    </run_time>
</order>

...

Notes

  • Dependency Hnandling Scripts and Monitor Scripts are
    • implemented for the Rhino scripting engine up to Java 1.7
    . Adjustments might be required for
    • with JobScheduler release 1.7 and 1.8.
    • not available with the Nashorn engine that is introduced with Java 1.8
    • and is required for JobScheduler release 1.9.