The AutoTask feature provides a configurable system for various tasks triggered by particularly important events that occur within the NetX system. The basic idea is this: watch for specific events — such as when the “Status” attribute changes to “Approved” maybe even in a specific category; then execute preconfigured functions based on the triggering event — such as convert to JPG format and FTP to the Web server. The system is very flexible, and very powerful. Effectively it’s a workflow macro system.

Please note that AutoTask requires a Workflow license; contact sales@netx.net if you are interested in purchasing this module.

Architecture

The event monitoring is done deep within the NetX system — events are captured, filtered, and issued appropriately. Additionally, this system provides an event queue. Event data is placed into the queue in order to avoid any time delay. The event notification system runs a separate thread that then pops events from that queue and handles them as quickly as it can. In this way, normal application operations are not impeded by the event monitoring. However, tasks should not be assumed to be executed in realtime, but they are usually executed in a reasonable amount of time. Obviously if the event queue becomes saturated, the delays should be expected. 

Task Definition

Tasks are defined within the autotask.xml file, which is generally located here:

$NETX_INSTALL_PATH/netx/config/autotask.xml
CODE

This file can also be edited in the user interface. If you edit the file directly on the file system, please restart NetX for your changes to take affect.

The contents of this file look like the following:

<?xml version="1.0" encoding="UTF-8"?>
<autotask>
	<task name="My Task 1">
	...
	</task>
	<task name="My Task 2">
	...
	</task>
</autotask>
CODE

Note that tasks are added within the main <autotask> block.

Task Components and Execution Order

Please read the various sub-articles for more details on the components of tasks, but the general structure of a task looks like this:

<task name="My Task">
 <matchCriteria/>
 <modifications/>
 <repurpose/>
 <exports/>
 <notifications/>
</task>
CODE

And, in fact, task components execute in this order:

  1. matchCriteria
  2. modifications
  3. repurpose
  4. exports
  5. notifications

System Attribute Keys

In addition to custom defined asset attributes, the following are inherently included. These can be used in conjunction with the “criteria” (type=attribute) nodes and in the “name” attribute of that node

Attribute NameNotesRestriction
assetIdAsset ID (integer)Read-only
nameName (arbitrary)
descriptionDescription
fileNameFile name (file system)Read-only
fileSizeSize of the file (bytes)Read-only
fileWidthWidth in pixels (if available)Read-only
fileHeightHeight in pixels (if available)Read-only
fileTypeFile formatRead-only
creationDateCreation dateRead-only
modificationDateLast modification dateRead-only
visibleVisibility (Admin view only)

Please note: in NetX version 8.5, the AutoTask value substitution system was added.  This feature defines a system of variables using "tokens" to substitute values a variety of situations.

Additional Reading

The following articles will help you delve into the world of AutoTasks: