Cell priority

Priority on property relations

There are several situations in which, as shown in the image below, it is necessary to map two different relations to a target entity. A simple example is the one in which a default value needs to be assigned to the target entity for the case in which another relation doesn't return a value.

The case of two relations mapped to a target entity.

In these cases cell priority supplies a minimal degree of control over the execution of the functions.

In the example image above what wants to be achieved is that the Rename cell is executed and if no value is generated as function output, a default value should be assigned using the Assign cell.

All that needs to be done, is to give the Rename cell a higher priority than the Assign cell. As long as Rename returns a value, Assign will not be considered. If instead Rename doesn't return a value and a lower priority cell is available, that one is executed and its result is applied to the target entity.

Priority on type relations

Priority on type relations works differently to priority on property relations. Instead of the decision between result alternatives it controls the execution order for the transformation.

The execution order only is relevant if you use the transformation contexts to share data between invocations of transformation functions. By setting a high priority on a type cell, you ensure that it is executed before all type transformations with a lower priority.

Set a cell's priority

To set a cell's priority right-click on the cell in the Alignment view. In the context menu select Set Priority Level. The available priority levels appear. In the below image only high and low are listed, since all the mapping cells are set to normal priority by default.

The context menu while setting the Mapping Cell's priority.

Results based on priority

Once the priority of a cell is set to a different priority than normal, a small icon at the right of the cell name shows the current priority. In the below image the icon represents a vertical upwards looking arrowhead, which stands for high priority. The low priority is instead represented by the same arrowhead looking downwards.

The Rename mapping cell with its priority set to high.

Once the alignment is processed, the transformation engine takes care of ordering the cells mapped to the same target entity in order of priority.