Portlet Factory, Version 6.1.2
Obtaining initialization data for a contained model
The contained model obtains the initialization data through a variable called ModelInitializationData. This variable is added to the contained model at runtime. The variable can be accessed in a builder by using the reference, ${Variables/ModelInitializationData}. It also can be accessed in a method or linked Java object by using webAppAccess.getVaribales().getObject("ModelInitializationData");.
Although it is not required, IBM recommends that a ModelInitializationData variable builder call be added to the contained model. This serves three purposes:
- It allows the contained model to run standalone. When the model is run standalone, the ModelInitializationData variable does not get added automatically as it would if the model was run in a container. Therefore there are errors when the model tries to reference the variable. By adding a ModelInitializationData variable, these errors can be avoided.
- Adding a ModelInitializationData variable populates the reference choosers. When you want to make a reference to the variable, you do not need to type in the reference. It can be selected by using a reference chooser.
- Adding a ModelInitializationData variable provides a default. If the outer model initializes the contained model and fails to pass initialization data, the contained model already has a default that it can use.
Parent topic: Model Container builder
Library | Support |