Skip to content

Commit

Permalink
Add forgotten changes
Browse files Browse the repository at this point in the history
(Relates to 2e7286a.)
  • Loading branch information
mederly committed Sep 9, 2022
1 parent 1571728 commit b285f6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public <V extends PrismValue, D extends ItemDefinition> Object execute(String fu
}

if (outputDefinition.isMultiValue()) {
// This is a problem if the triple contains dynamically-typed PCVs. See MID-6775.
return PrismValueCollectionsUtil.getRealValuesOfCollection(nonNegativeValues);
}

Expand All @@ -146,6 +147,8 @@ public <V extends PrismValue, D extends ItemDefinition> Object execute(String fu
+ nonNegativeValues.size() + ") in " + shortDesc);
}

// This is a problem if the triple contains dynamically-typed PCVs. See MID-6775.
// Currently, it is hacked by wrapping these values to a PPV.
return nonNegativeValues.iterator().next().getRealValue();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
<expression>
<script>
<code>
import com.evolveum.midpoint.util.MiscUtil

import static com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMedium.RESOURCE_EXTERNAL
import static com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMedium.RESOURCE_HR
import static com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMedium.RESOURCE_SIS
Expand All @@ -85,15 +87,7 @@
def hr = sources.find { it.resourceRef?.oid == RESOURCE_HR.oid }
def external = sources.find { it.resourceRef?.oid == RESOURCE_EXTERNAL.oid }

if (sis != null) {
sis.clone()
} else if (hr != null) {
hr.clone()
} else if (external != null) {
external.clone()
} else {
null // takes all values (should be "none"
}
MiscUtil.getFirstNonNull(sis, hr, external)
</code>
</script>
</expression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
<expression>
<script>
<code>
import com.evolveum.midpoint.util.MiscUtil

import static com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMedium.RESOURCE_EXTERNAL
import static com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMedium.RESOURCE_HR
import static com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMedium.RESOURCE_SIS
Expand All @@ -86,15 +88,7 @@
def hr = sources.find { it.resourceRef?.oid == RESOURCE_HR.oid }
def external = sources.find { it.resourceRef?.oid == RESOURCE_EXTERNAL.oid }

if (sis != null) {
sis.clone()
} else if (hr != null) {
hr.clone()
} else if (external != null) {
external.clone()
} else {
null // takes all values (should be "none")
}
MiscUtil.getFirstNonNull(sis, hr, external)
</code>
</script>
</expression>
Expand Down

0 comments on commit b285f6f

Please sign in to comment.