The apply mapping pipeline step

Abstract

Overview of how data mapping works through pipeline steps and value mapping in the Sitecore Data Exchange Framework.

Data Exchange Framework uses pipelines to model synchronization processes. A pipeline can contain an apply mapping pipeline step that handles the mapping of data from one object to another. This section explains how the apply mappings pipeline step works.

Configuring the apply mapping pipeline step

You configure the following information on the pipeline step:

  • Source object location - the location of the source object that the pipeline reads data from.

  • Target object location - the location of the object data the pipeline writes data to.

  • Mapping set - the value mapping set that specifies what the pipeline reads from the source object and what it writes to the target object.

    Note

    A value mapping set contains one or more value mappings. You use value mappings to configure how the pipeline reads an element in the source data, converts it (if necessary), and writes it to the target.

Logic executed by the pipeline step

When the pipeline step executes, it implements the following logic:

  • Read the source object from the location specified on the pipeline step.

  • Read the target object from the location specified on the pipeline step.

  • Read the value mapping set specified on the pipeline step.

  • Apply the value mapping set.

Logic executed by the value mapping set

What happens in the apply the value mapping set step depends on the type of value mapping set used. Data Exchange Framework includes a standard value mapping set, but developers can implement custom ones.

The standard value mapping set applies the value mappings it contains to each record the pipeline reads from the source data. It executes the following logic for each value mapping:

  • Get the source value accessor assigned to the value mapping.

  • Get the value reader from the source value accessor.

  • Use the value reader to read a value from the source object.

  • If a source value transformer is assigned to the value mapping, use it to transform the value.

  • Get the target value accessor assigned to the value mapping.

  • Get the value writer from the target value accessor.

  • Use the value writer to write the value to the target object.