// if the search options have changed since the last search, put at the beginning of the options history list
WorkEffortSearchSession.checkSaveSearchOptionsHistory(session);
ResultSortOrder resultSortOrder = WorkEffortSearchOptions.getResultSortOrder(request);
WorkEffortSearchContext workEffortSearchContext = new WorkEffortSearchContext(delegator, visitId);
workEffortSearchContext.addWorkEffortSearchConstraints(workEffortSearchConstraintList);
workEffortSearchContext.setResultSortOrder(resultSortOrder);
workEffortSearchContext.setResultOffset(resultOffset);
workEffortSearchContext.setMaxResults(maxResults);
workEffortIds = workEffortSearchContext.doSearch();
Integer totalResults = workEffortSearchContext.getTotalResults();
if (totalResults != null) {
listSize = totalResults.intValue();
}
}