- 03 Jun 2023
- 2 Minutes to read
- Print
- DarkLight
Mappings, Matching and Event Governance
- Updated on 03 Jun 2023
- 2 Minutes to read
- Print
- DarkLight
Studio Mappings, Matching and Event Governance
This article contains high-level background on Studio Record & Field Mappings in the context of matching and event governance.
Mappings
Record mappings (along with their associated field mappings) tell Studio how to construct a target type record B
given a source type record A
.
Matching
Studio matches the ( A
, B
) pair based on equivalence of the special recordKey
field. That is, the field mappings for the target field recordKey
govern matching.
Source Events
All field mappings are associated with one to three source events. These events include:
On Create (read: source record created)
This is when
A
exists, but we can't find a matching recordB
in the target namespace/type.- That is, from Studio’s perspective,
A
has just been newly created.
- That is, from Studio’s perspective,
When this occurs, Studio will construct such a record
B
by applying the On Create field mappings toA
.- Only fields governed by an On Create field mapping will actually be created.
On Delete (read: source record missing or deleted)
This is when
B
exists, but we can't find a matching recordA
in the source namespace/type.- That is, from Studio’s perspective,
A
has been deleted.
- That is, from Studio’s perspective,
When this occurs, Studio will apply the On Delete field mappings to
B
to update it as needed.- Only fields governed by an On Delete field mapping will actually be subject to change. Studio will not modify any other fields but those governed by On Delete field mappings.
If desired, we can delete
B
from the database. This is only done if there is a field mapping for the target fieldrecordStatus
that returns the valuedelete
Side Note:This is not specific to the On Delete field mappings; you could decide to delete records in any case based on logic that you implement. All you have to do is map this special value for
recordStatus
. That said, the most frequent use case would be with an On Delete field mapping.
On Update (read: source Record potentially updated)
This is when both
A
andB
exist (i.e. we found a match).That is, from Studio’s perspective,
A
may have been updated.- We can’t know until we apply the update mappings to detect if any particular fields governed by the update mappings have actually changed → if any have, then we actually push the update out to
B
.
- We can’t know until we apply the update mappings to detect if any particular fields governed by the update mappings have actually changed → if any have, then we actually push the update out to
When this occurs, Studio will apply the On Update field mappings with the data from
A
andB
to modifyB
.- Only fields governed by an On Update field mapping will actually be subject to change. Studio will not modify any other fields but those governed by On Update field mappings.