AutoTasks are powerful workflow tools used to automatically perform actions on NetX assets or data based on certain triggers. Some common uses of AutoTasks include:

  • Organize  assets based on an attribute change.
  • Generate a watermarked version of an asset, to be attached as a  view to the original asset.
  • Notify specific users when certain actions are performed.

Once triggered, AutoTasks are added to a queue, then completed in order. This means if many AutoTasks are triggered during a short period of time, there may be a delay before a new AutoTask is completed.

What is an AutoTask?

Under the hood, AutoTasks are written in XML, a text-based format for representing structured data. It's helpful to have some basic familiarity with XML syntax before building AutoTasks. If you'd like to brush up on XML basics, head over to  https://www.w3schools.com/xml/default.asp

Terminology

  • Parent element: The parent of an individual AutoTask contains the entirety of the task itself. The parent element of every AutoTask is always <task>.

  • Child element: C hild elements of an AutoTask contain any  components of a task such as its  matchCriteria triggers.

  • Subchild element: The subchild element is a component inside a child element. Note that  repurpose components do not have any supported subchild elements.

  • Component : AutoTasks are composed of the following components matchCriteriamodificationsrepurposeexport, and notification. Only matchCriteria and any one other component is required for any given AutoTask, though all components can be included in any given AutoTask. 

  • Parameter: Every supported component has unique parameters with values based on the component type. For example, one parameter for the repurpose component consists of the name of a  repurpose operation followed by a relevant value, e.g. <repurpose format="jpg" />.
  • Value : Each parameter has a value that contains data related to it. These values are dependent on both the component and parameter being used, e.g. jpg for this repurpose component: <repurpose format="jpg" />

Syntax

All elements are case sensitive.

Below is a properly formatted AutoTask with placeholder values:

AutoTask components always trigger in the following order: 

  1. task
  2. matchCriteria
  3. modifications
  4. repurpose
  5. export
  6. notification

Components

task

The task element contains your AutoTask actions and criteria; the opening task tag should contain a name field where you give the task a unique name.

matchCriteria

Every AutoTask must have a <matchCriteria> element that will trigger the task. Within <matchCriteria>, you can specify which NetX actions will trigger the AutoTask using the <criteria> subchild element. The  type parameter controls how multiple <criteria> are be combined:

  • type="or" - only one of the listed criteria must match
  • type="and" - all of the listed criteria must match
<matchCriteria type="and / or">
	<criteria [ criteria parameters ]></criteria>
</matchCriteria>
CODE

To learn more about matchCriteria, see  AutoTask Step 1: Match Criteria .

modifications

Modifications make changes to assets that meet the AutoTask's matchCriteria. They are used to:

Modifications can be built upon by adding <modify> ... </modify> subchild brackets in between <modifications> ... </modifications> child brackets:

<modifications>
	<modify [ modify parameters ]></modify>
</modifications>
CODE

For more information regarding AutoTask modifications, see  AutoTask Step 2: Modification Options

repurpose

Repurposing assets via AutoTask uses  repurpose operations  as parameters to  automatically create a derivative file for an asset that meets the task's match criteria ; these files are attached as a  view to the original asset.  Repurpose operations can be built upon by formatting  repurpose operation parameters between a <repurpose /> bracket. Note that operations are contained inside a single bracket, with no nested subchild brackets. A / is still required before the closing bracket after any repurpose operations. 

<repurpose [ repurpose parameters ]/>
CODE

For more information regarding repurposing assets via AutoTask and the formatting of repurpose parameters, see  AutoTask Step 3: Repurpose Operations . For more information regarding each repurpose operation, see  Repurpose Operations .

exports

Adding an export action to an AutoTask can:

  • Send assets or their derivatives to an alternate storage location.
  • Send assets or their derivatives to a specified email address.
  • Generate a new asset or  asset view .

Export actions can be built upon by adding <export> ... </export> subchild brackets in between <exports> ... </exports> child brackets. Multiple export actions are supported with a single AutoTask. 

<exports> 
	<export [ export parameters ]></export>
<exports/>
CODE

notifications

Notifications are used to send an email to a specified user,  group , or email address when an AutoTask is triggered. They  can be built upon by adding a <notify /> subchild bracket in between <notifications> ... </notifications> child brackets. Note that a is still required before the final notify bracket. 

<notifications>
	<notify [ notifications parameters ]/>
</notifications>
CODE

System attributes

Custom attributes can be updated with an AutoTask, or used as an AutoTask trigger. While the following system attributes can be used with an AutoTask, only name and visible are editable via AutoTask; all other system attributes can be used as triggers.

AttributeDescriptionEditable?

name

An asset's name. Note that this is the name of the asset in NetX, not the name of the underlying file. You can find the name of the asset via its  detail page .Yes
visible

The visible attribute determines whether or not non-administrator level users can view or perform actions on an asset in any context.

Yes
assetIdAn asset's unique ID assigned to it when it is uploaded to NetX. You can find an asset's ID number via its  detail page .No
creationDateThe creation date of an asset. This date field should be formatted as yyyy-mm-dd. To check the creation date of a particular asset, view its  detail page .No
fileFormatFamily3d, audio, animation, cameraRAW, compression, data, disc, document, font, image, layout, presentation, spreadsheet, vector, video, markupNo
fileHeightThe height of the asset, in pixels. If an asset is a file type that does not have dimensions, e.g. an audio file, this attribute will not apply. To view the dimensions of an asset including its file height, check its  detail page .No
fileNameThe file name of an asset. Note that this is the name of the original file, not the asset name as it appears in NetX. To view an asset's file name, check its  detail page .No
fileSizeThe size of the asset, in bytes. To view an asset's file size, check its  detail page .No
fileTypeThe file type of an asset, e.g. jpg, mp4, etc. To view an asset's file type, check its  detail page No
fileWidthThe height of the asset, in pixels. If an asset is a file type that does not have dimensions, e.g. an audio file, this attribute will not apply. To view the dimensions of an asset including its file height, check its  detail page .No
modificationDateThe date of the last modification to an asset. To view its modification date, check its detail page.No

Creating and editing AutoTasks

Autotask editor

Creating an AutoTask

  1. Navigate to the AutoTask tab of the Systems area.
  2. To add a new AutoTask, click the upper-left plus icon and give it a descriptive name. A new, pre-formatted XML AutoTask will populate in the editor.

    The name of an AutoTask cannot be edited later.

  3. Modify the pre-populated XML in the righthand window.

  4. Click Save.

Editing an AutoTask

  1. Navigate to the AutoTask tab of the Systems editor.
  2. Select an existing AutoTask from the lefthand list.
  3. Make your changes to the AutoTask in the righthand window.
  4. Click Save.

autotask.xml file

Every change to a site's autotask.xml file requires a restart of NetX. This includes adding new AutoTasks as well as deleting, or modifying existing tasks.

On-premise administrators can add and edit AutoTasks by directly editing the autotask.xml file. The default location of this file is here:

  • Windows:  C:\Program Files\NetXposure\netx\config\autotask.xml
  • Linux:  /opt/netx/netx/config/autotask.xml

Each AutoTask must still be formatted using proper XML, enclosed by <task> ... </task> brackets, in between the overarching <autoTask> ... </autoTask> brackets in the file. Each component of the AutoTask must be properly formatted using its accepted parameters; to properly format each element of your AutoTask, see the  component rundown above. If your AutoTask is not triggering or behaving as expected, make sure all of your task's XML is properly formatted and all parameters conform to NetX's AutoTask commands. 

Adding, modifying, or removing AutoTasks using the autotask.xml file directly will reflect in NetX's AutoTask tab of the Systems area.