To properly work with the Replace and Rewire variation point, additional information is needed. You need information about the compatible types (blocks, activities that can replace each other to some degree) and the compatibility information between the input and output features of those types (ports – for blocks; parameters – for activities).
This compatibility information is entered by the user. The compatibility between types is expressed by the relationships between the common/general element and a set of specific elements. So the generic Engine block is linked with compatibility relationships with the 4 compatible subtypes of it (EcoBoost 1.5L Engine, EcoBlue 2.0L Engine, HybridPowerPlant, Model T 2.9L Engine).
For each compatibility pair of the general-specific types, you also need to specify which input and output features of that type are compatible (which will be remapped during the variant realization). When defining the compatibility for Blocks, you need to specify the relationships between the ports of those Blocks. When defining the compatibility for activities, you need to specify the relationships between parameters.
There are two kinds of relationships you can use to express the compatibility between types:
- Generalization.
- «Compatible». This relationship is based on UML Dependency. Use this relationship when Generalization is not possible (for example, the specific type comes from the library and is therefore read-only).
For declaration of the compatibility between the ports:
- Use the port redefinition mechanism.
- Use «Compatible» relationship when the port redefinition mechanism is not possible.
When declaring the compatibility for the parameters of activities, only the «Compatible» relationship is available.
There are two predefined matrices to help you conveniently declare the compatibilities:
- Type Compatibility Matrix. Use this matrix to declare the type compatibility.
- Input Output Compatibility Matrix. Use this matrix to declare the compatibility between ports.
Learn more