SysML, UAF, UML, and UPDM Profiles > SysML profile > Blocks > Ports, flow specifications and interface blocks > Redefinitions of SysML items (SysML) > Redefinitions of SysML items (SysML)
  
Redefinitions of SysML items (SysML)
This topic describes how some SysML items can be redefinitions, and how those redefinitions can be virtual and real.
Modeler can create redefinitions of the following items: Block Properties, Constraint Parameters, Constraint Properties, Flow Ports, Flow Properties, Full Ports, Interface Properties and Proxy Ports.
Modeler can create a virtual redefinition of the preceding items when their owning items are used as a type.
For example, if a Block Property uses a Block as its type and that Block owns a Flow Port, Modeler creates a virtual redefinition of the Flow Port for when it is used in the context of the Block Property.
There is no item in the model for a virtual redefinition - a virtual redefinition is effectively a pointer to the item it redefines.
If you make the following changes to a virtual redefinition in context, Modeler makes the virtual redefinition into a real redefinition:
Change the type of the redefinition.
Change the Multiplicity of the redefinition.
Change Text tab properties of the redefinition.
Change the Default Value of the redefinition.
Apply Stereotypes to the redefinition.
Add relationships to the redefinition (whether Modeler creates a real redefinition depends on the relationship type and whether the redefinition is the start or end item).
On creation, a real redefinition inherits its properties and relationships from the item it redefines. Thereafter, the preceding changes can be made to a real redefinition independently of the item it redefines. All other properties of a redefinition are inherited and are common to all redefinitions of an item.
You can tell if a redefinition is virtual or real through its context menu, assuming that you have write access to the item:
On an Internal Block Diagram, if the Delete Redefinition from Model command is available, the redefinition is a real redefinition; if the Delete Redefinition from Model command is not available, the redefinition is a virtual redefinition.
In the Parts pane, if the Delete command is available, the redefinition is a real redefinition; if the Delete command is not available, the redefinition is a virtual redefinition.
Note that if you delete a real redefinition, the item may still appear in an appropriate pane and on diagrams, but it will have reverted back to a virtual redefinition.
The rest of this topic runs through an example that demonstrates how a Block Property can be made into a real redefinition, and how it can then have properties set in context.
Example of virtual and real redefinitions
This topic is written for Block Properties, but Flow Ports, Full Ports, Proxy Ports and Flow Properties behave in the similar way.
1. We start by creating a Package, and in that Package we create three Blocks named Bicycle, Wheel and Tire.
2. We right-click the Bicycle block and create an Internal Block Diagram.
3. On the Internal Block Diagram, we populate the owning Block, and then create a Block Property in the Bicycle block - we use the Wheel block as its type and set the name of the Block Property to Front Wheel.
Block owned Block Properties are not redefinitions.
4. In the Front Wheel block property, we create another Block Property - we use the Tire block as its type and set the name of the Block Property to Front Tire.
5. When you create a Block Property in a Block Property, Modeler creates the nested Block Property as a child of the nesting Block Property's type. In our example, you can see in the Packages pane that the Front Tire block property has been created as a child of the Wheel block, that is, a child of the Front Wheel block property's type.
The Parts pane allows you to see the Front Tire block property on the type and in context.
6. The Front Tire block property on the diagram has been inherited from the Wheel block - this makes the Front Tire block property on the diagram a redefinition.
A Block Property can have many redefinitions, that is, it can be used in many different contexts. The Front Tire block property on our diagram is being used in the context of the Bicycle block and the Front Wheel block property.
We will refer to the Front Tire block property on the diagram as the Front Tire block property in context.
7. The Front Tire block property in context is a virtual redefinition - there is no item in the model for the Front Tire block property in context. When you view the Property Pages of a virtual Block Property, you are viewing the properties of its associated real Block Property.
8. If you right-click a virtual redefinition of a Block Property on an Internal Block Diagram, the Delete Redefinition from Model command is not available, because there is no model item to delete. Note that the Delete command is available so that you can delete the symbol from the diagram.
9. We now change the Description property of the virtual Front Tire block property in context to 'my description' - we open the Property Pages for the Front Tire block property in context, and on the Text tab for Description type 'my description'.
The Front Tire block property in context is now a real redefinition. If we right-click the Front Tire block property in context, we see that the Delete Redefinition from Model command is now available.
The Description property of the Front Tire block property in context has changed, but the Description property of the Front Tire block property owned by the Wheel block is unchanged.
10. We now set the Default Value of the Front Tire block property in context
On the Internal Block Diagram, notice that the type of the Front Wheel block property (Wheel) is now shown in brackets.
The brackets indicate that a Default Value of the type has been redefined by a contained Block Property on the diagram. In our example, the Front Tire block property in context has a Default Value of 'my default value in context', whereas on the Wheel type the Front Tire block property has a Default Value of 'my default value'.