Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Using the Process.PluginDescribeResult Class
Use the Process.Plugin interface describe method to dynamically provide both input and
output parameters for the flow. This method returns the Process.PluginDescribeResult class.
The Process.PluginDescribeResult class doesn’t support the following functions.
- Queries
- Data modification
- Apex nested callouts
Process.PluginDescribeResult Class and Subclass Properties
Here’s the constructor for the Process.PluginDescribeResult
class.
1Process.PluginDescribeResult classname = new Process.PluginDescribeResult();- PluginDescribeResult Class Properties
- PluginDescribeResult.InputParameter Class Properties
- PluginDescribeResult.OutputParameter Class Properties
Here’s the constructor for the Process.PluginDescribeResult.InputParameter
class.
1Process.PluginDescribeResult.InputParameter ip = new
2 Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,
3 Process.PluginDescribeResult.ParameterType.Enum, Boolean_required);Here’s the constructor for the Process.PluginDescribeResult.OutputParameter
class.
1Process.PluginDescribeResult.OutputParameter op = new
2 new Process.PluginDescribeResult.OutputParameter(Name,Optional description string,
3 Process.PluginDescribeResult.ParameterType.Enum);To use the Process.PluginDescribeResult class, create instances of these subclasses.
- Process.PluginDescribeResult.InputParameter
- Process.PluginDescribeResult.OutputParameter
Process.PluginDescribeResult.InputParameter is a
list of input parameters and has the following
format.
1Process.PluginDescribeResult.inputParameters =
2 new List<Process.PluginDescribeResult.InputParameter>{
3 new Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,
4 Process.PluginDescribeResult.ParameterType.Enum, Boolean_required)For
example:
1Process.PluginDescribeResult result = new Process.PluginDescribeResult();
2result.setDescription('this plugin gets the name of a user');
3result.setTag ('userinfo');
4result.inputParameters = new List<Process.PluginDescribeResult.InputParameter>{
5 new Process.PluginDescribeResult.InputParameter('FullName',
6 Process.PluginDescribeResult.ParameterType.STRING, true),
7 new Process.PluginDescribeResult.InputParameter('DOB',
8 Process.PluginDescribeResult.ParameterType.DATE, true),
9 };
Process.PluginDescribeResult.OutputParameter is a
list of output parameters and has the following
format.
1Process.PluginDescribeResult.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
2 new Process.PluginDescribeResult.OutputParameter(Name,Optional description string,
3 Process.PluginDescribeResult.ParameterType.Enum)For
example:
1Process.PluginDescribeResult result = new Process.PluginDescribeResult();
2result.setDescription('this plugin gets the name of a user');
3result.setTag ('userinfo');
4result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
5 new Process.PluginDescribeResult.OutputParameter('URL',
6 Process.PluginDescribeResult.ParameterType.STRING),Both classes take the Process.PluginDescribeResult.ParameterType Enum. Valid values are:
- BOOLEAN
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- FLOAT
- ID
- INTEGER
- LONG
- STRING
- TIME
For
example:
1Process.PluginDescribeResult result = new Process.PluginDescribeResult();
2 result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
3 new Process.PluginDescribeResult.OutputParameter('URL',
4 Process.PluginDescribeResult.ParameterType.STRING, true),
5 new Process.PluginDescribeResult.OutputParameter('STATUS',
6 Process.PluginDescribeResult.ParameterType.STRING),
7 };