...
Checks for the existence of a file, a directory or for specific files inside of a directory.
This job is creating a result set. A result set contain the names of all files which are selected as specified by the filter criteria. The content of the result set is returned as a parameter, but can be written to a file, too.
Parameters, which are useful for creating a result-set, are
...
An example for a job-xml file:
Code Blocknoformat |
---|
<job ordeh1. order='no' > <params> <param name=" [[file|#file|file]]" "valuh1. value="." /> <param name=" [[#filefile_spec|file#file_spec]]" "valuh1. value="" /> <param name=" [[gracious|#gracious|gracious]]" "valuh1. value="false" /> <param name=" [[#maxmax_file_age|max#max_file_age]]" "valuh1. value="0" /> <param name=" [[#maxmax_file_size|max#max_file_size]]" "valuh1. value="-1" /> <param name=" [[#minmin_file_age|min#min_file_age]]" "valuh1. value="0" /> <param name=" [[#minmin_file_size|min#min_file_size]]" "valuh1. value="-1" /> <param name=" [[#skipskip_first_files|skip#skip_first_files]]" "valuh1. value="0" /> <param name=" [[#skipskip_last_files|skip#skip_last_files]]" "valuh1. value="0" /> <param name=" [[#countcount_files|count#count_files]]" "valuh1. value="false" /> <param name=" [[#createcreate_order|create#create_order]]" "valuh1. value="false" /> <param name=" [[#createcreate_orders_for_all_files|create#create_orders_for_all_files]]" "valuh1. value="false" /> <param name=" [[#orderorder_jobchain_name|order#order_jobchain_name]]" "valuh1. value="" /> <param name=" [[#nextnext_state|next#next_state]]" "valuh1. value="" /> <param name=" [[#onon_empty_result_set|on#on_empty_result_set]]" "valuh1. value="empty" /> <param name=" [[#expectedexpected_size_of_result_set|expected#expected_size_of_result_set]]" "valuh1. value="0" /> <param name=" [[#raiseraise_error_if_result_set_is|raise#raise_error_if_result_set_is]]" "valuh1. value="0" /> <param name=" [[#resultresult_list_file|result#result_list_file]]" "valuh1. value="empty" /> </params> <script language="java" java_class=clash1. "sos.scheduler.file.JobSchedulerExistsFile" /> </job> |
This job can be used standalone, as a single job, or as an order driven job in a jobchain as a jobchain node. Parameters are respectively accepted as job- or as order-parameters.
A job can process multiple parameters that are analysed when the job starts. Parameters are defined in the configuration of the job or of the order. Parameters can be submitted by API methods, as well. Parameters are optional or mandatory and may contain default values.
This job is creating a result set. A result set contain the names of all files which are selected as specified by the filter criteria. The content of the result set is returned as a parameter, but can be written to a file, too.
Parameters, which are useful for creating a result-set, are
...
This job can create file-orders. It can be specified that a file-order is created for the first file of the result set only or for all files of the result set.h3.
Parameter used by JobSchedulerExistsFile
Panel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
...
Parameter <span id"file">file<span> File or Folder to watch for
...
File or Folder to watch for
Checked file or directory
Supports masks for substitution in the file name and directory name with format strings that are enclosed by {*} and {*} . The following format strings are supported:
Code Blocknoformat |
---|
[date: date format ] '''{*}date format'''{*} must be a valid Java data format string, e.g. '''yyyyMMddHHmmss'''{*}yyyyMMddHHmmss{*} , '''{*}yyyy-MM-dd.HHmmss'''{*} etc. |
Example:
Code Blocknoformat |
---|
<param name=namh1. "file" value="sample/hello[date:yyyyMMdd].txt" /> |
On 2050-12-31 the parameter file contains the value "sample/hello20501231.txt" .
Supports substitution of job parameter names with their value if the job parameter name is enclosed by % and % .
Example: <param namenamh1. "file" valuh1. value"%scheduler_file_path%" />
During the job runtime the parameter file contains the value of the job parameter scheduler_file_path . Using Directory Monitoring with File Orders the job parameter scheduler_file_path contains automatically the path of the file that triggered the order.
...
The default value for this parameter is ..
This parameter is mandatory.
...
Parameter <span ih1. "file_spec">file_spec<span> Regular Expression for filename filtering
...
Regular Expression for filename filtering
Regular Expression for file filtering. The behaviour is CASE_INSENSITIVE.
Only effective if the parameter file is a directory.
Some remarks on regular expression, used in JobScheduler.
A regular expression is not a wildcard . To get an impression of the differences one have a look on the meaning of the wildcard .txt, which will select all filenames with the filename-extension ".txt". A regular expression to match, e.g. works the same way, this "wildcard" must look like "^.\.txt$". That looks a little bit strange but it is much more flexible and powerfull on filtering filenames than the concept of wildcards, if one want to filter more complex names or pattern.
The general syntax of an regular expression , also referred to as regex or regexp, is described here . It is different to other RegExp definitions, e.g. as for Perl.
Data-Type : SOSOptionRegExp
...
Parameter <span id"gracious">gracious<span> Specify error message tolerance
...
Specify error message tolerance
Enables or disables error messages that are caused by an empty result-set, which is the result of an operation, executed by the job. Therefore this parameter can control the sequence of nodes or states in a job-chain.
Valid values:
Code Blocknoformat |
---|
'''{*}false, 0, off, no, n, nein, none'''{*} , '''{*}true, 1, on, yes, y, ja, j'''{*} and '''all'''{*}all{*} . |
The following rules apply when the result-set is empty:
...
For example, the setting "graciousallgraciouh1. all" will suppress all errors regarding an empty result-set and will terminate a Job (standalone and inside a jobchain) as it would be without errors.
...
The default value for this parameter is false.
...
Parameter <span id"max_file_age">max_file_age<span> maximum age of one or multiple files
...
maximum age of one or multiple files
Specifies the maximum age of one or more files. If a file is older, then it is deemed not to exist.
Possible values:
0 (disabled)
seconds
hours:minutes
hours:minutes:seconds
Data-Type : SOSOptionTime
The default value for this parameter is 0.
...
Parameter <span ih1. "max_file_size">max_file_size<span> maximum size of one or multiple files
...
_maximum size of one or multiple files_Specifies the maximum size of one or multiple files in bytes: should the size of one of the files exceed this value, then it is classified as non-existing.
...
The default value for this parameter is -1.
...
Parameter <span id"min_file_age">min_file_age<span> minimum age of one or multiple files
...
_minimum age of one or multiple files_Specifies the minimum age of one or multiple files. If the file(s) is newer then it is classified as non-existing.
...
The default value for this parameter is 0.
...
Parameter <span ih1. "min_file_size">min_file_size<span> minimum size of one or multiple files
...
minimum size of one or multiple files
Specifies the minimum size of one or multiple files in bytes: should the size of one of the files fall below this value, then it is not included in the result list of the operation.valid values for file size
Possible Values:
-1 (disabled)
number (Byte), e.g. 40
numberKB, e.g. 5KB (case insensitive)
numberMB, e.g. 20MB (case insensitive)
numberGB, e.g. 10GB (case insensitive)
...
The default value for this parameter is -1.
...
Parameter <span id"skip_first_files">skip_first_files<span> number of files to remove from the top of the result-set
...
number of files to remove from the top of the result-set
The number of files are removed from the beginning of the set resulting by min_file_size , min_file_age etc. These files are excluded from further operations.
The result set is sorted according to the used filter parameters:
Code Blocknoformat |
---|
[[#minmin_file_age|min#min_file_age]] , [[#maxmax_file_age|max#max_file_age]] : in ascending order by date of last modification, the newest file first. [[#minmin_file_size|min#min_file_size]] , [[#maxmax_file_size|max#max_file_size]] : in ascending order by file size, the smallest file on top.if parameters for file age as well as file size are given the set is sorted by file age. |
Only either skip_first_files or skip_last_files is allowed to be set at one time.
...
The default value for this parameter is 0.
...
Parameter <span ih1. "skip_last_files">skip_last_files<span> number of files to remove from the bottom of the result-set
...
_number of files to remove from the bottom of the result-set_The number of files are removed from the end of the set resulting by min_file_size, min_file_age etc. These files are excluded from further operations.
...
The default value for this parameter is 0.
...
Parameter <span id"count_files">count_files<span> Return the size of resultset
...
Return the size of resultset
If this parameter is set true " true " the number of matches is returned in the order parameter " scheduler_SOSFileOperations_file_count ".
Valid values: true, 1, on, yes, y, ja, j and false, 0, off, no, n, nein
This parameter is valid and available for order driven jobs only. JobChains, for example, are order driven jobs. In standalone jobs this parameter will be ignored without further notice.
...
The default value for this parameter is false.
...
Parameter <span ih1. "create_order">create_order<span> Activate file-order creation
...
Activate file-order creation
With this parameter it is possible to specify, that for all filenames in the resultlist or for the first file only (see create_orders_for_all_files ) a file-order has to be created and launched.
Valid values: true, 1, on, yes, y, ja, j and false, 0, off, no, n, nein
...
The default value for this parameter is false.
Use together with parameter:
Code Blocknoformat |
---|
[[#createcreate_orders_for_all_files|create#create_orders_for_all_files]] - Create a file-order for every file in the result-list |
No Format |
---|
[[#orderorder_jobchain_name|order#order_jobchain_name]] - The name of the jobchain which belongs to the order |
No Format |
---|
[[#nextnext_state|next#next_state]] - The first node to execute in a jobchain |
...
Parameter <span id"create_orders_for_all_files">create_orders_for_all_files<span> Create a file-order for every file in the result-list
...
Create a file-order for every file in the result-list
Valid values: true, 1, on, yes, y, ja, j and false, 0, off, no, n, nein
...
The default value for this parameter is false.
Use together with parameter:
Code Blocknoformat |
---|
[[#createcreate_order|create#create_order]] - Activate file-order creation |
No Format |
---|
[[#orderorder_jobchain_name|order#order_jobchain_name]] - The name of the jobchain which belongs to the order |
No Format |
---|
[[#nextnext_state|next#next_state]] - The first node to execute in a jobchain |
...
Parameter <span ih1. "order_jobchain_name">order_jobchain_name<span> The name of the jobchain which belongs to the order
...
The name of the jobchain which belongs to the order
The name of the jobchain which has to be launched by the order is the value of this parameter.
One must take into account, that the name of the jobchain must contain a subfolder structure if the jobchain is not in the folder "live". An example: the jobchain "Test" is located in "live/sample/FileOperations/". The value which has to be specfied is then "/sample/FileOperations/Test".
Data-Type : SOSOptionString
Use together with parameter:
Code Blocknoformat |
---|
[[#createcreate_order|create#create_order]] - Activate file-order creation |
No Format |
---|
[[#nextnext_state|next#next_state]] - The first node to execute in a jobchain |
...
Parameter <span id"next_state">next_state<span> The first node to execute in a jobchain
...
The first node to execute in a jobchain
The name of the node of a jobchain, with which the execution of the chain must be started, is the value of this parameter.
Data-Type : SOSOptionJobChainNode
Use together with parameter:
Code Blocknoformat |
---|
[[#createcreate_order|create#create_order]] - Activate file-order creation |
No Format |
---|
[[#orderorder_jobchain_name|order#order_jobchain_name]] - The name of the jobchain which belongs to the order |
...
Parameter <span ih1. "on_empty_result_set">on_empty_result_set<span> Set next node on empty result set
...
Set next node on empty result set
The next Node (Step, Job) to execute in a JobChain can be set with this parameter. The value of the parameter is a (valid) node-name of the current JobChain. In case of an empty result-set, e.g. due to non existent files, the current job will end without an errors and the JobChain will continue with the name of the node which is given as the value of this parameter.
...
The default value for this parameter is empty.
...
Parameter <span id"expected_size_of_result_set">expected_size_of_result_set<span> number of expected hits in result-list
...
number of expected hits in result-list
...
The default value for this parameter is 0.
Use together with parameter:
Code Blocknoformat |
---|
[[#raiseraise_error_if_result_set_is|raise#raise_error_if_result_set_is]] - raise error on expected size of result-set |
...
Parameter <span ih1. "raise_error_if_result_set_is">raise_error_if_result_set_is<span> raise error on expected size of result-set
...
raise error on expected size of result-set
With this parameter it is possible to raise an error if the quantity of hits of the result-list is according to the value of this parameter.
An example:
Assuming, that the parameter "raise_error_if_result_set_ih1. neisne" is defined and the parameter "expected_size_of_result_set1seh1. 1" is specified as well. If the number of hits is not equal to "1" an error will raised.
...
The default value for this parameter is 0.
Use together with parameter:
Code Blocknoformat |
---|
[[#expectedexpected_size_of_result_set|expected#expected_size_of_result_set]] - number of expected hits in result-list |
...
Parameter <span id"result_list_file">result_list_file<span> Name of the result-list file
...
Name of the result-list file
If the value of this parameter specifies a valid filename the result-list will be written to this file.
...
The default value for this parameter is empty.
Return parameter JobSchedulerExistsFile
The order parameter described below are returned by the job to the JobScheduler. JobSchedulerExistsFile
Panel | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||
|
...
Parameter <span ih1. "scheduler_file_path">scheduler_file_path<span> file to process for a file-order
...
file to process for a file-order
...
The default value for this parameter is empty.
...
Parameter <span id"scheduler_file_parent">scheduler_file_parent<span> pathanme of the file to process for a file-order
...
pathanme of the file to process for a file-order
...
The default value for this parameter is empty.
...
Parameter <span ih1. "scheduler_file_name">scheduler_file_name<span> Name of the file to process for a file-order
...
Name of the file to process for a file-order
...
The default value for this parameter is empty.
...
.
Parameter <span id"scheduler_sosfileoperations_resultset">scheduler_sosfileoperations_resultset<span> The result of the operation as a list of items
...
The result of the operation as a list of items
...
The default value for this parameter is empty.
Use together with parameter:
Code Blocknoformat |
---|
[[#schedulerscheduler_sosfileoperations_Resultsetsize|scheduler#scheduler_sosfileoperations_Resultsetsize]] - |
No Format |
---|
[[#schedulerscheduler_sosfileoperations_file_count|scheduler#scheduler_sosfileoperations_file_count]] - Return the size of the result set after a file operation |
...
Parameter <span ih1. "scheduler_sosfileoperations_resultsetsize">scheduler_sosfileoperations_resultsetsize<span> The amount of hits in the result set of the operation
...
The amount of hits in the result set of the operation
...
The default value for this parameter is empty.
Use together with parameter:
Code Blocknoformat |
---|
[[#schedulerscheduler_sosfileoperations_ResultSet|scheduler#scheduler_sosfileoperations_ResultSet]] - |
No Format |
---|
[[#schedulerscheduler_sosfileoperations_FileCount|scheduler#scheduler_sosfileoperations_FileCount]] - |
...
Parameter <span id
...
"scheduler_sosfileoperations_file_count">scheduler_sosfileoperations_file_count<span> Return the size of the result set after a file operation
...
Return the size of the result set after a file operation
...
The default value for this parameter is 0.
Use together with parameter:
Code Blocknoformat |
---|
[[#schedulerscheduler_sosfileoperations_Resultsetsize|scheduler#scheduler_sosfileoperations_Resultsetsize]] - |
No Format |
---|
[[#schedulerscheduler_sosfileoperations_ResultSet|scheduler#scheduler_sosfileoperations_ResultSet]] - |