@Override public String debugDump() { return inner.debugDump(); }
@Override public String debugDump(int indent) { return inner.debugDump(indent); }
private void dumpOutputTriple(StringBuilder sb, PrismValueDeltaSetTriple<?> triple) { if (triple != null) { sb.append("\n").append(triple.debugDump(1)).append("\n\n"); } else { sb.append("(null)\n\n"); } }
@Override public void after(ResourceShadowDiscriminator rat, String desc, DeltaMapTriple<ResourceShadowDiscriminator, ConstructionPack<Construction<F>>> constructionMapTriple) { PrismValueDeltaSetTriple<PrismPropertyValue<Construction>> projectionConstructionDeltaSetTriple = prismContext.deltaFactory().createPrismValueDeltaSetTriple( getConstructions(constructionMapTriple.getZeroMap().get(rat), true), getConstructions(constructionMapTriple.getPlusMap().get(rat), true), getConstructions(constructionMapTriple.getMinusMap().get(rat), false)); LensProjectionContext projectionContext = context.findProjectionContext(rat); if (projectionContext != null) { // This can be null in a exotic case if we delete already deleted account if (LOGGER.isTraceEnabled()) { LOGGER.trace("Construction delta set triple for {}:\n{}", rat, projectionConstructionDeltaSetTriple.debugDump(1)); } projectionContext.setConstructionDeltaSetTriple(projectionConstructionDeltaSetTriple); if (isForceRecon(constructionMapTriple.getZeroMap().get(rat)) || isForceRecon( constructionMapTriple.getPlusMap().get(rat)) || isForceRecon( constructionMapTriple.getMinusMap().get(rat))) { projectionContext.setDoReconciliation(true); } } }
@Override public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext context) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException { PrismValueDeltaSetTriple<V> outputTriple; if (expressionEvaluatorType.getRelativityMode() == TransformExpressionRelativityModeType.ABSOLUTE) { outputTriple = evaluateAbsoluteExpression(context.getSources(), context.getVariables(), context, context.getContextDescription(), context.getTask(), context.getResult()); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Evaluated absolute expression {}, output triple:\n{}", context.getContextDescription(), outputTriple==null?null:outputTriple.debugDump(1)); } } else if (expressionEvaluatorType.getRelativityMode() == null || expressionEvaluatorType.getRelativityMode() == TransformExpressionRelativityModeType.RELATIVE) { if (context.getSources() == null || context.getSources().isEmpty()) { // Special case. No sources, so there will be no input variables and no combinations. Everything goes to zero set. outputTriple = evaluateAbsoluteExpression(null, context.getVariables(), context, context.getContextDescription(), context.getTask(), context.getResult()); LOGGER.trace("Evaluated relative sourceless expression {}, output triple:\n{}", context.getContextDescription(), outputTriple==null?null:outputTriple.debugDump(1)); } else { List<SourceTriple<?,?>> sourceTriples = processSources(context.getSources(), context); outputTriple = evaluateRelativeExpression(sourceTriples, context.getVariables(), context.isSkipEvaluationMinus(), context.isSkipEvaluationPlus(), context, context.getContextDescription(), context.getTask(), context.getResult()); LOGGER.trace("Evaluated relative expression {}, output triple:\n{}", context.getContextDescription(), outputTriple==null?null:outputTriple.debugDump(1)); } } else { throw new IllegalArgumentException("Unknown relativity mode "+expressionEvaluatorType.getRelativityMode()); } return outputTriple; }
@Test public void testPathEnum() throws Exception { final String TEST_NAME = "testPathEnum"; System.out.println("===[ "+TEST_NAME+"]==="); // GIVEN ObjectDelta<UserType> delta = evaluator.getPrismContext().deltaFactory().object() .createModificationReplaceProperty(UserType.class, evaluator.USER_OLD_OID, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, ActivationStatusType.DISABLED); MappingImpl<PrismPropertyValue<String>,PrismPropertyDefinition<String>> mapping = evaluator.createMapping( "mapping-path-enum.xml", TEST_NAME, "costCenter", delta); OperationResult opResult = new OperationResult(TEST_NAME); // WHEN mapping.evaluate(null, opResult); // THEN PrismValueDeltaSetTriple<PrismPropertyValue<String>> outputTriple = mapping.getOutputTriple(); System.out.println("Output triple"); System.out.println(outputTriple.debugDump()); PrismAsserts.assertTripleNoZero(outputTriple); PrismAsserts.assertTriplePlus(outputTriple, ActivationStatusType.DISABLED.value()); PrismAsserts.assertTripleMinus(outputTriple, ActivationStatusType.ENABLED.value()); }
if (LOGGER.isTraceEnabled()) { LOGGER.trace("Output triple of mapping {}\n{}", mapping.getContextDescription(), mappingOutputTriple==null?null:mappingOutputTriple.debugDump(1));
LOGGER.trace("output triple:\n{}", outputTriple==null?null:outputTriple.debugDump(1));