From e3ab9c5f53c6f6d7e344eaf4085f84aba95d3ef7 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 30 Jun 2017 12:11:12 +0200 Subject: [PATCH 1/2] lensContext is available when postIterationCondition evaluation --- .../java/com/evolveum/midpoint/model/impl/lens/LensUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensUtil.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensUtil.java index 69446f3f228..21b3f7531ef 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensUtil.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensUtil.java @@ -844,7 +844,7 @@ public static boolean evaluateIterationCondition(LensCont variables.addVariableDefinition(ExpressionConstants.VAR_ITERATION_TOKEN, iterationToken); ExpressionEvaluationContext expressionContext = new ExpressionEvaluationContext(null , variables, desc, task, result); - PrismValueDeltaSetTriple> outputTriple = ModelExpressionThreadLocalHolder.evaluateExpressionInContext(expression, expressionContext, task, result); + PrismValueDeltaSetTriple> outputTriple = ModelExpressionThreadLocalHolder.evaluateExpressionInContext(expression, expressionContext, context, null, task, result); Collection> outputValues = outputTriple.getNonNegativeValues(); if (outputValues.isEmpty()) { return false; From 31ddf21521360b32b7f4f4bae300f733ae0cd7c4 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 30 Jun 2017 13:55:53 +0200 Subject: [PATCH 2/2] Possible fix for MID-4034 (RawType in audit log viewer) --- .../com/evolveum/midpoint/schema/util/ValueDisplayUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ValueDisplayUtil.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ValueDisplayUtil.java index ab181473f40..32e9d373b9e 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ValueDisplayUtil.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ValueDisplayUtil.java @@ -22,6 +22,7 @@ import com.evolveum.midpoint.prism.xnode.PrimitiveXNode; import com.evolveum.midpoint.prism.xnode.XNode; import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.util.PrettyPrinter; import com.evolveum.midpoint.util.QNameUtil; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.xml.ns._public.common.common_3.ApprovalSchemaType; @@ -41,6 +42,8 @@ import java.util.Date; /** + * TODO unify with PrettyPrinter somehow + * * @author mederly */ public class ValueDisplayUtil { @@ -137,6 +140,8 @@ public static String toStringValue(PrismPropertyValue propertyValue) { return String.valueOf(value); } else if (value instanceof byte[]) { return "(binary data)"; + } else if (value instanceof RawType) { + return PrettyPrinter.prettyPrint(value); } else { return "(a value of type " + value.getClass().getName() + ")"; // todo i18n }