Use the Imported Model builder to import into one model the complete builder call set of a second model.
Use this builder when there are common builders that you would like to use in all of your models.
When you import a model, the model is imported at generation time. An imported model has "read only" status. This means that the host model invokes all the builder calls in the imported model, but cannot change any of the builder inputs of those builder calls. Errors encountered at generation time are displayed in the message panel. Click on the error to open the builder call for editing.
Builders within the imported model do not appear in the host model builder list. However, objects created by those builders are displayed in the reference chooser and in the Application Tree.
Best uses for this builder
The following uses are best for this builder.
- Duplicating functions in different models
To duplicate some similar functions in several differenct models, take advantage of the Profile Handling input. When you make a function that is to be used in different models, typically a few builder inputs need to be different in individual models. You can profile those builder inputs in the model that represents the function to be shared. In the Imported Model builder, you set the Profile Handling input to Set Individual Inputs to specify the profiled inputs.
Note that this technique is a best practice used in making your own builder. The use of the Imported Model builder is an interim step in making a new builder. (Model-based builders are based on the same code as the Imported Model builder.) If you have the Imported Model builder working to your satisfaction, it is very short process to make your own builder.
This technique of duplicating functions has several advantages. It provides better control over the inputs to the builder in the builder call editor. It offers better documentation to people who have to maintain the resulting code. It also provides the ability to insert some code in the generation process or the builder fulfillment process. Many of the model-based builders that the Web Experience Factory team creates demonstrate the use of this technique.
- Guaranteeing the same definitions in different models
To define events and shared variables that must be consistently used throughout applications, use the Imported Model builder to import Event Declaration and Shared Variable builders. This technique is similar to using header files in the C++ language and thus guarantees that all models see the same definitions.
For example, you can create a model that just
contains Event Declaration builder calls. In other models that are
handling these events, add an Imported Model builder and specify the
model that contains all the event declarations. This is a useful
strategy in creating applications that communicate with each other by
The Imported Model builder does not detect new profile sets. The Profile Handling input has the option Use parent profiling. If you add a new profile set to the imported model, the profiling initially does not work. To work around this issue, open the Imported Model builder everywhere you have imported it, toggle the profile handling input, and then click OK. Thus you need to open each model that uses the common Imported Model builder and refresh the builder user interface (UI).
Avoid name collisions
An Imported Model builder does not retain its own namespace. Ensure that the builder names in the imported model are different from those in the host model. Generation errors occur if duplicate names exist.
Parent topic: Builder help
About using the builder call editor