An Allocator is a non-visual Interaction element that is used to make changes to the value of variables. A change to a variable value is called an allocation. An Allocator item can include one or several allocations.
In the following simple example, we will allocate the value of a field in the new customer variable (defined in the previous example) into a new (simple) variable. Then, we will display the value of the new variable in a Statement.

To allocate a field into a text variable:

  1. From the Edit menu of the Interaction Designer, select Variables.
    The Variables Definition dialog opens.
  2. At the bottom of the dialog, click Add Variable.
    The Variable Definition popup opens.
  3. In the Reference name field, enter first_name. Then, from the Data Type dropdown list, select Text.

  4. Click OK.
    The Variable Definition popup closes, and the new variable is added to the User Variables list.

  5. Click OK.
    The Variable Definition dialog closes, and variables are saved.
  6. From the toolbar, click , and then click inside the Interaction Map.
    The Allocator Definition dialog opens.

  7. At the bottom of the dialog, click Add Allocation.
    Three dropdown lists appear.
  8. From the dropdown on the left, expand the Variable elements node. Then, navigate to and select the first_name user variable.

  9. From the dropdown in the middle, select equals.
  10. From the dropdown on the right, expand the Variable elements node. Then, navigate to and select new customer - first name.


    This allocation gets the value of the first_name field from the new customer object, and sets it into the first_name text variable.
  11. Click OK.
    The Allocator Definition dialog closes.

Using the New Variable in a Statement
The following procedure explains how to display the first_name field inside a Statement. As described in the example above, the value of the first_name field is retrieved by the first_name text variable, using an Allocator. The Interaction will appear as follows:

To display the value of a field in a Statement:

  1. From the toolbar, click , and then click inside the Interaction Map.
    The Statement Definition dialog opens.

  2. Enter a page title and a reference name in the appropriate fields.
  3. At the right side of the dialog, click Editor. This opens the Interaction Designer Text Editor, a tool that enables you to create richer content for Interaction elements.
  4. From the pane at the left side of the Editor, expand the Variable elements node, and navigate to the first_name user variable. Then, drag the variable into the work area of the Editor. You can use the variable inside a paragraph or any other HTML element, such as a table, list, and so on.

  5. If desired, use the toolbar of the Editor to apply colors, styles, and other formatting to the text.
  6. When editing is complete, click OK.
    The Editor closes.
  7. From the Statement Definition dialog, click OK.
    The dialog closes.
  8. Draw a Connector between the Allocator element and the new Statement.
  9. To test the Interaction, right-click on the Allocator element, and then select Run.
    The Interaction is displayed in the Simulation pane.

Revision:

Comments