Version 20.6.0

New and Noteworthy in Version 20.6

Abstract Attributes in Policy Component Types

It is now possible to define abstract attributes in abstract policy component types, analogous to product component types.

Value Sets

Derived Value Sets

In some cases it is not possible to determine a set of allowed values for a policy attribute in configuration as the allowed values may themselves depend on the values of other attributes. This can now be configured by setting the value set type of the attribute to “derived”. The generated getter method for the allowed values will be marked as @restrainedmodifiable to allow custom user code.
If an attribute is overwritten in a subclass, its derived value set can be overwritten with an unrestricted value set and vice versa.

String Length Value Sets

For persistence relevant attributes, a column size is usually defined that restricts the maximum length of strings. It is now possible to define this in the model as well.
String attributes can now be restricted to a maximum length. If null is provided, the attribute value length is considered limitless. Migrating to 20.6.0 will change all policy attributes of type String, so that the model matches the persistence settings, if possible.

Empty Ranges

Ranges can now be explicitly marked as empty, for example to mark an attribute as irrelevant by disallowing all values, something that was previously only possible for enumerations.

Configuration of Attribute Relevance

When creating a UI based on Faktor-IPS, it is useful to consider the relevance of attributes for a given product. Does a motorcycle insurance really need the number of doors as an input field? This concept can be represented by an empty value set (no values allowed -> field is irrelevant for this product) and by in-/excluding null in the allowed values (if null is allowed, the value is optional, otherwise, it’s mandatory). This can now be made explicitly visible in Faktor-IPS by setting the checkbox “The relevance of the attribute is defined in the product configuration.” for a model attribute. This can be set individually, or, if concrete values are to be configured for a relevant attribute, in addition to “The default value and the set of allowed values are defined in the product configuration.”.

If the relevance is configured in a product, in addition to / instead of (depending on whether the value set is also configured in the product) the old value set control, a row of radio buttons to just choose the relevance is displayed in the product editor. The value set is automatically adapted to the selected relevance.

Cascade Types in Policy Component Type Associations

Cascade types can no longer be activated for child to parent compositions in policy component types. This previously caused errors in certain constellations.

Validation of duplicate Kind-ID/Version-ID Combinations

Product components can be identified in two ways in the Faktor-IPs runtime: With their runtime ID, which must be unique, or with the combination of their kind ID and version ID, which are derived from the unqualified product component name. If two product components with the same unqualified name are created in different packages, they can be identified only via their runtime ID, whereas access with the kind ID and version ID will return only one of the components. To recognize this problem at development time, Faktor-IPS now warns when names are not unique. The severity of this validation can be configured with the new AdditionalSetting “duplicateProductComponentSeverity” in the .ipspoject file.

Runtime-Groovy now in Faktor-IPS Updatesite

The plugin faktorips-runtime-groovy, previously available via the faktorips-runtime-addons updatesite, can now be installed directly from the Faktor-IPS updatesite. For Maven dependencies the same version as for faktorips-runtime and -valuetypes can be used now.

New methods for modifying Product Component Types

Product data in an InMemoryRuntimeRepository can now be modified more extensively than before, so that no overriding in subclasses is needed anymore in order to change the set of allowed values for an attribute in a unit test. This can be done using the generated methods at the components or the builder classes or in a general fashion using the IpsModel. So there are now additional ways of changing policy attributes that are configured by the product and associations of products. Using the methodssetValueSet() andsetDefaultValue() in PolicyAttribute it is possible to change to the set of allowed values or the default value respectively. Associations of products can now be added or removed through the methods addTargetObjects() and removeTargetObjects() in ProductAssociation, similar to the existing methods for associations of policies.

Code Generator Changes

Annotation / Method Description Generated in
set<AssocationName>(<AssocitationType> target, CardinalityRange cardinality) To product type associations with cardinality a setter is now generated even for “to one” associations. It is only generated if the product type association is related to a policy type association and therefore the cardinality configures this policy type association. Product component type class or the respective generation class
add<AssocationName>(<AssocitationType> target, CardinalityRange cardinality) Adder methods for product type associations with cardinality in PolicyCmptType that are unnecessary are not generated anymore. Adder methods with cardinality only make sense if the product type association configures an association on policy side. Therefore adder methods with cardinality are now generated only if the product type association has a matching association on policy side. Product component type class or the respective generation class
@IpsAssociationAdder The set/add<AssocationName>(<AssocitationType> target) methods in ProductCmptType classes or Generation classes are now annotated with @IpsAssociationAdder. The attribtue withCardinality = true is set to the @IpsAssociationAdder annotiation it the set/add method offers CardinalityRange as a parameter. Product component type class or the respective generation class
remove<AssocationName>(AssocitationType target) Faktor-IPS generates remove methods in order to remove product type associations. Product component type class or the respective generation class
@IpsAssociationRemover The remove<AssocationName>(AssocitationType target) methods are annotated with @IpsAssociationRemover.

 

Product component type class or the respective generation class
setDefaultValue<AtrributeName>(<ValueType> defaultValue) If an attribute within a policy is configured by a product, the ProductCmptType class or the relevant Generation classes will have a setDefaultValue<AtrributeName>(<ValueType> defaultValue) method to set the default value of this attribute. Product component type class or interface as well as Generations class or interface
@IpsDefaultValueSetter(“AttributeName”) The setDefaultValue<AtrributeName>(<ValueType> defaultValue) methods are annotated with @IpsDefaultValueSetter Product component type class or interface as well as Generations class or interface
setAllowedValuesFor<AtrributeName>(ValueSet<AttributeType> setOfAllowedValues<AtrributeName>); If an attribute within a policy is configured by a product, the ProductCmptType class or the relevant Generation classes will have a setAllowedValues<AtrributeName>(ValueSet<ValueType> setOfAllowedValues<AtrributeName>) method to set the allowed values for this attribute. Product component type class or interface as well as Generations class or interface
@IpsAllowedValuesSetter(“<AtrributeName>”) The setAllowedValuesFor<AtrributeName>(<AttributeType> setOfAllowedValues<AttributeName>) methods are annotated with @IpsAllowedValuesSetter. Product component type class or interface as well as Generations class or interface
toString() Policy components that are configured by a Product are now generated with a default toString() override, which includes the product component type: “policy-component [product-component-type]” Policy component type class (only if configured by product)

 

Bugs

  • Persistence of Child-to-Master relations shouldn’t be set to Cascade.ALL (FIPS-5996)
  • Identically named product components lead to wrong data at runtime (FIPS-5997)
  • Broken test code generation after editing cutom test attributes (FIPS-6251)
  • Can’t configure empty range (FIPS-6517)
  • DefaultPolicyAttribute can’t find IpsAllowedValues method (FIPS-6641)
  • Expected value in FIPS test set to empty leads to NullPointerException (FIPS-6684)
  • Excel-Import can’t read reserved date format (FIPS-6740)
  • Irrelevance of attributes with enumeration value set can’t be configured via radiobuttons (FIPS-6832)
  • Overwriting an attribute without null with product configuration generates faulty code (FIPS-6834)
  • NullPointerException when resetting a runtime ID to the standard value (FIPS-6862)
  • Abstract product attributes with multiple values generate faulty code (FIPS-6819)

New Features

  • Make product components better editable at runtime (FIPS-6637)

Tasks

Improvements

  • Abstract enums on policy side (FIPS-5336)
  • Stringlength limited in model (FIPS-5631)
  • m2e Plugin included IPS Updatesite (FIPS-6446)
  • getter for derived, calculated on every method call, should be restrainedmodifiable (FIPS-6498)
  • Import enums over invalid values (FIPS-6508)
  • ModelObjectDelta#changedProperties now sorts in model order (FIPS-6558)
  • Derived-ValueSet allows definition of value sets in Java (FIPS-6642)
  • Missing enum contents fix-up shows duplicates (FIPS-6663)
  • Configuration of irrelevance in product components (FIPS-6668)
  • Message Builder Text and Severity not final (FIPS-6687)
  • final on AbstractRuntimeRepository#getExistingProductComponent removed (FIPS-6798)
  • Migration to 20.6 should delete CascadeTypes on Detail-to-Master relations (FIPS-6799)
  • Setting cardinality for targets with 0..1 or 1..1 (FIPS-6814)
  • Improve error message when failing to assign parent (FIPS-6755)