WebSphere Lombardi Edition 7.2 > Modeling processes > Advanced modeling tasks > Manage and mapping variables


Create custom variable types

In Lombardi, you can create a custom variable type by using a base variable type or by defining a new complex structure. For more information, see Variable types in Lombardi.

When you create a new custom variable type in a process application, that variable type is available for all BPD and services included in the process application. To share a custom variable type across process applications, create or store the custom type in a toolkit and then create a dependency on that toolkit from the process applications that require the variable.

The following procedure describes how to create a custom variable type. To complete the following steps, you must have write access to a process application or toolkit in the Process Center repository. Access to process applications and toolkits is controlled by users who have administrative rights to the repository.

  1. Start Lombardi Authoring Environment and open the appropriate process application or toolkit in the Designer view

  2. Click the plus sign next to the Data category and select Variable type from the list.

  3. In the New Variable type dialog enter a name for the variable type and click the Finish button.

    Name variable types so that each word is capitalized like so: MyType. This naming convention enables you to easily distinguish between the variable types that you create and the variables that you declare. Names of variable types are case sensitive.

  4. In the Behavior section, choose a Definition Type from the drop-down list:

    Simple Type Create a new variable type using an existing base type such as String, Decimal, and Integer and further constrain based on pattern, length, or value.
    Complex Structure Type Create a new complex type by specifying the parameters for the structure and the type of each parameter. (See Add process variables to a BPD for the steps involved in creating a complex structure type. See Initializing complex variables and lists to learn how to perform necessary initialization for complex structures.)

  5. In the Simple Type section, choose the base type that you want.

    The following table describes the options as well as how you can further constrain allowed values:

    String Constrain by its length or to a pattern using a regular expression.
    Integer Constrain by a minimum or maximum value, by precision, or by a regular expression.
    Decimal Constrain by a minimum or maximum value, by precision and scale, or by a regular expression.
    Date Constrain the format of the date for users. However, the date type is not stored in the format so dates can be passed easily from process to process.
    Time Constrain the format of the date for users. (The user enters a time, and before the variable is entered into the symbol table, it is converted to and behaves like a date.)
    Selection Provide the value and display text for each possible entry.

  6. In the Validation section, establish the validation rules to further constrain allowed values.

    For example, if you choose the Date base type, select the Date Validation that you want from the drop-down list next to the Format field.

    If you choose yyyy.MM.dd, this variable only accepts dates in the format 2009.08.14 (for August 14, 2009).

  7. In the Error Message text box (in the Simple Type section), type the text that you want to display when a date is not provided in the chosen format.

    For example, a good error message would be: Dates must be in yyyy.MM.dd format

  8. Expand the Advanced Properties section and set the XML serialization options if you want to save the custom variable type to an XML file.

    For complex structure types, you can also set XML serialization options for each parameter.

  9. Click Save in the main toolbar.

    Now you can select the new custom variable type for the variables that you create

Parent topic: Manage and mapping variables

+

Search Tips   |   Advanced Search