Parse Structured form
|
|
Use the Parameters tab to identify any variables used as input parameters to, or results from, the parse structured rule.
This tab is optional; not every parse structured rule has parameters. When the rule is called, the system places parameter names and values on a nameless, classless page known as the parameter page, and noted by the prefix keyword param
. For example, param.depth refers to the depth parameter.
The declared type of a parameter (such as Integer
, Double
, or DateTime
) indicates the format of a value. When evaluating expressions, the Pega Platformfollows the same casting and type conversion operations as for properties.
Parameter names are not properties, and are not defined by a property:
Param
keyword followed by the parameter name (though the parameters are not truly properties).Param
keyword followed by the parameter name. (The parameter page is available to the calling rule only when the Pass current parameter page? check box is selected in the Call instruction.)Recording an activity's outputs or results on the parameter page is only useful when the parameter page is passed into this activity by reference, using the Pass current parameter page? check box in the Call instruction. When checked, one parameter page is shared between the calling and called activity. Otherwise, parameters on the called activity's parameter page are not available to the calling activity after a return.
The Call instruction examines the In/Out value of each parameter in the called activity:
Out
and the entire parameter page of the current activity is shared with the calling activity, then the value of the Out parameter in the call may be of the form param.name. If the called activity updates the output parameter, the resulting value is available on the parameter page of the calling activity. Out
and the value of the parameter in the Call panel is itself a property reference, then traditional call-by-reference semantics applies. That is, if the called activity updates the parameter value, the value of the property itself is updated.Do not list a local variable as the destination for an Out
parameter. Do not pass a parameter reference as the destination for an Out parameter, unless passing the entire parameter page.
In a chain of calling activities (activity Alpha calls Beta which calls Gamma), a property passed by reference from Alpha to Beta can also be passed by reference to Gamma, and changes to the Out
parameter made within Gamma can be passed all the way back to Alpha. This corresponds to the behavior of call-by-reference in many programming languages.
Complete a row of this array to define parameters for this activity. Within the activity, you can reference parameters with the keyword param
followed by a period and the parameter name.
Field |
Description |
||||||||||||||||||||||
Name |
Enter a name of your choice for a parameter. A parameter name must be a valid Java identifier. See How to enter a Java identifier. Don't use a name that starts with pz. Don't choose any of the reserved names. If this activity is to be referenced in a flow rule, don't choose a name that matches any of the system-supplied parameters. |
||||||||||||||||||||||
Description |
Enter a text description of this parameter, for information only. This description appears when a developer completes parameter values. |
||||||||||||||||||||||
Data Type |
Parameters have a type similar to
If the type is When entering parameters to call an activity, the values for
|
||||||||||||||||||||||
Required? |
Choose On the Call panel, parameters you mark as required appear with an asterisk . For a parameter with a Data Type of Don't select Required? for an Out parameter, a parameter where In/Out is set to |
||||||||||||||||||||||
In/Out |
Select Parameters you identify as The system does not prevent setting the value of an In parameter. A called activity can access and change both In and Out parameters on the parameter page. See Notes on Out parameters above regarding storing activity results on the parameter page. |
||||||||||||||||||||||
Prompt Default Value |
Optional. You can enter a literal constant value that appears as the default parameter value when the system presents a parameter prompt form for this activity to a user. |
||||||||||||||||||||||
Type for SmartPrompt |
Optional. For some parameters, you can configure SmartPrompt facilities to list a set of values for the parameter that a person running the activity can choose from. (This is not important if this activity is to be called from another activity with computed parameter values.) The values listed by SmartPrompt must be a key part to a concrete class with one to three key parts. To enable SmartPrompt operation, enter a class name here (such as Rule-Obj-FieldValue or Data-Party-Gov) to create configuration that, at runtime, allows a user to enter this parameter using SmartPrompt. |
||||||||||||||||||||||
Validate As |
Optional. Identify a property for SmartPrompt operation. If you selected Rule-Obj-FieldValue in the SmartPrompt Rule field, enter here the second key part of the field value rules to appear at runtime in SmartPrompt lists. If you selected another class in the SmartPrompt Rule field, identify a property that is a key part of the indicated class, if the class key contains more than one key part. |
Several input parameters are automatically available for activities used in flow processing — that is, activities with an Activity Type on the Security tab set to Connect
, Utility
, Route
, Notify
and Assign
. Your activity cannot alter the value of these system-maintained parameters, but can use them as inputs, using the normal Param.Name notation.
For example, system parameter Param.pyDraftMode
is true when the flow is in draft mode.
Click Show System Parameters to review the names and descriptions of these parameters. This button is not visible for other activity types. Click Hide System Parameters to hide this area. See How to create activities for flows for information on these and other system parameters.
Use the Local Variables section to create scalar variables. Local variables are stored together as fields in the Java class that is generated to implement the activity. These require less memory and execute faster than regular parameters. They are often used to pass information from step to step.
Local variables do not appear on the parameter page.
A local variable of type StringBuffer may be assembled in multiple steps, as a Property-Set on a StringBuffer appends the value to the StringBuffer.
Use the Local
keyword to reference a local variable in a Property-Set method.
To avoid Java null pointer exceptions, the system initializes String
local variables to the empty string, and the StringBuffer
local variable as:
public StringBuffer aBuffer = new StringBuffer();
Field |
Description |
Name |
Enter the name you choose for the local variable, any legal Java identifier. See How to enter a Java identifier. Don't choose a name that starts with pz or any of the reserved names. |
Description |
Enter a text description of this local variable, for information only. |
Data Type |
Select the type of data that is expected as the value for the variable. Choose:
|
Three standard methods manipulate String Buffer
local variables. See: