Overview

Fika migrator overview

custom.fika is not where the shared migrator framework is defined, but it is an important example package for the 17.0 migration story. It shows how a catalogue package with older custom Part key history can opt in to the new PartSpecialMigrator load flow by exposing a snapper-level partSpecialMigrator prop and returning a package-specific migrator.

In Fika's case, FikaDsPartSpecialMigrator extends DsPartSpecialMigrator and overrides oldPartSpecialsKey(Part part) so older Fika drawings can still find part and option specials that were stored under pre-17.0 key formats.

Compile Time Changes

class FikaDsPartSpecialMigrator

FikaDsPartSpecialMigrator is the package-specific migrator used by Fika snappers.

Added: public class FikaDsPartSpecialMigrator extends DsPartSpecialMigrator
Added: public str oldPartSpecialsKey(Part part)

oldPartSpecialsKey(Part part) handles multiple historical key formats:

  • before 16.5 it falls back to the article code
  • before 17.0 it uses article code plus creatorKey()
  • otherwise it delegates to super(..)

Snapper prop partSpecialMigrator

Fika snappers now opt in to migration by exposing a PartSpecialMigrator "partSpecialMigrator" prop/default.

Added/important usage: PartSpecialMigrator "partSpecialMigrator" {
    Object default(..) {
        return FikaDsPartSpecialMigrator();
    }
}

If your package has older custom key history, this is the pattern to copy: provide the prop on the snapper family and return the right subclass for that package.

Runtime/Behavior Changes

Fika drawings depend on the opt-in migrator path during load

Fika's migration support depends on the shared cm.core.Snapper discovery path:

  • Snapper.loaded1() calls initPartSpecialMigrator(formatter)
  • getPartSpecialMigrator(init=true) resolves the snapper's partSpecialMigrator prop
  • the returned FikaDsPartSpecialMigrator is marked pending for older drawings
  • later Snapper.migratePartSpecials(parts) invokes the actual migration

If the snapper does not expose the partSpecialMigrator prop, older Fika part or option specials saved under historical keys will not be migrated just because FikaDsPartSpecialMigrator exists in the package.