Processing mappings
See Mapping for background information.
A mapping maps specified items in source object to a change for target item in target object using a mapping evaluator.
The main output is basically the same as in expression evaluation: a delta set triple. However, mapping evaluation (compared with expression evaluation) brings the following features:
-
binding expression sources and output to object items - including features like domain and range specification,
-
condition evaluation modifying the output triple set,
-
time applicability.
Source object
Overview |
Object on which the mapping is evaluated. Typically a focus or a projection. |
Type |
Object-delta-object |
Multiplicity |
Exactly one (for regular data mappings) or none (for metadata mappings). |
Mapping evaluator derives sources for the expression evaluator from the source object, using definition of sources
in the mapping definition (MappingType
).
Main output
Overview |
Output of the mapping evaluation. |
Type |
Delta set triple |
Structure |
|
Multiplicity |
There is a single output delta set triple. (Each set can contain zero, single, or multiple values.) |
Other outputs
Condition output
Overview |
Output of the mapping evaluation condition. |
Type |
Delta set triple of Boolean values |
Structure |
|
Multiplicity |
There is a single condition output delta set triple. (Each set can contain zero, single, or multiple values.) |
Time constraints evaluation output
Overview |
Output of the time constraints evaluation. |
Structure |
|
Multiplicity |
Single value for both components. |
Evaluation parameters
There is a lot of parameters, defined both statically - i.e. as part of MappingType
- or dynamically, i.e. when mapping
evaluation is requested.
Statically defined evaluation parameters
Definition of source items
Overview |
Definition of mapping sources |
Type |
|
Structure |
|
Multiplicity |
Zero, one, or more. (May be implicit.) |
Definition of target item
Overview |
Definition of mapping target item |
Type |
|
Structure |
|
Multiplicity |
Exactly one. (May be implicit.) |
Definition of the expression
Overview |
Definition of mapping expression |
Type |
|
Multiplicity |
Exactly one. (May be implicit.) |
See Expression evaluation description.
Condition
Overview |
Definition of mapping condition (see below for detailed description) |
Type |
|
Multiplicity |
Zero or one. |
Constraints
Overview |
Situations where the mapping is applied |
Structure |
|
Execution properties
Property |
Meaning |
|
TODO |
|
TODO |
|
TODO |
Time validity specification
Item |
Meaning |
|
TODO |
|
TODO |
Auxiliary and unused parameters
Just for completeness let’s mention here parameters that have no effect on the computation at this level of abstraction or are not implemented at all.
Parameter | Meaning |
---|---|
|
Currently not used. |
|
Records evaluation information to the log. |
|
For documentation purposes. |
Dynamically defined evaluation parameters
Context variables
Overview |
Context variables to be used during mapping evaluation. |
Type |
Named item-delta-item or named object |
Structure |
|
Multiplicity |
There can be zero, single, or multiple variables. |
Original target item values
Overview |
Original values of the mapping target. Currently used for range checking. |
Type |
Values. |
Multiplicity |
0..n |
Condition masks
Overview |
Additional clause for condition evaluation. |
Type |
Two boolean values |
Structure |
|
Multiplicity |
1 |
Mapping evaluation algorithm
There are two basic steps:
-
Mapping preparation
-
Prepared mapping evaluation
Mapping preparation
-
Prepares values for individual sources (for condition and main expression evaluation)
-
Accepts pre-prepared
defaultSource
. -
Prepares other sources based on their definitions and on the current state of source object. (This step is skipped for metadata mappings. There is no source object as such.) As part of source preparation, the domain of the source (if defined) is evaluated. Any out-of-domain values are removed from the source.
-
-
Prepares target path and definition. This is basically a clean-up and verification of caller-provided values.
Prepared mapping evaluation
-
Evaluates time constraints validity (computes "valid/not-valid" flag and next recompute time, if applicable).
-
Evaluates the condition. Note that we have to evaluate condition even for mappings that are not time-valid. This is because we want to skip trigger creation for mappings that do not satisfy the condition (see MID-6040).
-
If time constraints are valid and the condition is satisfied (i.e. either evaluated to
true
→true
, ortrue
→false
orfalse
→true
) then:-
Evaluates the expression, and reflects eventual condition change:
-
for
true
→false
, new output triple looks like this:-
plus set = empty
-
minus set = original minus + original zero
-
zero set = empty
-
-
for
false
→true
, new output triple looks like this:-
plus set = original plus + original zero
-
minus set = empty
-
zero set = empty
-
-
-
Adjusts
authoritative
=false
setting: if present, removes output minus set, i.e. no values will be removed by this mapping.
-
-
If time constraints are valid (and regardless of condition status):
-
Evaluates the range. All original values that are found to belong to the range but are not present in output zero or plus set, are added to the output minus set, i.e. are marked to be removed. Note that we check the range even for not-applicable mappings i.e. those that have condition of
false
→false
. See also MID-5953.
-
Note that this algorithm does not take mapping strength (strong, normal, weak) or exclusiveness into account. These parameters are part of mapping definition but are treated by upper layers. See mapping set evaluation.