Variables

In the context of the Data Source settings, variables enable you to pass values from the application layer to the data-access layer. This mechanism is typically used to compensate for the fact that session information is not otherwise available for the mappings or joins. The current user’s preferred language, for example, can be fetched by a business object and set to a variable, which can then be used in join criteria or default values for mappings.

To add a variable

  1. Go to Data Sources.
  2. Right-click on the data source and select Mappings.
  3. Right-click anywhere in the Business Object Mappings list and select Variables from the context menu. Variables apply to the entire application—not to individual mappings—so it does not matter which mapping you click on.

    The Variables window opens. It shows the current variables (if any) defined for your applications.

  4. Click Add.
  5. Set the following:

    Name

    The name of the variable. You must take care to ensure that your variable names will not also appear as attribute or parameter names; one way of doing this is to start all variable names with "@".

    Type

    The data type of the variable (integer, real, datetime, and others.). Set this to match the type of data that will be held by the variable

    Size

    The size of the variable (in characters). Set this to match the maximum expected size of the variable value.

  6. Click OK.