The FileTrigger monitors a directory tree on the filesystem and if a file is copied/modified it starts a given process instance.
<trigger>
<name>nesteddir</name>
<version>1</version>
<class>net.arsretia.jawflow.triggers.file.FileTrigger</class>
<processid>Test</processid>
<period>1000</period>
<rootdir>[rootdir]</rootdir>
<domain>var1_$var1name1</domain>
<dir path="dir1" filefilter="*.txt">
<var name="var1name1" value="var1value1"/>
<var name="var1name2" value="var1value2"/>
<var name="var1name3" value="var1value3"/>
<dir path="dir1.1" filefilter="*.txt1">
<var name="var1.1name1" value="var1.1value1"/>
<var name="var1.1name2" value="var1.1value2"/>
</dir>
<dir path="dir1.2" filefilter="*.zip">
<var name="var1.2name1" value="var1.2value1"/>
<var name="var1.2name2" value="var1.2value2"/>
<dir path="dir1.2.1" filefilter="*.doc">
<var name="var1.2.1name1" value="var1.2.1value1"/>
<var name="var1.2.1name2" value="var1.2.1value2"/>
</dir>
</dir>
</dir>
</trigger>
In the above example we are monitoring a tree with the following structure:
[rootdir]
|
|----dir1
|
|----dir1.1
|
|----dir1.2
|
|---dir1.2.1
The "filefilter" attribute ensures that only the filtered file are checked, so, for instance, in directory dir1, only .txt files are checked.
The started process has the following attributes set:
var | The started process will have this variables as attributes if the file is modified in the corresponding directory | java.lang.String |
FileNotificationTimeStamp | Time of notification User | java.lang.String |
InputFileDir | directory of modified file | java.lang.String |
FileLength | File Lenght | java.lang.Long |
LastModified | Last Modified Time | java.lang.String |
InputFile | File name without extension | java.lang.String |
InputFileSuffix | File Suffix | java.lang.String |
|