Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Conversion corrections

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

This example shows a simple method to control job starts using time and file-based events. The logic behind this example is of a time event AND a file event.

...

Code Block
languagehtml/xml

 <run_time  let_run="no">
     <period  single_start="12:30"/>
 </run_time>

...

Code Block
languagehtml/xml

 <params >
     <param  name="file" value="c:\temp\ProcessFileTest.dat"/>
 </params>

...

If the file is not present then this job will be restarted every minute up to a maximum of 30 times. If no file is found the order will end in error. If a file is found, JobScheduler will continue to process the job chain.
<!--In the example the this means:

  • the (dummy) changeme job will be executed
  • the "DeleteFile" job will delete the ProcessFileTest.dat file
  • the "JobChainEnd" job will be executed.-->

The XML for ExistsFile job is:

Code Block
languagehtml/xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<job  title="Check and Wait for a file or files" order="yes" stop_on_error="no" name="ExistsFile">
    <settings >
        <log_level ><![CDATA[debug9]]></log_level>
    </settings>

    <description >
        <include  file="jobs/JobSchedulerExistsFile.xml"/>
    </description>

    <params />

    <script  language="java" java_class="sos.scheduler.file.JobSchedulerExistsFile"/>

    <delay_order_after_setback  setback_count="10" is_maximum="no" delay="00:01:01"/>
    <delay_order_after_setback  setback_count="30" is_maximum="yes" delay="0"/>

    <run_time />
</job>

...