Type Converter

Introduction

(since v2.3.0)

This transformation converts the types of the model. For example, it can convert enumerations to code lists.

Configuration

The following sections specifiy the configuration options for this transformation.

Class

The class for this transformer implementation is de.interactive_instruments.ShapeChange.Transformation.TypeConversion.TypeConverter

Rules

rule-trf-dissolveAssociations

(since v2.4.0)

Dissolves associations that are navigable from types in the schemas selected for processing. Navigable roles of such associations are transformed into attributes. A suffix can be added to the names of these attributes, via parameter attributeNameSuffix. The type of these attributes is set to the type defined by parameter attributeType.

Associations can be excluded from this transformation by:

If an association that is dissolved has an association class, a warning is logged and the class is removed.

rule-trf-dissolveAssociations-excludeManyToManyRelationships

(since v2.4.0)

If this rule is included together with rule-trf-dissolveAssociations, an association is not dissolved if it represents a many-to-many relationship between two types (i.e., all navigable roles have max multiplicity greater than 1).

rule-trf-dissolveAssociations-removeTransformedAttributeIfMultiple

(since v2.4.0)

If this rule is included together with rule-trf-dissolveAssociations, then attributes that result from dissolving an association and have maximum multiplicity greater than 1 are removed.

rule-trf-enumeration-to-codelist

All enumerations are converted to code lists. The category of value of properties with an enumeration as value type is updated accordingly.

NOTE: This rule converts all enumerations within the model to code lists. If a restriction is desired, for example to enumerations that belong to the schemas selected for processing, or to specifically identified application schemas (e.g. identified by name or target namespace regex), the implementation would need to be enhanced (for example through new parameters).

Likewise, no specific tagged values are set. Rules and parameters to control the tagged values of relevant classes can be added in the future.

Constraints are not updated.

Parameters

attributeNameSuffix

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: String

Default Value: the empty string

Explanation: Define a suffix to be added to the names of attributes that have been transformed from association roles.

Applies to Rule(s): rule-trf-dissolveAssociations

attributeType

(since v2.4.0)

Alias: none

Required / Optional: optional

Type: String

Default Value: “CharacterString”

Explanation: Define the type to set for attributes that have been transformed from association roles.

Applies to Rule(s): rule-trf-dissolveAssociations

Map Entries

None at present

Advanced Process Configuration

None at present

Sample Configuration

<Transformer
 class="de.interactive_instruments.ShapeChange.Transformation.TypeConversion.TypeConverter"
 input="INPUT" id="trf" mode="enabled">
 <rules>
  <ProcessRuleSet name="convert">
   <rule name="rule-trf-enumeration-to-codelist"/>
  </ProcessRuleSet>
 </rules>
</Transformer>