# Profiling with explicit profile settings rule enabled

The default behavior for profiling can be altered by including the rule rule-trf-profiling-processing-explicitProfileSettings in the configuration of the Profiler. The following sections describe the behavior of the profiler under this rule.

## 1. Profile Identifier

Same as described here.

## 2. Model Requirements

Profile information for a model element is given via the tagged value "profiles". The value is a comma-separated list of profile identifiers. If the tagged value is missing or empty, then the model element will be removed by the Profiler. This will be explained via examples later on.

## 3. How Profiling Works

### 3.1. Containment of Profile Identifiers

Same as described here.

### 3.2. Profiling of Model Elements

The following subsections describe how the Profiler handles different model elements when the rule rule-trf-profiling-processing-explicitProfileSettings is enabled: generalization relationships, attributes, associations, and association classes. For a better understanding, the profile identifiers in these examples do not contain version indicators. Version indicators are handled the same way as in the default profiling behavior (further details: here - last subsection titled 'Taking Into Account Version Indicators').

#### 3.2.1. Inheritance

The following figure shows how the Profiler handles a generalization relationship between two model classes.

The following diagram shows an invalid profile configuration. It is invalid because the profile set of ClassA does not contain the profile set of ClassB.

Warning | If a class without profile information is part of an inheritance hierarchy, profiling under the specific behavior documented on this page will cause the inheritance tree to be interrupted - unless rule-profiling-processing-classRemovalIncludesAllSubtypes is enabled! ShapeChange will log an error if it detects such an interruption during pre-processing, more specifically while executing rule-trf-profiling-preprocessing-modelConsistencyCheck. Instead of an error message ShapeChange will log an info message, if the interruption will be prevented because rule-profiling-processing-classRemovalIncludesAllSubtypes is enabled.

#### 3.2.2. Attributes

The following two figures show how the Profiler handles attributes.

The next diagram shows an invalid profile configuration. It is invalid because the profile set of ClassA does not contain the (complete) profile set of attribute3.

When ShapeChange encounters such an invalid profile configuration, it logs a warning.

#### 3.2.3. Associations

The following two figures show how the Profiler handles associations.

The next diagram shows an invalid profile configuration. It is invalid because the profile set of ClassA does not contain the (complete) profile set of propCA.

When ShapeChange encounters such an invalid profile configuration, it logs a warning.

#### 3.2.4. Association Classes

The following two figures show how the Profiler handles association classes.

Note | If an association is removed, the association class is removed as well – and vice versa.

## 4. Additional Behavior

Same as described here.