Skip to content

Commit

Permalink
assignment counter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Sep 13, 2021
1 parent e969655 commit 8ec6e13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4833,6 +4833,13 @@ public static boolean isArchetypeAssignment(AssignmentType assignmentType) {
return QNameUtil.match(assignmentType.getTargetRef().getType(), ArchetypeType.COMPLEX_TYPE);
}

public static boolean isDelegationAssignment(AssignmentType assignmentType) {
if (assignmentType.getTargetRef() == null) {
return false;
}
return QNameUtil.match(assignmentType.getTargetRef().getType(), UserType.COMPLEX_TYPE);
}

public static <AH extends AssignmentHolderType> boolean hasArchetypeAssignment(AH assignmentHolder, String archetypeOid) {
if (assignmentHolder.getAssignment() == null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public int count(AssignmentHolderDetailsModel<AH> objectDetailsModels, PageBase
List<AssignmentType> assignments = object.getAssignment();
int count = 0;
for (AssignmentType assignment : assignments) {
if (WebComponentUtil.isArchetypeAssignment(assignment)) {
if (WebComponentUtil.isArchetypeAssignment(assignment) || WebComponentUtil.isDelegationAssignment(assignment)) {
continue;
}
count++;
Expand Down

0 comments on commit 8ec6e13

Please sign in to comment.