Search in sources :

Example 11 with AbstractRoleType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType in project midpoint by Evolveum.

the class EvaluatedAssignmentTargetCache method recordProcessing.

@Nullable
AssignmentTargetEvaluationInformation recordProcessing(AssignmentPathSegmentImpl segment, PlusMinusZero mode) {
    ObjectType target = segment.getTarget();
    if (!(target instanceof AbstractRoleType)) {
        return null;
    }
    if (!isCacheable((AbstractRoleType) target)) {
        return null;
    }
    AssignmentTargetEvaluationInformation targetEvaluationInformation = new AssignmentTargetEvaluationInformation();
    processedOrderKeys.get(mode).put(new OrderKey(segment), targetEvaluationInformation);
    if (target.getOid() != null) {
        processedKeys.get(mode).put(new Key(segment), targetEvaluationInformation);
    }
    return targetEvaluationInformation;
}
Also used : ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) AbstractRoleType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType) Nullable(org.jetbrains.annotations.Nullable)

Example 12 with AbstractRoleType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType in project midpoint by Evolveum.

the class EvaluatedAssignmentTargetCache method canSkip.

boolean canSkip(AssignmentPathSegmentImpl segment, PlusMinusZero mode) {
    ObjectType target = segment.getTarget();
    if (!(target instanceof AbstractRoleType)) {
        return false;
    }
    IdempotenceType idempotence = ((AbstractRoleType) target).getIdempotence();
    if (idempotence == null || idempotence == IdempotenceType.NONE) {
        return false;
    }
    if (idempotence == IdempotenceType.CONSERVATIVE && !segment.isMatchingOrder) {
        // this is quite important (and perhaps not too frequent) message, so let's keep it here
        LOGGER.trace("Conservative idempotent and order is not matching: {}", target);
        return false;
    }
    if (idempotence == IdempotenceType.AGGRESSIVE) {
        // in non-meta context.
        if (!segment.getEvaluationOrder().isOrderOne()) {
            // this is quite important (and perhaps not too frequent) message, so let's keep it here
            LOGGER.trace("Aggressive idempotent and non-one order: {}: {}", segment.getEvaluationOrder(), target);
            return true;
        }
        return processedKeys.get(mode).containsKey(new Key(segment));
    } else {
        return processedOrderKeys.get(mode).containsKey(new OrderKey(segment));
    }
}
Also used : ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) AbstractRoleType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType) IdempotenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.IdempotenceType)

Example 13 with AbstractRoleType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType in project midpoint by Evolveum.

the class AssociationFromLinkExpressionEvaluator method getRelevantRole.

private AbstractRoleType getRelevantRole(ExpressionEvaluationContext context) throws ExpressionEvaluationException {
    AbstractRoleType thisRole;
    Integer assignmentPathIndex = expressionEvaluatorBean.getAssignmentPathIndex();
    if (assignmentPathIndex == null) {
        // Legacy ... or default in simple cases
        thisRole = getLegacyRole(context);
    } else {
        AssignmentPathSegment segment = getSpecifiedAssignmentPathSegment(context, assignmentPathIndex);
        thisRole = (AbstractRoleType) segment.getSource();
    }
    return thisRole;
}
Also used : AbstractRoleType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType) AssignmentPathSegment(com.evolveum.midpoint.model.api.context.AssignmentPathSegment)

Aggregations

AbstractRoleType (com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType)7 PrismObject (com.evolveum.midpoint.prism.PrismObject)3 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)3 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)3 ShadowAssociationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowAssociationType)3 QName (javax.xml.namespace.QName)3 RAssignment (com.evolveum.midpoint.repo.sql.data.common.container.RAssignment)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 OrgType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType)2 ShadowDiscriminatorType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowDiscriminatorType)2 ShadowKindType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType)2 RefinedObjectClassDefinition (com.evolveum.midpoint.common.refinery.RefinedObjectClassDefinition)1 CheckBoxPanel (com.evolveum.midpoint.gui.api.component.form.CheckBoxPanel)1 WrapperContext (com.evolveum.midpoint.gui.api.factory.wrapper.WrapperContext)1 AssignmentPathSegment (com.evolveum.midpoint.model.api.context.AssignmentPathSegment)1 LensContext (com.evolveum.midpoint.model.impl.lens.LensContext)1 LensFocusContext (com.evolveum.midpoint.model.impl.lens.LensFocusContext)1 LensUtil (com.evolveum.midpoint.model.impl.lens.LensUtil)1 AutoassignRoleMappingEvaluationRequest (com.evolveum.midpoint.model.impl.lens.projector.mappings.AutoassignRoleMappingEvaluationRequest)1 FocalMappingEvaluationRequest (com.evolveum.midpoint.model.impl.lens.projector.mappings.FocalMappingEvaluationRequest)1