States use input variables to get input values, either from a session variable or as a constant. You can configure the behavior in the state editor. The InputAttribute class manages input variables.
In addition to the basic properties, input variables have an isOptional property. If set to true, the input variable is optional; false indicates it is mandatory.
InputAttribute (String id, String description, boolean isOptional)
Two types of input variables exist, text box input controls and selection input controls.
Text boxes manage either a single constant value or a value that is accessed from a session variable.
TextBoxAttribute( " POSTCODE " , " Zip or Postal Code " , false);
By default, the variable ID is automatically assigned to the TextBoxAttribute control. In this case, the ID is POSTCODE. The description, Zip or Postal Code, appears to the right. The red dot indicates that the input variable is mandatory.
If you use a state twice in the same application, and if the state saves a value in a session variable, change the session-variable name in the second instance, so it does not overwrite the value.
To find the session-variable name, hover the mouse over the description text; pop-up text includes the variable description and the variable name.
Selection input controls manage constant values that are selected from a list of options. Lists are populated in the state code.
Unique IDs are automatically assigned as the session-variable name; you cannot change them, and they do not appear in the state editor. To find the session-variable name, hover the mouse over the description text; pop-up text includes the variable description and the variable name.
To use a state twice in the same application, and save the value of the session variable, you can call the Copy Variables state to copy the session variable to another variable.
The check box performs the same function as it does for text box controls. The red dot indicates that an input selection is mandatory.