Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property mapping for static values #49

Open
joostfarla opened this issue May 15, 2023 · 0 comments
Open

Property mapping for static values #49

joostfarla opened this issue May 15, 2023 · 0 comments

Comments

@joostfarla
Copy link
Contributor

joostfarla commented May 15, 2023

Sometimes, you want to populate a property value with a static value. This value could be the same for every object instance, but it could also be different. For example a "domain" attribute with a static value, which may differ based on the type of the source root.

Proposal

  • Introduce a static property for a PropertyMapping containing 1 or more static values
  • For every individual value, optionally provide a matching condition using ifMatchType.
  • During processing, apply the first value where the matching condition evaluates to true or no matching condition is set.
  • The static and pathMappings properties are mutually exclusive.

Example

objectTypeMappings:
  Bouwwerk:
    sourceRoot:
      - type: bgt:Pand
      - type: bgt:OverigBouwwerk
    propertyMappings:
      identificatie:
        pathMappings:
          path: identificatie
      domein:
        static:
          - value: NL.IMGeo.Pand
            ifMatchType:
              type: oneOf
              options:
                values: 
                  - bgt:Pand
                  - bgt:OverigBouwwerk
          - value: NL.IMXGeo.Bouwwerk
      ...

When the value is conditional for a single type, a compact notation could be used:

      domein:
        static:
          - value: NL.IMGeo.Pand
            ifMatchType: bgt:Pand
          - value: NL.IMXGeo.Bouwwerk

Which is basically the shorthand equivalent for:

      domein:
        static:
          - value: NL.IMGeo.Pand
            ifMatchType:
              type: equals
              options:
                value: bgt:Pand
          - value: NL.IMXGeo.Bouwwerk

When the value is not conditional, a compact notation could be used:

      domein:
        static: NL.IMXGeo.Bouwwerk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant