Defining the input parameters of a rule
Control the type of information that users can pass to a rule by defining input parameters. By referencing these input parameters in your rule logic, you can use run-time data to make decisions.
For example, you can define income, debt, and expense information as input parameters to a rule in a life insurance application. At run time, the rule calculates a debt-to-income ratio to determine which policy plan meets the customer's lifestyle.
- In the navigation pane of Dev Studio, click Records.
- Open the form for a rule that supports parameters.
- Click the Parameters tab.
- Define an input parameter that your rule supports:
- Click the Add item icon.
- In the Name field, enter a unique identifier.
- In the Description field, enter text that describes how your rule logic processes the input parameter.
- In the Data Type list, select a format for the input parameter.
- Optional: To require a non-null value for the input parameter, in the
Required? list, select Yes.
- Optional: To set the initial value of the input parameter, enter a value in the Default Value field that corresponds to the format that you select in the Data Type list.
- If the input parameter has the Data Type field set to
Page Name, on the Pages & Classes tab,
add a corresponding page name and class.For more information, see Defining the pages and classes of a rule.
- On other tabs of the rule form, update your rule logic to reference the input parameter
by using the following notation:
param.[input parameter name]
- To add another input parameter, click Add item, and then repeat steps 4 through 6.
- Click Save.
- Prompting users for parameter values
You can prompt users for values when they run a rule that has input parameters. By displaying a list of options instead of a blank text box, you can help users provide information quickly and accurately.
Previous topic Creating a rule specialized by a class or ruleset Next topic Prompting users for parameter values