Cumulocity-IoT / cumulocity-dynamic-mapper

The ultimate Mapper for building the bridge between any Message Broker and Cumulocity IoT in a zero-code approach!
Apache License 2.0
10 stars 9 forks source link

Change mappings not using reserved "Source" fragment #256

Open switschel opened 1 month ago

switschel commented 1 month ago

Currently we use the "Source" fragment in the target template to map external IDs to C8Y, when enabled in the mapping. The source fragment is actually reserved for the "internal C8Y ID" which is generated when a document is created. This was working fine because the mappings are only executed by the mapper microservice who can exchange the mapped ID to source to an external ID. When mappings should be used somewhere else like thin-edge this approach is conflicting.

Suggestion: Add a new fragment to all the target templates: "externalSource":{"externalId":"Device4711","type":"c8y_Serial"} This is also used by thin-edge.io already.

Map external IDs to that new fragment. Keep source in the template but use it for internal ID mappings.

This is a breaking change as we change the mapping data model, but we could provide a script to migrate.