Saturday 12 October 2013

Process.PluginDescribeResult Class

The Process.PluginDescribeResult class is used to determine the input parameters and output parameters needed by theProcess.PluginResult class.
Use the Process.Plugin interface describe method to dynamically provide both input and output parameters for the flow. This method returns theProcess.PluginDescribeResult class.
The Process.PluginDescribeResult class can't be used to do the following functions:
·         Queries
·         Data modification
§  Email
§  Apex nested callouts
Process.PluginDescribeResult Class and Subclass Properties
The following is the constructor for the Process.PluginDescribeResult class:
Process.PluginDescribeResult classname = new Process.PluginDescribeResult();
The following describe the properties of Process.PluginDescribeResult and its input and output parameter subclasses:
·         PluginDescribeResult Class Properties
·         PluginDescribeResult.InputParameter Class Properties
§  PluginDescribeResult.OutputParameter Class Properties
The following is the constructor of the Process.PluginDescribeResult.InputParameter class:

Process.PluginDescribeResult.InputParameter ip = new
    Process.PluginDescribeResult.InputParameter(Name,Optional_description_string,
      Process.PluginDescribeResult.ParameterType.Enum, Boolean_required);
The following is the constructor of 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 the following additional 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.outputParameters = new List<Process.PluginDescribeResult.OutputParameter>{
    new Process.PluginDescribeResult.OutputParameter('URL',
        Process.PluginDescribeResult.ParameterType.STRING),
Both classes take the Process.PluginDescribeResult.ParameterType Enum, which has the following values:
·         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),

            };

No comments:

Post a Comment

How to include a screen flow in a Lightning Web Component

 Hi, Assume  you have a flow called "Quick Contact Creation" and API Name for the same is "Quick_Contact_Creation". To i...