-
Notifications
You must be signed in to change notification settings - Fork 13
UFInvocable
STATUS: ACTIVE
This provides a common interface for classes & methods developers want to expose to flow. Intrepid developers will note you could just implement the Callable interface in all of your classes. However, this class provides a few benefits:
- It provides a common interface for all of your classes, which makes it easier to understand what is exposed to flow.
- It provides a common exception type, which makes it easier to handle exceptions in flow.
- It provides a common wrapper for returning custom objects, which makes it easier to return custom objects in flow. This is an abstract class. This means the classes you want to expose to flow must extend this class. Extending this class will require you to implement the call() method. This is used by the Callable interface and is how developers can expose multiple class methods to flow without writing 1 class with 1 invocable method per method exposed. It should be noted that you should consider this a pattern. Modifying this pattern on a per-class basis would offer more flexibility, additional focus on input types and output types, and more control over the flow experience.
Implemented types
This is a required method of the callable interface that this class implements. You'll need to extend the class you intend to expose to flow with this one, and implement this method.
Param | Description |
---|---|
methodName |
This is a string representing the name of the method you want to call. |
passedParameters |
This is a map of parameters you're passing to your method. |
Type | Description |
---|---|
List | Object This returns a generic Object. This is the return value of the method you're calling. |
protected List extractParameter(String parameterName, List<Map<String,Object>> parameters, Type parameterListType)
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 |
This is a common exception object shared by all classes that extend this class. Used primarily by this class to throw exceptions when the call() method is not implemented, or when the call() method doesn't handle the method name or parameters passed to it.
Inheritance
MalformedCallableException
a 2D point.
Implemented types
Constructor
Param | Description |
---|---|
x |
the x coordinate |
y |
the y coordinate |
Used by Map/Set to identify unique values quickly
Type | Description |
---|---|
Integer |
Integer returns a unique value based on x, y coordinates |
checks if the current instance is equal to another
Param | Description |
---|---|
other |
The object to check for equality |
Type | Description |
---|---|
Boolean |
Boolean returns true if the objects are equal, false otherwise |
Param | Description |
---|---|
other |
the other object to determine sort order |
Type | Description |
---|---|
Integer |
Integer negative when this is smaller, positive when greater, 0 when equal |
Processes flow input values and returns flow output values
Default constructor for shared initialization
Constructor used for bulk flow processing
Param | Description |
---|---|
inputs |
the flow inputs from a collection of bulk flow inputs |
Constructor used for single bulkified flow processing
Param | Description |
---|---|
inputs |
the flow inputs from a collection of flow inputs |
processes a single bulkified flow
Type | Description |
---|---|
List<UniversalFlowInputOutput> |
List<UniversalFlowInputOutput> the flow inputs from a bulkified flow transaction |
Type | Description |
---|---|
List<List<UniversalFlowInputOutput>> |
List<List<UniversalFlowInputOutput>> the flow inputs from a collection of flow inputs |
prepares the data structures we need to process
Attempts to instantiate controllers and records errors
runs each of the requested methods with the related inputs