Once a day, NetX will run any date-based AutoTask. This allows you to create workflows based on date-type metadata. Any date field can be used — custom date attributes, import date, creation date, or modification date.
In the example below, the date-based event occurs once per day, at the time specified by the
<?xml version="1.0" encoding="UTF-8"?> <autotask> <task name="Import date notification"> <matchCriteria type="and"> <criteria type="action" value="date" name="importDate" offset="6d" /> <criteria type="category" path="/Stuff" recursive="true"/> </matchCriteria> <notifications> <notify type="systemErr"/> </notifications> </task>
The action type is "date". The "name" defines the date field. These are the built-in date fields:
You can also use any custom date attribute by name as well.
There is also an "offset" parameter; this allows you to provide a relative offset to the date matching. In this case, the example above will match all assets that were imported 6 days ago, up to today. Without an offset parameter, assets with the specified date field matching the current day are matched.
Offset notations are listed below:
By default, the offset is subtracted from the current date. In the example above, 6d subtracts 6 days from the current date, and match all assets where the importDate is somewhere between 6 days past and the current day. The plus sign (+) is implicit but may still be used in the value, e.g.+6d.
To specify a range in the future (i.e. from today to 30 days in the future) you would use a minus sign e.g. -30d.
Furthermore, these can be combined:
- You must add them in order of their magnitude: year before month, month before week, week before day, etc.
- Offset qualifiers must be separated from each other by spaces.
For example (1 year, 3 months, 2 days):
1y 3M 2d
Note that by setting an offset, the date range matched by a task will be longer than one day, which may result in the task being executed more than one day in a row for a particular asset.
Additional match criteria
You can combine this event trigger with other match criteria. The example above combines the date match and filters the results based on a category.