private <AH extends AssignmentHolderType> Collection<EvaluatedAssignment<AH>> evaluateAssignments(AH assignmentHolder, Collection<AssignmentType> assignments, boolean virtual, AssignmentEvaluator<AH> assignmentEvaluator, Task task, OperationResult result) {
        List<EvaluatedAssignment<AH>> evaluatedAssignments = new ArrayList<>();
        RepositoryCache.enter(cacheConfigurationManager);
        try {
            for (AssignmentType assignmentType: assignments) {
                try {
                    PrismContainerDefinition definition = assignmentType.asPrismContainerValue().getDefinition();
                    if (definition == null) {
                        // TODO: optimize
                        definition = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(AssignmentHolderType.class).findContainerDefinition(AssignmentHolderType.F_ASSIGNMENT);
                    }
                    ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> assignmentIdi =
                            new ItemDeltaItem<>(LensUtil.createAssignmentSingleValueContainer(assignmentType), definition);
                    EvaluatedAssignment<AH> assignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, assignmentHolder, assignmentHolder.toString(), virtual, task, result);
                    evaluatedAssignments.add(assignment);
                } catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | PolicyViolationException | SecurityViolationException | ConfigurationException | CommunicationException e) {
                    LOGGER.error("Error while processing assignment of {}: {}; assignment: {}",
                            assignmentHolder, e.getMessage(), assignmentType, e);
                }
            }
        } finally {
            RepositoryCache.exit();
        }
        return evaluatedAssignments;
    }
private <AH extends AssignmentHolderType> Collection<EvaluatedAssignment<AH>> evaluateAssignments(AH assignmentHolder, Collection<AssignmentType> assignments, boolean virtual, AssignmentEvaluator<AH> assignmentEvaluator, Task task, OperationResult result) {
        List<EvaluatedAssignment<AH>> evaluatedAssignments = new ArrayList<>();
        RepositoryCache.enter(cacheConfigurationManager);
        try {
            for (AssignmentType assignmentType: assignments) {
                try {
                    PrismContainerDefinition definition = assignmentType.asPrismContainerValue().getDefinition();
                    if (definition == null) {
                       
                        definition = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(AssignmentHolderType.class).findContainerDefinition(AssignmentHolderType.F_ASSIGNMENT);
                    }
                    ItemDeltaItem<PrismContainerValue<AssignmentType>,PrismContainerDefinition<AssignmentType>> assignmentIdi =
                            new ItemDeltaItem<>(LensUtil.createAssignmentSingleValueContainer(assignmentType), definition);
                    EvaluatedAssignment<AH> assignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, assignmentHolder, assignmentHolder.toString(), virtual, task, result);
                    evaluatedAssignments.add(assignment);
                } catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | PolicyViolationException | SecurityViolationException | ConfigurationException | CommunicationException e) {
                    LOGGER.error("Error while processing assignment of {}: {}; assignment: {}",
                            assignmentHolder, e.getMessage(), assignmentType, e);
                }
            }
        } finally {
            RepositoryCache.exit();
        }
        return evaluatedAssignments;
    }
private <ah extends assignmentholdertype> collection<evaluatedassignment<ah>> evaluateassignments(ah assignmentholder, collection<assignmenttype> assignments, boolean virtual, assignmentevaluator<ah> assignmentevaluator, task task, operationresult result) { list<evaluatedassignment<ah>> evaluatedassignments = new arraylist<>(); repositorycache.enter(cacheconfigurationmanager); try { for (assignmenttype assignmenttype: assignments) { try { prismcontainerdefinition definition = assignmenttype.asprismcontainervalue().getdefinition(); if (definition == null) { definition = prismcontext.getschemaregistry().findobjectdefinitionbycompiletimeclass(assignmentholdertype.class).findcontainerdefinition(assignmentholdertype.f_assignment); } itemdeltaitem<prismcontainervalue<assignmenttype>,prismcontainerdefinition<assignmenttype>> assignmentidi = new itemdeltaitem<>(lensutil.createassignmentsinglevaluecontainer(assignmenttype), definition); evaluatedassignment<ah> assignment = assignmentevaluator.evaluate(assignmentidi, plusminuszero.zero, false, assignmentholder, assignmentholder.tostring(), virtual, task, result); evaluatedassignments.add(assignment); } catch (schemaexception | objectnotfoundexception | expressionevaluationexception | policyviolationexception | securityviolationexception | configurationexception | communicationexception e) { logger.error("error while processing assignment of {}: {}; assignment: {}", assignmentholder, e.getmessage(), assignmenttype, e); } } } finally { repositorycache.exit(); } return evaluatedassignments; }