Search in sources :

Example 1 with AssignmentConflictDto

use of com.evolveum.midpoint.web.page.self.dto.AssignmentConflictDto in project midpoint by Evolveum.

the class PageAssignmentsList method getAssignmentsToDeselectList.

private List<String> getAssignmentsToDeselectList(UserType user) {
    List<AssignmentConflictDto> conflicts = getSessionStorage().getRoleCatalog().getConflictsList();
    List<String> assignmentsToDeselectOids = new ArrayList<>();
    for (AssignmentConflictDto dto : conflicts) {
        if (dto.isUnassignedNew()) {
            assignmentsToDeselectOids.add(dto.getExistingAssignmentTargetObj().getOid());
        }
    }
    return assignmentsToDeselectOids;
}
Also used : AssignmentConflictDto(com.evolveum.midpoint.web.page.self.dto.AssignmentConflictDto)

Example 2 with AssignmentConflictDto

use of com.evolveum.midpoint.web.page.self.dto.AssignmentConflictDto in project midpoint by Evolveum.

the class PageAssignmentsList method fillInFromEvaluatedExclusionTrigger.

private void fillInFromEvaluatedExclusionTrigger(EvaluatedAssignment<UserType> evaluatedAssignment, EvaluatedExclusionTrigger exclusionTrigger, boolean isWarning, Map<String, ConflictDto> conflictsMap) {
    EvaluatedAssignment<F> conflictingAssignment = exclusionTrigger.getConflictingAssignment();
    PrismObject<F> addedAssignmentTargetObj = (PrismObject<F>) evaluatedAssignment.getTarget();
    PrismObject<F> exclusionTargetObj = (PrismObject<F>) conflictingAssignment.getTarget();
    AssignmentConflictDto<F> dto1 = new AssignmentConflictDto<>(exclusionTargetObj, conflictingAssignment.getAssignment(true) != null);
    AssignmentConflictDto<F> dto2 = new AssignmentConflictDto<>(addedAssignmentTargetObj, evaluatedAssignment.getAssignment(true) != null);
    ConflictDto conflict = new ConflictDto(dto1, dto2, isWarning);
    String oid1 = exclusionTargetObj.getOid();
    String oid2 = addedAssignmentTargetObj.getOid();
    if (!conflictsMap.containsKey(oid1 + oid2) && !conflictsMap.containsKey(oid2 + oid1)) {
        conflictsMap.put(oid1 + oid2, conflict);
    } else if (!isWarning) {
        // TODO Kate please review this
        if (conflictsMap.containsKey(oid1 + oid2)) {
            conflictsMap.replace(oid1 + oid2, conflict);
        }
        if (conflictsMap.containsKey(oid2 + oid1)) {
            conflictsMap.replace(oid2 + oid1, conflict);
        }
    }
}
Also used : AssignmentConflictDto(com.evolveum.midpoint.web.page.self.dto.AssignmentConflictDto) AssignmentConflictDto(com.evolveum.midpoint.web.page.self.dto.AssignmentConflictDto) ConflictDto(com.evolveum.midpoint.web.page.self.dto.ConflictDto)

Aggregations

AssignmentConflictDto (com.evolveum.midpoint.web.page.self.dto.AssignmentConflictDto)2 ConflictDto (com.evolveum.midpoint.web.page.self.dto.ConflictDto)1