Versions Compared

Key

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

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

Question

What I would like is an example job that does the following:

...

Code Block
 ...
 if (FileName.FilterMatch1 = true)
 {
            Call Task FilterMatch1Execute();
 }
 elseif (FileName.FilterMatch2 = true)
 {
            Call Task FilterMatch2Execute();
 }
 ...

Answer

You set up a job chain, using file_order_source objects. These objects poll (Unix systems) or use the host computer's operating system (Windows) to monitor a specified directory. When a file is added to this directory a regular expression specified for the file_order_source object is used to test for a specific pattern in the file's name. A pattern match in the file name causes JobScheduler to generate an order for the job chain. This order will start at the node in the job chain, whose name has specified in JOE as the "start node" and that is also specified for the file_order_source configuration using the next_state attribute.

Note that JobScheduler uses regular expressions to carry out these tests, which allows more sophisitcated search patterns than so called "wildcards".

Configuration in JOE

The logic behind the job chain is shown in the following screen shot of the JOE "Diagram" tab:

...

  • The "NoNZ_checkSteadyState" source checks whether a file of type "zip" whose name starts with "08" or whether a file of type "pgp" whose name starts with "13" has been added to the directory;
  • The "NZ_checkSteadyState" source checks whether a file of type "pgp" whose name starts with a number between "01" and "18" (but not "08" or "13") has been added to the directory.

Configuration in XML

The two "checkSteadyState" jobs described above are started by file_order_source objects. Although notdirectly visible in JOE these are generated by JOE in the background and can be seen in lines 2 and 3 of the XML listing of the job chain (see below). The file_order_source object parameters have the following purpose:

...