Skip to content

Triggers and Data Injection

Triggers not only provide a starting point for a workflow, they also injecting data into the workflow.

Each trigger's configuration dialog shares a variables configuration page that is used to setup an initial set of variables for the workflow.

workflow-diagram17.png

There are two sections: global and local. Often the same set of variables is setup for all triggers of a workflow. These are global variables. Local variables are trigger-specific. So, for example, if your application has three triggers, the global section will contain the same data for each of the three triggers. The local side will be specific to the trigger.

Variables can be moved from the global list to the local list and vice versa by pressing the arrow buttons located between the two lists.

Adding, Editing and Deleting Variables

Variables are added by pressing the green "plus" icon for the kind of trigger you want to create. The Variable editor dialog will appear and and allow you to setup your variable.

Variables may be edited by selecting the variable to edit and pressing the pencil or edit icon or by double clicking it.

Finally variables may be deleted by selecting the variable to delete and pressing the delete or red "x" icon.

Order

Order is important. For example, one variable might load some configuration data. Then another variable is set that references those data. In this case, it will be important to load the data before referencing it. Variables may be reordered by selecting a particular variable and moving it using the "up" and "down" arrows at the lower left of each list.

Valid Variable Names

Each variable must have a name. A name must start with a valid alphabetical character (A-Z or a-z) and may contain any number of alphanumeric characters (A-Z or a-z or 0-9). A variable may also contain the underscore "_" character.

Kinds of Variables

There are several kinds of variables: Templates, Directory Lookups and User Prompts. Each are configured differently.

Templates

A template allows a variable to be set from the result of a velocity expression.

Directory Lookup

A directory lookup sets the value of a variable to be the result of a directory operation. You must supply the directory object upon which you want to operate and the getter or name of the function you want to call. Only simple getters are supported at this time.

Prompt User

The user prompt facilitates a way to ask the user for input. The prompt user method is only available on manual triggers.

To prompt a user, set the method to "Prompt User" and enter the prompt to use when prompting the user.

Next, select the kind of prompt. There are two kinds: String and Combo Box. When String is selected, the user is prompted for any string. It's up to the workflow to validate the string.

"Combo Box" can also be selected. When selected, the "Item Iterator" expression is evaluated to give the user a list of possible values. Combo boxes are often preferable bacause no validation needs to be done.

The "Item Iterator" field must be a valid velocity expression that evaluates to a java.util.List or java.util.Enumeration.

Passed Parameter

The workflow trigger and the action trigger are both passed variables by their caller. Variables are passed to the workflow trigger from the workflow execution task and the action trigger receives variables from whichever UI action calls it.

In the case of a workflow trigger, it is up to the workflow designer what variables are passed. Simply add them to the variables list in the trigger configuration. Later when a workflow execution task is created, its configuration dialog will require the variables to be set.

In the case of the action trigger, each UI element may pass different variables depending on what makes sense for that particular element. For example, an asset group passes groupName and members, the first being the actual name of the group and the second being a list of assets that are members of the group.

A concise list of each variable is described in "UI Action Variables" to learn more about what parameters are passed by what objects.

Workload Automation and Orchestration