-
Notifications
You must be signed in to change notification settings - Fork 13
CustomInvocable
STATUS: ACTIVE
This class is an example of how to implement the Invocable Abstract Class. It doesn't do much, but it does illustrate how BulkCallable, Invocable, UniversalInvocable, UniversalFlowInputOutput and UniversalFlowInputOutputParameter work together to expose multiple methods to Flow. Please understand this is an example class demonstrating the work an Apex developer would need to take to make the following class methods available to Flow: daysTillChristmas and daysBetweenDates.
Inheritance
UFInvocable > CustomInvocable
Method exposes the Apex Date method daysBetween to Flow. It accepts a single list of parameter for the start date, then calculates the days between the start date and Christmas.
Param | Description |
---|---|
startingDates |
List to start the calculation from. |
Type | Description |
---|---|
List | List List of days between the starting date and Christmas. |
This method exposes the Apex date method daysBetween to flow accepting two lists of date parameters, one for startDate and one for endDate. It calculates the days between the two dates.
Param | Description |
---|---|
startingDates |
List List of dates to start the calculation from. |
endingDates |
List List of dates to end the calculation at. |
Type | Description |
---|---|
List | List List of days between the starting date and ending date. |
This is the method required by the BulkCallable interface. This is the method you'll need to implement in any classes you wish to expose to flow.
Param | Description |
---|---|
methodName |
String name of the method to be invoked |
param2 |
List<Map<String, Object>> List of parameters to be passed to the method. |
Type | Description |
---|---|
List | List of Objects to be returned to Flow. |
protected List extractParameter(String parameterName, List<Map<String,Object>> parameters, Type parameterListType)
Inherited
Extracts values from a list of parameters. Used by implementations of the Invocable framework.
Param | Description |
---|---|
parameterName |
the parameter name to extract into the list |
parameters |
the parameters provided by the flow framework |
parameterListType |
the Type of the new list to create |
Type | Description |
---|---|
List |
List<Object> The list of extracted values, in the same data type as requested |