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.
Process.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.
Process.PluginDescribeResult.InputParameter ip = new
Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,
Process.PluginDescribeResult.ParameterType.Enum, Boolean_required);
Here’s the constructor for the Process.PluginDescribeResult.OutputParameter
class.
Process.PluginDescribeResult.OutputParameter op = new
new Process.PluginDescribeResult.OutputParameter(Name,Optional description string,
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.
Process.PluginDescribeResult.inputParameters =
new List<Process.PluginDescribeResult.InputParameter>{
new Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,
Process.PluginDescribeResult.ParameterType.Enum, Boolean_required)
For
example:
Process.PluginDescribeResult result = new Process.PluginDescribeResult();
result.setDescription('this plugin gets the name of a user');
result.setTag ('userinfo');
result.inputParameters = new List<Process.PluginDescribeResult.InputParameter>{
new Process.PluginDescribeResult.InputParameter('FullName',
Process.PluginDescribeResult.ParameterType.STRING, true),
new Process.PluginDescribeResult.InputParameter('DOB',
Process.PluginDescribeResult.ParameterType.DATE, true),
};
Process.PluginDescribeResult.OutputParameter is a
list of output parameters and has the following
format.
Process.PluginDescribeResult.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
new Process.PluginDescribeResult.OutputParameter(Name,Optional description string,
Process.PluginDescribeResult.ParameterType.Enum)
For
example:
Process.PluginDescribeResult result = new Process.PluginDescribeResult();
result.setDescription('this plugin gets the name of a user');
result.setTag ('userinfo');
result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
new Process.PluginDescribeResult.OutputParameter('URL',
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
For
example:
Process.PluginDescribeResult result = new Process.PluginDescribeResult();
result.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
new Process.PluginDescribeResult.OutputParameter('URL',
Process.PluginDescribeResult.ParameterType.STRING, true),
new Process.PluginDescribeResult.OutputParameter('STATUS',
Process.PluginDescribeResult.ParameterType.STRING),
};