WebSphere Lombardi Edition 7.2 > Modeling processes > Advanced modeling tasks


Manage and mapping variables

In Lombardi, variables capture the business data that is passed from step to step in a process. When you develop Business Process Definition (BPDs) in Lombardi, you should spend time creating data models for those BPDs during the design phase. To create a data model, compile a list of all data that a process requires, determine how to best represent that data in Lombardi, and develop an understanding of how to effectively pass that data from one step to the next in your process. Understanding how variables work, the available variable types, and other topics covered in this section will enable you to develop a comprehensive and effective data model for your Lombardi process.

You can think of variables in Lombardi as names that point to values in memory. For example, a process you are designing may need a customer account number to properly execute. If so, you can declare a variable in your process called accountNumber. When the accountNumber variable is called during process execution, it points to the value of the account number in memory. For example, if an end user provides 50891 as the value for accountNumber in a Coach form, the rest of the steps in the process have access to that value.


Variable types in Lombardi

During Lombardi installation, the System Data toolkit is imported into the Process Center repository so that each process application and toolkit that you create has access to Lombardi system data. The System Data toolkit includes assets that all Lombardi projects require, including variable types. The Lombardi System Data toolkit provides the following types of variables:

Type Description Includes types such as...
Base types You can create a custom variable type using a base type String, Integer, and Decimal
System types You cannot change or customize ANY, Record, and XMLDocument

Custom types are variable types that you create from a base type, and then further constrain based on pattern, length, or value.

In Lombardi, every variable name is associated with one type of variable. It is the variable type that determines what values are legal for the associated variable. If you create a variable called myInteger, for example, and you associate it with the Integer variable type, myInteger cannot legally store alphabetic characters. When Lombardi encounters a value that is illegal for a type, it attempts to convert the value to a correct type using variable conversion rules before throwing an exception. If you do not know the type of the variable during development when you are declaring variables, you should use the ANY type.

The following table provides more information about the base variable types provided in Lombardi System Data toolkit:

Base variable type Description
String Allows alpha-numeric characters to be entered into the variable.
Integer Accepts digits without a decimal place, such as 45 or 20.
Decimal Allows you to enter numbers with a decimal place, such as 45.3 or 20.139.
Date Allows date and time formats to be entered into the variable.
Time Allows date formats to be entered into the variable as times. 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 Allow you to provide a list of possible entries to an end user, of which the user can select only one. A selection is a list of different values; each value is typed as a string. A selection type appears at run time on a Coach form as a drop-down list or as radio buttons.
Boolean Accepts either true or false as values. It appears at run time on a Coach form as a check box.
Structure To use a Structure type, you need to create a custom Structure type because a usable structure must have defined properties. A structure is simply a way of grouping business data that is related to the same subject. For example, a Customer structure might contain elements such as lastName, firstName, homeNumber, streetAddress, and so forth.

For the system variable types provided in Lombardi System Data toolkit, you can open the variable type in the Designer in Lombardi Authoring Environment to learn when and how to use the type. For example, to open the Record variable type included in the System Data toolkit, follow these steps:

  1. Open a process application in the Designer in Lombardi Authoring Environment.
  2. Click the indicator next to the Toolkits category to see a list of toolkit dependencies for the current process application.
  3. Click the indicator next to the System Data toolkit to see its contents.
  4. Click the Data category and then double-click the Record variable type to open it.
  5. The Documentation field provides information about the variable type.

    The description informs you that a record is a group of ANY types and that you do not need to declare the number of ANY typed variables that you want to go into the Record. So, the Record type is similar to a Structure type, except you do not need to declare the type or the number of variables it contains.

To learn about other system variable types included in Lombardi System Data toolkit, open the type, read the documentation provided, and examine the parameters and parameter properties, when applicable.


Variable scope in Lombardi

In Lombardi, the variables that you declare for a Business Process Definition (BPD) or service are local variables. Local variables are only accessible to the currently executing process instance or service. When a running process instance or service reaches an exit point, the variable values are no longer available in memory. Because of the local nature of process variables, you must explicitly define the variables for each BPD and service that implements your overall process, including nested BPDs and services. Because variables are unique to an individual BPD or service, you can use a variable of the same name in a nested BPD or service and there are no conflicts at run time.

All Lombardi variables are JavaScript objects. Lombardi uses namespaces to organize these objects and their functions and methods. The following table describes the namespaces most commonly used during process design and development in Lombardi:

Namespace Description
tw Top-level Lombardi namespace
tw.object Access Lombardi JavaScript objects and variable types
tw.local Access and update BPD and service-level variables
tw.system Access system features and functionality
tw.system.org Access security functionality
tw.epv Access exposed process values (EPVs)
tw.env Access environment variables

To learn more about the JavaScript API, see the reference information posted to the Lombardi Documentation Wiki: http://wiki.lombardi.com/display/tw7/Teamworks+7+JavaScript+API. (You must have an account for the IBM Customer Support for Lombardi site to access the wiki.)

The namespaces above are available to you as you develop processes in the Designer. This enables you to:

Parent topic: Advanced modeling tasks

+

Search Tips   |   Advanced Search