use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class WorkbasketServiceImpl method getDistributionTargets.
@Override
public List<WorkbasketSummary> getDistributionTargets(String workbasketKey, String domain) throws NotAuthorizedException, WorkbasketNotFoundException {
LOGGER.debug("entry to getDistributionTargets(workbasketKey = {}, domain = {})", workbasketKey, domain);
List<WorkbasketSummary> result = new ArrayList<>();
try {
taskanaEngine.openConnection();
// check that source workbasket exists
Workbasket workbasket = getWorkbasket(workbasketKey, domain);
if (!taskanaEngine.isUserInRole(TaskanaRole.ADMIN, TaskanaRole.BUSINESS_ADMIN)) {
checkAuthorization(workbasket.getId(), WorkbasketPermission.READ);
}
List<WorkbasketSummaryImpl> distributionTargets = workbasketMapper.findByDistributionTargets(workbasket.getId());
result.addAll(distributionTargets);
return result;
} finally {
taskanaEngine.returnConnection();
if (LOGGER.isDebugEnabled()) {
int numberOfResultObjects = result.size();
LOGGER.debug("exit from getDistributionTargets(workbasketId). Returning {} resulting Objects: {} ", numberOfResultObjects, LoggerUtils.listToString(result));
}
}
}
Aggregations