Create a new model

Related Topics ...

Overview: Builder Architecture

Creating a Model-based Builder

We can create your own wizard for creating a Model in the Factory. Your wizard will appear as additional choice in the "Select Model" dialog that appears whenever you create a new Model. It is easy to build such a wizard because the same tools and technologies used for making Model-based Builders are used to create wizards.

To create a wizard that builds a new model:

  1. Create a Model containing the Builders you want to have in the Model that is generated when your wizard is run.

  2. Profile any inputs that you want to expose as inputs in the Wizard. If there are builders you want to conditionally appear, profile the "Enable Builder" property of that builder.

  3. In Builder Skeleton Builder and pick the "Model-Based Wizard" choice.

Fill in the inputs much as you would for a Model-based Builder, including specifying the parameters of each of the wizard inputs. You will probably want to enable the "Generate Coordinator" choice.

  1. In the "Builder Pages" section, type in the names and text for your wizard pages. In the "Builder Inputs" section, set the "Page ID" input for the page where you want each input to appear. (Note: The Page ID input appears only if you are creating a wizard since it is not used for Builders.)

  2. Click OK and Builder Skeleton will generate the following items:

  • A .wdef file that defines the wizard - . .wdef files are just like .bdef files, except that they have extra "PageDefinition" and "Page" elements to control wizard pages. The "Domain" elements in the .wdef must be set to the Builder domain plus "_Wizard", for example "WebApp_Wizard").

  • A starter Coordinator class - This class can be used to provide custom logic when the Wizard is running, in the same way that a Builder Coordinator does for a Builder.

  1. To see your new wizard in action, you first need to bring up the Builder palette and click the "Refresh" button.

At this point we can work with your Coordinator class to control things like showing/hiding inputs, or setting any inputs that need to be calculated based on other inputs. We can also edit your .wdef, for example to adjust the InputDefinitions. We can take advantage of all the functionality available there, including the ability to inherit input types and even to inherit Coordinator functionality.

For an example of a simple wizard, the "Tutorials and Samples Builders" feature set has a wizard called "Sample Main & Page." You can examine and modify the .wdef, Coordinator, and base model for that wizard.