use of com.evolveum.midpoint.model.api.context.AssignmentPathSegment in project midpoint by Evolveum.
the class AssignmentPathImpl method debugDump.
@Override
public String debugDump(int indent) {
StringBuilder sb = new StringBuilder();
DebugUtil.debugDumpLabel(sb, "AssignmentPath", indent);
if (segments.isEmpty()) {
sb.append(" (empty)");
} else {
sb.append(" (").append(segments.size()).append(")");
if (DebugUtil.isDetailedDebugDump()) {
sb.append("\n");
DebugUtil.debugDump(sb, segments, indent + 1, false);
} else {
for (AssignmentPathSegment segment : segments) {
sb.append("\n");
DebugUtil.indentDebugDump(sb, indent + 1);
sb.append(segment.toString());
}
}
}
return sb.toString();
}
use of com.evolveum.midpoint.model.api.context.AssignmentPathSegment in project midpoint by Evolveum.
the class AssignmentPathUtil method collectExtensions.
// works with native assignment path (AssignmentPath)
public static ExtensionType collectExtensions(AssignmentPath path, int startAt, PrismContext prismContext) throws SchemaException {
ExtensionType rv = new ExtensionType(prismContext);
PrismContainerValue<?> pcv = rv.asPrismContainerValue();
for (int i = startAt; i < path.getSegments().size(); i++) {
AssignmentPathSegment segment = path.getSegments().get(i);
AssignmentType assignment = segment.getAssignmentAny();
if (assignment != null && assignment.getExtension() != null) {
ObjectTypeUtil.mergeExtension(pcv, assignment.getExtension().asPrismContainerValue());
}
if (segment.getTarget() != null && segment.getTarget().getExtension() != null) {
ObjectTypeUtil.mergeExtension(pcv, segment.getTarget().getExtension().asPrismContainerValue());
}
}
return rv;
}
use of com.evolveum.midpoint.model.api.context.AssignmentPathSegment in project midpoint by Evolveum.
the class AssignmentPathImpl method equivalent.
@Override
public boolean equivalent(AssignmentPath other) {
if (size() != other.size()) {
return false;
}
for (int i = 0; i < segments.size(); i++) {
AssignmentPathSegment segment = segments.get(i);
AssignmentPathSegment otherSegment = other.getSegments().get(i);
if (!segment.equivalent(otherSegment)) {
return false;
}
}
return true;
}
use of com.evolveum.midpoint.model.api.context.AssignmentPathSegment 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