Builds a funnel action type, which is a step an automation can perform when it runs. Obtained from addFunnelActionType on the controller mappings. Set the description, the configuration fields an administrator fills in, and the name of the function that performs the action. Call build to register the action type; registration is ignored once the app's engine has finished initialising.

Group: Builders


Methods

description(String s)

Returns: FunnelActionTypeBuilder

Sets the description shown to administrators alongside the action name when they pick an action for an automation.

ParameterDescription
sthe description text

doActionFn(String s)

Returns: FunnelActionTypeBuilder

Names the function that performs the action when an automation reaches this step. It is called with the automation context and the values the administrator entered into the action's fields.

ParameterDescription
sname of the global JavaScript function that performs the action

fieldsFunction(String s)

Returns: FunnelActionTypeBuilder

Names a function that adds configuration fields to the action dynamically, called with the field list each time the fields are needed. Use it when the available options depend on account data rather than being fixed at load time.

ParameterDescription
sname of the global JavaScript function that populates the field list

addField(String name, String options)

Returns: FunnelActionTypeBuilder

Adds a configuration field to the action from a short field definition string, parsed the same way as other app extra fields.

ParameterDescription
namename of the field, which is also the key its value is stored under
optionsfield definition string giving the type and any options

addField(String name, String text, boolean required, List<String> options)

Returns: FunnelActionTypeBuilder

Adds a configuration field to the action with an explicit label and a fixed list of select options.

ParameterDescription
namename of the field, which is also the key its value is stored under
textlabel shown next to the field
requiredtrue if the administrator must supply a value
optionsthe values offered in the field's drop down

addFieldWithOptionsFn(String name, String text, boolean required, Supplier optionsFn)

Returns: FunnelActionTypeBuilder

Adds a configuration field whose select options are produced by a supplier function that is called when the field is rendered, so the options can reflect current account data.

ParameterDescription
namename of the field, which is also the key its value is stored under
textlabel shown next to the field
requiredtrue if the administrator must supply a value
optionsFnsupplier called to produce the list of options

build()

Returns: void

Creates the funnel action type from the configured values and adds it to the action type list this builder was created for. Does nothing if the app's engine has already finished initialising.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.