Date dueDateLowerThen = RequestUtil.getDate(getQuery(), "duedate-lt");
Date dueDateLowerThenOrEquals = RequestUtil.getDate(getQuery(), "duedate-ltoe");
Date dueDateHigherThen = RequestUtil.getDate(getQuery(), "duedate-ht");
Date dueDateHigherThenOrEquals = RequestUtil.getDate(getQuery(), "duedate-htoe");
JobQuery jobQuery = ActivitiUtil.getManagementService().createJobQuery();
if (processInstanceId != null) {
jobQuery.processInstanceId(processInstanceId);
}
if (withRetriesLeft) {
jobQuery.withRetriesLeft();
}
if (executable) {
jobQuery.executable();
}
if (onlyTimers) {
jobQuery.timers();
}
if (onlyMessages) {
jobQuery.messages();
}
if (dueDateLowerThen != null) {
jobQuery.duedateLowerThen(dueDateLowerThen);
}
if (dueDateLowerThenOrEquals != null) {
jobQuery.duedateLowerThenOrEquals(dueDateLowerThenOrEquals);
}
if (dueDateHigherThen != null) {
jobQuery.duedateHigherThen(dueDateHigherThen);
}
if (dueDateHigherThenOrEquals != null) {
jobQuery.duedateLowerThenOrEquals(dueDateLowerThenOrEquals);
}
DataResponse response = new JobsPaginateList().paginateList(getQuery(), jobQuery, "id", properties);
return response;
}