This functionality is only available for certain module packages.

Selection formula

For placeholders and extension points a selection formula can be specified (see the following figure), which determines during instantiation and / or updates which of the visible library components is to be instantiated. With manual configuration, the selection can be limited to a subset of the library components of the extension point.

The following rules apply to the calculation of the selection formula:

Note:

Manual updating of the extension points:

If the number of components to be instantiated is larger than the specification for multiplicity allows, the instantiation is not performed. A corresponding error message is output.

Updating the extension points during the creation of a project:

If the number of components to be instantiated is larger than the specification for multiplicity allows, the instantiation is performed. It is recommended to check the model for validity by using the menu item Model > Validate model

If the selection formula does not yield a Boolean value, or if a formula error occurs, this will be displayed after updating the extension points: The affected library components are instantiated, and – in analogy to the Disabler – the result of the selection formula for this project component is displayed on the parameter page. The result can be analyzed with the formula inspector.

Note:

If the selection formula cannot determine a value, the placeholder and / or extension point will behave as if there is no selection formula.

The model variable Maximum Number Of Classes To Check For Placeholder Selection Formula defines a limit from which a warning will be issued. The warning alerts the user that the evaluation of the selection formula will take up a longer period of time. This happens when many library components correspond to the type of the extension point (e.g., if Engineering.Component is selected as the type). The selection formula must then be calculated for every possible library component.

Example:

Selection formula:

=mc.$SelectionConditionAndType.name.startsWith('A')

Here, instantiation is made dependent on a condition in the enclosing mechatronic component, combined with a class nomenclature.

Note:

When instantiating via Drag & Drop, the selection formula for the placeholder or extension point is not calculated during the drag process, so that the instantiation cannot be excluded. If the instantiated component contains further extension points with selection formulas, these will be evaluated.