Universal Tasks Overview

Overview

Universal Tasks allow Universal Controller users to implement task types that are specific to their own in-house applications, utilities, or third-party vendor applications.

In cases where you are using a generic script with a Windows or Linux/Unix Universal Agent-based task, you now can create a customized Universal Task Details that encapsulates the specific input needed for that command or script.

Universal Tasks are created for specific Universal Task types, which are based on Universal Templates. When a Universal Template is created, or imported from the Stonebranch Integration Hub, Universal Controller creates a corresponding Universal Task type - <template name> Tasks - under the Universal Tasks folder in the Automation Center navigation pane.

Each Universal Template contains user-defined fields, to which the Controller assigns a variable to be used in the Universal Template script. The Controller also automatically adds these fields to the Details of all Universal Tasks created for the Universal Task type based on that Universal Template. When a Universal Task is run, it executes the script in the Universal Template and the variables in the script are resolved to the values of their matching fields in the Universal Task instance.

In this way, you can execute the same script from different tasks and have the script variables resolve to different values.

If you want to change the script, including the adding or removing variables, you only have to change it in the Universal Template.

Universal Task User-Defined Fields

The Details for each Universal Task contains any editable fields that were created in the Universal Template on which the Universal Task type for that Universal Task is based. System-assigned variables that match these fields are provided for inclusion in the template script. When the task is run, it executes the script, and the variables are resolved to the values of their matching values in the task.

There are eight types of user-defined fields that can appear in the Details of a Universal Task:

  • Text
    • Normal text (for a single line of text)
    • Large Text (for multiple lines of text)
  • Integer
  • Boolean
  • Choice
  • Credential
  • Script
  • Array
  • Float
  • SAP Connection
  • Database Connection

For Script-based Universal Tasks, Credentials Functions, Script Functions, SAP Connection Functions, and Database Connection Functions are fully supported within the Universal Template Script, and within any embedded Data scripts.

For Extension-based Universal Tasks, these functions are also fully supported within the content of a Script field and within any embedded Data scripts.

For each type of field, default values, format, and/or limitations are specified in the Universal Template. In any Universal Task based on that Universal Template, you can override and/or define values - within the specified format and limitations - for those fields.

  • If the Allow Empty Choice field was selected for a Choice field in the Universal Template on which this Universal Task was based, that Choice field in the task will include an empty (blank) selection.
  • If the Allow Multiple Choices field was selected for a Choice field in the Universal Template on which this Universal Task was based, that Choice field in the task will allow selection of more than one choice. When multiple choices are selected, the built-in field variable will resolve to a comma-delimited String of choice values.
  • Any field that has a Require If Field dependency on a Boolean field in the Universal Template on which the Universal Task is based will change from required to optional (or optional to required) when toggling the Boolean field checkbox, depending on the Require If Field Value(s).
  • Any field that has a Require If Field dependency on a Choice field in the Universal Template on which the Universal Task is based will become required when selecting a choice value specified in the Require If Field Value(s) and optional when selecting a choice value not specified in the Require If Field Value(s).
  • Any field that has a Show If Field dependency on a Boolean field in the Universal Template on which the Universal Task is based will change from visible to hidden (or hidden to visible) when toggling the Boolean field checkbox, depending on the Show If Field Value(s).
  • Any field that has a Show If Field dependency on a Choice field in the Universal Template on which the Universal Task is based will become visible when selecting a choice value specified in the Show If Field Value(s) and hidden when selecting a choice value not specified in the Show If Field Value(s).
  • Any field visible due to a Show If Field dependency in the Universal Template on which the Universal Task is based will display as required (bold label) if the Require If Visible option is specified for the Universal Template field; otherwise, it will display as optional (non-bold label).
  • By default, the column and row space occupied by a field remain reserved even when the field is hidden by a Show If Field dependency. To change the default behaviour, the No Space If Hidden option must be specified for the Universal Template field.

Setting Up Universal Templates and Tasks

Step 1

Create a Universal Template, which includes selecting the type of Agent(s) on which Universal Tasks based on this Universal Template can be run, and a variable prefix used for script variables that you want resolved when a Universal Task executes the script in this Universal Template.

Step 2

Enter a script in the Universal Template that all Universal Tasks based on this Universal Template will execute when they are run.

Step 3

After you have entered/selected any other desired values in the Universal Template Details, save the Universal Template.

Step 4

For each parameter in the script that you want to replace with a variable, create a Universal Template Field of an appropriate Field type. The Controller automatically assigns a variable (format: ops_<Variable Prefix>_<Field Name>) to each Field, using the variable prefix that you specified in Step 1, and - in the Details of all Universal Tasks based on this Universal Template - will place fields that match these Universal Template Fields (see Step 7).

Step 5

Replace the appropriate parameters in the script with the system-assigned variables.

Step 6

Update the Universal Template. Now that the Universal Template has one or more defined Fields, the Controller creates a Universal Task type for it and adds the Universal Task type to the Automation Center navigation pane. (You must refresh the Automation Center navigation pane in order to see the new Universal Task type.)

Step 7

Create a Universal Task for that Universal Task type. The Universal Task Details will contain fields that match the Fields you created in the Universal Template (Step 4) for that Universal Task type.

Step 8

Enter/change values in the Universal Task fields that match the Universal Template Fields, based on how you want their matching variables in the script to be resolved.

Step 9

Run the task, which executes the script. The variables in the script are resolved to the values of their matching fields in the Universal Task.