Adding triggers

Top  Previous  Next

A trigger is a method of listening for events and responding with actions based on whether conditions are met.  To view a list of triggers click on the Triggers node for the desired domain.

 

Figure 34

 

clip0034

 

 

 

Step 1

 

To add a trigger click on the Add button in the lower right corner.  The Add Trigger wizard will be displayed.

 

Figure 35

 

clip0035

 

 

General

 

Name - A unique name identifying this trigger.

 

Event Type - The type of event you want to listen for.

 

Description - Description of this trigger.

 

Tags - If used, this trigger will only be visible to administrators with a system administrator flag or who have been assigned a role with specified tag.

 

Enabled - Enables/disables trigger.

 

 

Figure 280

 

clip0280

 

Advanced

 

Ignore trigger events while domain is - If checked, events will not be processed when domain is in specified state.

 

Run trigger in single instance mode - Specifies that only one instance of this trigger should be run at a time. If an instance of this trigger is already running, a second instance can be either queued or skipped. The exact behavior can be specified by choosing between queue and skip in the drop-down list.

 

Run trigger asynchronous - If checked, trigger will be processed asynchronously.

 

Run actions asynchronous - If checked, trigger actions will be processed asynchronously.

 

Fire Trigger Error event if error occurs - If an error occurs while executing any of the actions associated with this trigger, a Trigger Error event will be raised.  You may capture this event using a trigger that listens for the Trigger Error event and respond appropriately.

 

 

Click the Next button to proceed to the next screen and to specify trigger conditions, if any.

 

Step 2

 

Trigger conditions can be entered either manually or by using the GUI-based Expression Builder. If you develop an expression using the Expression Builder, the expression will be automatically written to the Expression box. This box will be read-only if the Override checkbox is unticked (unchecked). Should you wish to write the expression manually yourself, tick the Override button. Once the Override button is ticked, the Expression Builder will be disabled.

 

Figure 36

 

clip0036

 

 

Expression - Enter a trigger condition (if any) in this text field. (See Writing conditions)

 

Override - Tick this checkbox if you wish to enter the trigger condition directly into the Expression box.

 

Test Expression - Click this button to test your trigger condition. (See Testing conditions)

 

 

Note: The following buttons will only be enabled if the Override checkbox is ticked.

 

Variables - Click this button to display a list of supported variables. This list will vary depending on the Event type used in the previous screen.

 

Functions - Click this button to display a list of functions. (See Function types)

 

Operators - Click this button for a list of supported Operators (e.g. =, !=, <, >, etc.). Hover your mouse over an operator to see a context-sensitive help.

 

Constants - Click this button for a list of supported constants.

 

AND - Click this button to insert the AND logical operator

 

OR - Click this button to insert the OR logical operator

 

Time Expression - Click this button for a more convenient way of specifying time expression parameters. (See Using time based triggers).

 

 

Click the Next button to proceed to the next screen and to add one or more trigger actions.

 

Step 3

 

Trigger actions are added as nodes in a flowchart. When the Trigger Actions screen first appears, you'll see a canvas with a single node named Workflow. This Workflow node has two outputs, Start and Finish. Start is used to define what trigger action to execute when the trigger execution begins. Finish, on the other hand, is used to define what trigger action to execute when the trigger execution ends.

 

Add - Click this button to add a trigger action.

 

Edit - Click this button to make changes to an existing trigger action.

 

Delete - Select an existing trigger action and then click this button to delete it.

 

Copy - Select an existing trigger action and then click this button to copy it.

 

Figure 37

 

clip0037

 

 

To add a trigger action, click the Add button. Expand the Action drop-down list to view all available trigger actions. To see a context help for a particular trigger action, select the action from the drop-down list and click the adjacent question mark icon (See Figure 281). Select the action you want to use.

 

 

 

 

Figure 281

 

clip0281

 

 

Click the OK button to proceed to the action parameters screen.

 

 

 

 

 

Figure 282

 

clip0282

 

 

The contents of this screen will vary depending on the selected trigger action. Enter pertinent details for the action in question and then click OK.

 

Figure 283

 

clip0283

 

 

A new trigger action node bearing the action type chosen (e.g. Sftp File Upload) will then be added to the canvas. Each trigger action has one input, Execute, and two outputs, Success and Failure.  You may link this action to either the Start or Finish outputs of the Workflow node. If you link this action to the Start output, this action will be executed as soon as the trigger begins execution. If you link it to the Finish output, it will execute once the trigger execution completes.

 

 

Figure 293

 

clip0293

 

 

To link the action node to the Workflow's Start output, click Start on the Workflow and then click Execute on the action node. You'll know the link is successful if you see a green arrow pointing from Start on Workflow to Execute on the action node.

 

Figure 294

 

clip0294

 

 

Adding more action nodes

 

Should you wish to execute another trigger action after an existing action, just add another action node and link it to the previous node by clicking on 1) either the Success or Failure outputs of the first node and then 2) on the Execute input of the second node. You may add more nodes as you wish and then link them in a daisy-chain fashion. To change the order of execution of existing action nodes, just delete all affected links (by selecting and clicking Delete) and then reattach new links that reflect the desired order of execution. You may also rearrange the nodes if you wish.

 

Figure 295

 

clip0295

 

 

In most cases, you would link a succeeding action node to the Success output of a previous action node. However, action nodes can also be linked via the Failure output. Normally, this is done for error handling purposes. For example, if an action fails, you might want JSCAPE MFT Server to send an email to a designated server admin (e.g. via the Send Email action) or log the failure to a file (e.g. via the Append File action).

 

Figure 296

 

clip0296

 

 

Finishing a trigger

 

You may link an action node the Workflow's Finish output. This action will be executed regardless whether or not all actions linked to Start are able to execute successfully.

 

 

Figure 297

 

clip0297

 

 

 

See also

 

Event types

Action types
Function types

Defining custom action types