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


Initializing complex variables and lists

Any structures that you declare in Lombardi are considered complex variables. In Lombardi, all complex variables and all lists (arrays) must be initialized before you use them in a BPD or service. If you do not initialize a complex variable or list, you may receive run-time errors or notice that the Coach controls to which the variables are bound do not behave as expected.

Before using a complex variable, initialize it by using a script like the following:

tw.local.requisition=new tw.object.Requisition();

In the preceding script, the name of the variable that is being initialized is tw.local.requisition. The name of the complex variable type is Requisition.

If your complex variable type includes element that are themselves complex variables, then you must initialize them before you use them.

You must also initialize lists before you use them. If you have a list of Strings, you can initialize them using a script like the following:

tw.local.yourStringList = new tw.object.listOf.String();

To see a sample of how complex types are properly initialized, open the Quick Start Tutorial process application in the Designer. (For instructions, see the Quick Start Tutorial Guide or online help.) Open the Submit Requisition service and in the service diagram, click the server script named Initialize Output to select it. Then click the Implementation option in the properties. You can see the scripts used to initialize the complex variables that are included in the BPD.

Parent topic: Manage and mapping variables

+

Search Tips   |   Advanced Search