Skip to content

Commit

Permalink
Provide first functional metadata mapping
Browse files Browse the repository at this point in the history
Still in early stages, though.

Related to MID-6275.
  • Loading branch information
mederly committed Jun 26, 2020
1 parent ad411f0 commit dde50df
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Expand Up @@ -85,7 +85,8 @@ private void appendValues(ItemPath outputPath, PrismValueDeltaSetTriple<?> outpu
"metadata mapping in " + computer.dataMapping.getMappingContextDescription());
createSources(builder, mappingBean);
builder.targetContext(metadataDefinition)
.now(computer.dataMapping.now);
.now(computer.dataMapping.now)
.conditionMaskOld(false); // We are not interested in old values (deltas are irrelevant in metadata mappings).
return builder.build();
}

Expand All @@ -99,7 +100,9 @@ private void createSources(MetadataMappingBuilder<?, ?> builder, MetadataMapping
//noinspection unchecked
sourceItem.addAll(getSourceValues(sourcePath));
//noinspection unchecked
builder.additionalSource(new Source<>(sourceItem, null, null, sourceName, sourceDefinition));
Source<?, ?> source = new Source<>(sourceItem, null, null, sourceName, sourceDefinition);
source.recompute();
builder.additionalSource(source);
}
}

Expand Down
Expand Up @@ -34,7 +34,24 @@
</source>
<expression>
<script>
<code>'low'</code> <!-- todo -->
<relativityMode>absolute</relativityMode>
<code>
if (loa == null || loa.isEmpty()) {
rv = null
} else if (loa.contains(null)) {
rv = null
} else if (loa.contains('low')) {
rv = 'low'
} else if (loa.contains('normal')) {
rv = 'normal'
} else if (loa.contains('high')) {
rv = 'high'
} else {
throw new IllegalArgumentException('Unsupported LoA value(s): ' + loa)
}
log.info("### loa = $loa -> $rv")
rv
</code>
</script>
</expression>
<target>
Expand Down

0 comments on commit dde50df

Please sign in to comment.