Search in sources :

Example 1 with ConstructionPack

use of com.evolveum.midpoint.model.impl.lens.ConstructionPack in project midpoint by Evolveum.

the class ConstructionProcessor method collectToConstructionMapFromEvaluatedConstructions.

private <F extends FocusType, K, T extends AbstractConstruction> void collectToConstructionMapFromEvaluatedConstructions(LensContext<F> context, EvaluatedAssignmentImpl<F> evaluatedAssignment, Collection<T> evaluatedConstructions, DeltaMapTriple<K, ConstructionPack<T>> constructionMapTriple, FailableLensFunction<T, K> keyGenerator, PlusMinusZero mode1, PlusMinusZero mode2, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
    for (T construction : evaluatedConstructions) {
        PlusMinusZero mode = PlusMinusZero.compute(mode1, mode2);
        Map<K, ConstructionPack<T>> constructionMap = constructionMapTriple.getMap(mode);
        if (constructionMap == null) {
            continue;
        }
        K key = keyGenerator.apply(construction);
        ConstructionPack<T> constructionPack;
        if (constructionMap.containsKey(key)) {
            constructionPack = constructionMap.get(key);
        } else {
            constructionPack = new ConstructionPack<>();
            constructionMap.put(key, constructionPack);
        }
        constructionPack.add(new PrismPropertyValue<>(construction));
        if (evaluatedAssignment.isValid()) {
            constructionPack.setHasValidAssignment(true);
        }
        if (evaluatedAssignment.isForceRecon()) {
            constructionPack.setForceRecon(true);
        }
    }
}
Also used : ConstructionPack(com.evolveum.midpoint.model.impl.lens.ConstructionPack) PlusMinusZero(com.evolveum.midpoint.prism.delta.PlusMinusZero)

Aggregations

ConstructionPack (com.evolveum.midpoint.model.impl.lens.ConstructionPack)1 PlusMinusZero (com.evolveum.midpoint.prism.delta.PlusMinusZero)1