Use a Variable builder call to store temporary or persistent data in a model.
Use this builder when you want to create an XML variable or a simple schema, or if you have a schema, but do not have any sample data. The Variable builder let you type or paste XML data; the Import To XML builder imports an XML file. Use Variable builder to create an XML variable with the desired structure, and then use Simple Schema Generator to make a schema from that Variable.
Use the variable builder to generate some sample data. Select the Variable builder and use the Type select to navigate to your schema. After you have selected the schema, a “Create Sample Data” button will appear. Click this to generate your sample data.
Other builders within your model can use a variable value as a data source or modify or process variable content in any way. Variables are not accessible to builders outside of the model in which they reside. To expose a variable value to a linked model, you must create accessor methods that get and set any variable values.
Naming a variable
Use an easy to understand name for a variable. This name is displayed in the tree-based source lists of many other builder edit pages. Using a concise name facilitates locating a variable within a tree.Accessing variable values
You can access variable values by using the reference chooser, available for most builder inputs, or from Method builder calls and linked Java objects.Using methods
You access your model variables and their values by calling the webAppAccess.getVariables()
method. These interfaces are documented in the IBM® WebSphere® Portlet Factory API Javadoc.
Variable builder inputs
This topic describes the inputs for the Variable builder.
Using alternative APIs for DOM and JDOM variables
If you specify an alternative Document Object Model ( DOM ) for a variable, you can use that DOM's API to access the elements of the XML contained by the variable.
Using schemas to provide additional data types
You can declare a variable to be of a type other than the default types by adding a Schema builder to your model.
Parent topic: Builder help
About using the builder call editor
Data Page builder
Simple Schema Generator builder
Getting and setting variable values
WebSphere Portlet Factory API documentation