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;
}
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));
}
}
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;
}
Aggregations