This page describes each step of the the Automatic Instantiation Instantiation wizardin in detail.If If you are satisfied with the default values provided in the the Automatic Instantiation Instantiation wizard, you can finish the wizard in the first step without making any changes. The instances will be created with the default values and in your working package. If you want to change the default values of a single instance or create multiple multiple sets of instances, followall steps of the the Automatic Instantiationwizard wizard. You can add each set in a different package, as well as display them on the newly created diagrams.
Note
After finishing the wizard, you can create a very large number of instance specifications, depending on the size of your system. That is why we strongly recommend selecting a new package to store all created instance specifications.
Opening the Automatic Instantiation wizard
To open the the Automatic Instantiationwizard wizard
Select the Block for which you want to create instances.
From the shortcut menu, select select Tools> > Create Instance. TheAutomatic Automatic Instantiationwizard wizard opens.
The Automatic Instantiation wizard steps
The The Automatic Instantiation Instantiation wizard consists of three steps:
Table of Contents
maxLevel
4
minLevel
4
Step #1. Select parts to be instantiated
In this step, you can see all the available instance specification values (parts) of your selected element. At this point, you can select which parts or properties to instantiate, create or select values for parts and properties, as well as add or remove parallel parts.
You can select/deselect the parts by clicking the check marks next to the parts or the options in the Selection area.
Parts are displayed if the multiplicity is greater than 1. The number of parts displayed depends on the multiplicity.
The number of parts displayed will equal the multiplicity. For example, if the multiplicity is 2, you will see 2 parts displayed in the Automatic Instantiation Instantiation wizard. Also, in this case, you will not be able to add parallel parts or remove existing parallel parts.
If the multiplicity is defined as an interval (for example, 0..*, 1..10, 1..* ) or *, only one part will be created by default. If you need more parts, you can create them by pressing pressing Insertor selecting or selecting Add parallel partfrom from the selected property’s shortcut menu.
If the multiplicity is 1, parts will not be created.
The parts and properties are displayed with the suggested types, names, and values. In this step of the wizard, you can change them.
Selecting a value for an instance
To select a value for an instance
Select a part to be instantiated to which you want to add a value.
In In Instantiated properties, click a a Valuespecification specification cell and then click the ... button.
The The Select Instance Specificationdialog dialog opens.
In the opened dialog, select the instance specification you want to add for the selected instance.
Click the the OKbutton button.
To create a value for an instance
Select a part to be instantiated for which you want to create a value.
In the the Instantiated properties properties area, click the Valuespecification specification cell and then click the the Show Shortcut Menubutton button.
In the opened shortcut menu, point to the the Value Specificationand and then select one of the available value types.
In the Value the Value cell, type the desired value.
Changing the name of an instance
Each instance has a a default name that uses the dot notation. However, you can change the default name by clicking the value row next to the the Nameproperty property and typing the new name for the instance.
Image Modified
Applying a custom stereotype to an instance
You can also apply the custom stereotype to the instance. Only those stereotypes can be applied that have have Instance Specificationas as their metaclass and whose customizations have a meta property named classifier with the the New Typesproperty property value set to the instantiated element’s type.
The
custom
custom «ControllerFMU»
and
and «ControllerSTM»
stereotypes
stereotypes have Instance Specification as their metaclass and their respective customizations
ControllerFMU Customization
ControllerFMU Customization and
and
ControllerSTM
Customization have
Customization have a meta property named classifier with the New Types property value set to
the
the «Block»
stereotype
stereotype. Since the Controller
block
block has
the
the «Block»
stereotype
stereotype applied,
the
the «ControllerFMU»
and
and «ControllerSTM»
stereotypes
stereotypes can be applied to the Controller block's instance.
Changing a type for an instance
You can change the type for the Part Property instance only if that type is a subtype of a Block (connected connected through Generalization). As shown in the following figure, the the Engine GM Block and and Engine GMR Block are subtypes of the Engine Block. When creating an instance for the the VehicleBlock Block, you can change the type of the engine Part Property by selecting one of the following: Engine GM Block, Engine GMRBlock Block, or Engine Block.
Changing the type for a Part Property instance directly in the Automatic Instantiation dialog.
Step #2. Select a package
In this step, you can select the package to store instance specifications. You can select an an existing package from the element tree, create a new package, or clone selected selected packages.Click the Finish button button after this step if you do not want to display your created instance specifications.
To create a new Package in the element tree
In the element tree, select the Package for which you want to create the new one.
Click the the Creation Modebutton button.
Click the the Create Ownerbutton button.
From the open menu, select the package kind. The Specification window of that package opens.
Type its name.
Click Click Close.
To clone the Packages Packages in the element tree
In the element tree, select the Package to clone.
Info
The Package is cloned recursively including all nested structures.
Click the the Clonebutton button.
The Specification window of cloned Package opens.
Type its name.
Click Click Close.
Step #3. Create a diagram (optional)
In this step, you can choose whether or not to show your created instance specifications in a new diagram. If you do not wish to create a new diagram, you can simply skip this step by clearing the the Create a new diagramcheck box.
To display instance specifications in the new diagram
Make sure the the Create a new diagramcheck box is selected.
(Optional) If you want to create and display links between your instance specification(s), select the the Create link between instancescheck box.
Fill in the the Type diagram namefield field by typing the diagram name.
Info
title
Note
By default, the diagram name is the selected Package's name in Step 2.
From the the Select diagram type drop-down list, select one of the diagram types.
Specify the owner for a new diagram:
Select existing Packages from the tree.
Click the the Create Ownerbutton to create a new one.
Click the the Clonebutton button to clone existing Packages.