Custom Trigger Plugin



This plugin scripts customized behavior in Ruby and keeps executing it until a condition is met.

Saved Parameters Description

Inputs Description

The list of inputs depends on the configuration of the CustomTrigger action template.

The inputs for the action will be the ones declared in the 'Required inputs' and 'Optional inputs' section.

Outputs Description

The outputs optionally declared in the 'Outputs' section will be returned with their specified names and types.

Supported Actions

None

Operating Instructions

This plugin provides the ability to execute some ruby code repeatedly.

Inside the code, inputs can be accessed thru the inputs hash. The inputs have to be declared in the 'Required inputs' or 'Optional inputs' sections.

Outputs can be accessed thru the outputs hash.

In the 'Execute code' section, enter the code that must be executed once at the beginning.

In the 'Check status code', enter the code that must be executed repeatedly (at the defined polling frequency) until a termination status is returned.

To keep the processing on, return with Action::STATUS_INPROGRESS for status In Progress

To terminate the processing, return with Action::STATUS_COMPLETE for status Complete, Action::STATUS_FAILED for status Failed or Action::STATUS_ERROR for status Error

Sample code to check that a file transfer is complete based on the .aspx file extension:

When the file with this extension is present, the transfer is deemed incomplete. The file path is passed as input 'transferred_file', declared as String.

In the 'Execute code' section:

@file = inputs['transferred_file'] + ".aspx"

In the 'Check status code' section:

if File.exist?(@file)
   @status_details = "Transfer of file #{inputs['transferred_file']} on-going at #{DateTime.now}"
   @status = STATUS_INPROGRESS
else
   @status_details = "Transfer of file #{inputs['transferred_file']} is complete"
   @status = STATUS_COMPLETE
end

The status_details variable takes the data to display in the step status when the workflow is executed