Imported Model Builder

 

In this topic ...

Quick Tips

Specifying Inputs

Related Topics ...

Creating Builders from Models

Overview: Handling Events

Use the Imported Model builder to import into one model the complete builder call set of a second model. 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 will be 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 WebApp view.

 

Quick Tips

  • Avoid name collisions -- An Imported Model does not retain its own namespace, so you will need to make sure that the builder names in the Imported Model are different from those in the "host" model. generation errors will occur if duplicate names exist.

  • Define common event declarations -- We can create a model that just contains Event Declaration builder calls. In other models that will be handling these events, add an Imported Model, specifying the model that contains all the event declarations. This is a useful strategy in creating portlets that will communicate with each other by using events.

 

Specifying Inputs

The Imported Model builder takes the inputs described in the table below. For help on inputs common to many or all builders such as those in the Properties and HTML Attributes input groups, see "Using the Builder Call Editor."

Input name Description
Name Enter a name for this builder call. The designer tool displays this name in the builder call list.
Model Select the model you want to import.
Profiled Inputs
Profile Handling Use this input to determine how any profiled inputs in the model being imported are handled. We can choose:

  • None - To allow the incoming (parent) model to use the default values for its profiled builder inputs. The importing (child) model will not inherit the profile sets from the parent. No profiling or input substitution will be performed.

    Note that If the Parent Model is set to Profile 1(not Default), then the Child Model will use those values in the Profile 1 Profile Set (NOT Default) for its default builder inputs.

  • Set individual inputs - To analyze the incoming model. New builder inputs will be added to this Imported Model builder call for each profiled input in the incoming model. The values given in this builder call for these new inputs will replace the corresponding profiled inputs in the incoming model when this Imported Model builder call is executed

  • Use parent profiling - To force the child model to use the parent model's profiling environment to resolve its profiled inputs. In addition, when this value is chosen, the Imported Model builder call will itself be profiled using the profile sets used in the child model. This will cause the parent model to expose for profiling all the profile sets being used by the child model at the time this choice is made. (see note below.)

When "Use parent profiling" is selected, if the child model subsequently has profile sets added or deleted, this Imported Model call will become out of synch. We can fix this issue by opening this builder call, selecting "None" for "Profile Handling", re-select "Use parent profiling", and saving the model.

Multiple Instance Support
Pattern to replace Use this input when we need to import the same model multiple times. This input allows you to rename the input names of certain builder calls in the imported model and thus avoid name-space collisions in the parent model.

Enter the builder-call naming pattern use by the incoming model. This pattern will be recognized and all incoming model builder call inputs displaying the pattern will be renamed.

To use this input effectively, you should have established a builder call naming pattern in the model you are importing. For example, builder calls in the incoming model might be named as follows: forImport_XXX.

Such a patter might yield Builder calls with the following names: forImport_orders, forImport_sales, forImport_summary, etc.

Advanced
Import Once Enable this check box to limit importation to a one-time operation.

When enabled, the Builder will examine the WebApp to see if the artifacts being imported already exist from a previous import operation. If they do, they will not be imported again.

This input is useful when you want to import a common piece of code using the Imported Model Builder, but want this code to be imported only once per outer model. This situation might occur when you are building a Builder.

Reset Values from Profiles Click this button to populate the profiled inputs from one of the profiles in the profile set(s) associated with the imported model. When you click this button, a small dialog appears, allowing you to choose the profile from which you want to set the profiled input values.