Be default FileCloud Workflow Conditions use strict matching in order to check the file/folder path. In 17.3 version a new feature was introduced to enable regular expressions utilisation. In order to enable regular expression match, administrator has to set the use_regex parameter to "1" in the condition definition. This is an optional parameter and by deafult will take the "0" value (don't use regular expressions - use strict match instead). If regular expressions are enabled administrator has to provide a valid regular expression pattern as the parent_folder_path_string value. This pattern will be used in the condition resolution process to find all matching paths (files / folders), for which the action should be run.
Regular expressions are supported by the following workflow conditions:
- if a file is created
- if a folder is created
- if a file is updated
- if a file is deleted
- if a folder is deleted
- if a file is downloaded
- if a comment is added
- if a file is added or updated
Parameters definition - example
Strict match
{
"parent_folder_path_string":"/userid/somepath",
}
or
{
"parent_folder_path_string":"/userid/somepath",
"use_regex":"0"
}
Regular expression
{
"parent_folder_path_string":"/userid/somepath",
"use_regex":"1"
}
Usage - Example
For simplicity sake assume that Administrator wants to send email notifications whenever someone downloads a file from a given location. The following example shows the difference between strict match and regular expression match
Strict match
Parameters are defined as follows:
{
"parent_folder_path_string":"/userA/downloads",
}
For such defined condition action will be triggered whenever a files is downloaded directly from the "/userA/downloads" directory and only from this one.
Regular expression
In this case the definition might look something like:
{
"parent_folder_path_string":"~/.*/downloads~",
"use_regex":"1"
}
For this condition action will be triggered for all directories that match the /user/download format, i.e. /userA/downloads, /userB/downloads, etc. This is a huge change that enables Administrators to define much more universal workflow scenarios.
Important
Regular expression patterns aren't validated for correctness. Please double check them, especially when dealing with the data-changing actions (i.e. delete files / move files, etc.).
RegEx Patterns
Regular expression definition has to start and end with one of the following characters:
'/', '~', '@', ';', '%', '`'
We strongly advise against the / usage as it adds confusion to the pattern definition.