if (searchBean.hasAddressee()) {
SearchPerson.SearchParameters parameters =
new SearchParameters(searchBean.getAddressee().getName(), null, searchBean.getAddressee().getUsername(),
searchBean.getAddressee().getDocumentIdNumber(), null, null, null, null, null, null, null,
(String) null);
SearchPersonPredicate predicate = new SearchPerson.SearchPersonPredicate(parameters);
CollectionPager<Person> persons = SearchPerson.runSearchPerson(parameters, predicate);
Set<GeneratedDocument> personDocuments = new HashSet<GeneratedDocument>();
for (Person person : persons.getCollection()) {
personDocuments.addAll(person.getAddressedDocumentSet());
}
documents.retainAll(personDocuments);
}
if (searchBean.hasOperator()) {
SearchPerson.SearchParameters parameters =
new SearchParameters(searchBean.getOperator().getName(), null, searchBean.getOperator().getUsername(),
searchBean.getOperator().getDocumentIdNumber(), null, null, null, null, null, null, null,
(String) null);
SearchPersonPredicate predicate = new SearchPerson.SearchPersonPredicate(parameters);
CollectionPager<Person> operators = SearchPerson.runSearchPerson(parameters, predicate);
Set<GeneratedDocument> operatorDocuments = new HashSet<GeneratedDocument>();
for (Person person : operators.getCollection()) {
operatorDocuments.addAll(person.getProcessedDocumentSet());
}