Skip to content

Commit

Permalink
handling the situation when no attorney is selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Sep 7, 2022
1 parent eeeceb1 commit 3236366
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,22 @@
})
public class PageWorkItemsAttorney extends PageCaseWorkItems {

public PageWorkItemsAttorney() {
this(null);
}

public PageWorkItemsAttorney(PageParameters pageParameters) {
super(pageParameters);

if (getPowerDonorOid() == null) {
getSession().error("PageWorkItemsAttorney.attorney.not.selected");
throw redirectBackViaRestartResponseException();
}
}

@Override
protected ObjectFilter getCaseWorkItemsFilter() {
String attorneyUserOid = getPowerDonorOid();
if (StringUtils.isEmpty(attorneyUserOid) || attorneyUserOid.equals("null")) {
return super.getCaseWorkItemsFilter();
}
return getPrismContext().queryFor(CaseWorkItemType.class)
.item(CaseWorkItemType.F_ASSIGNEE_REF)
.ref(attorneyUserOid, UserType.COMPLEX_TYPE)
Expand Down

0 comments on commit 3236366

Please sign in to comment.