@Test public void buildQueryParamsWithStatusEmpty() { Map<String, Object> params = Collections.singletonMap(STATUS, Collections.emptyList()); List<QueryParam> result = helper.buildQueryParams(params); assertNotContainsParam(result.toArray(new QueryParam[0]), AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.STATUS.columnName()); }
List<QueryParam> buildQueryParams(Map<String, Object> params) { List<QueryParam> queryParams = new ArrayList<>(); if (params.get(FROM_TASK_ID) instanceof Number) { Long fromTaskId = ((Number) params.get(FROM_TASK_ID)).longValue(); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), fromTaskId)); } if (params.get(TO_TASK_ID) instanceof Number) { Long toTaskId = ((Number) params.get(TO_TASK_ID)).longValue(); queryParams.add(QueryParam.lowerOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), toTaskId)); } if (params.containsKey(FROM_LAST_MODIFICATION_DATE)) { LocalDateTime fromLastModificationDate; if (params.get(FROM_LAST_MODIFICATION_DATE) instanceof LocalDateTimeValue) { fromLastModificationDate = ((LocalDateTimeValue) params.get(FROM_LAST_MODIFICATION_DATE)).getValue(); } else { fromLastModificationDate = (LocalDateTime) params.get(FROM_LAST_MODIFICATION_DATE); } if (fromLastModificationDate != null) { Date lastModificationDateValue = Date.from(fromLastModificationDate.atZone(ZoneId.systemDefault()).toInstant()); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.LAST_MODIFICATION_DATE.columnName(), lastModificationDateValue)); } } List<String> status = (List<String>) params.get(STATUS); if (status != null && !status.isEmpty()) { queryParams.add(QueryParam.equalsTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.STATUS.columnName(), status.toArray(new String[0]))); } return queryParams; }
TaskAssigningRuntimeServiceQueryHelper { List<QueryParam> buildQueryParams(Map<String, Object> params) { List<QueryParam> queryParams = new ArrayList<>(); if (params.get(FROM_TASK_ID) instanceof Number) { Long fromTaskId = ((Number) params.get(FROM_TASK_ID)).longValue(); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), fromTaskId)); } if (params.get(TO_TASK_ID) instanceof Number) { Long toTaskId = ((Number) params.get(TO_TASK_ID)).longValue(); queryParams.add(QueryParam.lowerOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), toTaskId)); } if (params.containsKey(FROM_LAST_MODIFICATION_DATE)) { LocalDateTime fromLastModificationDate; if (params.get(FROM_LAST_MODIFICATION_DATE) instanceof LocalDateTimeValue) { fromLastModificationDate = ((LocalDateTimeValue) params.get(FROM_LAST_MODIFICATION_DATE)).getValue(); } else { fromLastModificationDate = (LocalDateTime) params.get(FROM_LAST_MODIFICATION_DATE); } if (fromLastModificationDate != null) { Date lastModificationDateValue = Date.from(fromLastModificationDate.atZone(ZoneId.systemDefault()).toInstant()); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.LAST_MODIFICATION_DATE.columnName(), lastModificationDateValue)); } } List<String> status = (List<String>) params.get(STATUS); if (status != null && !status.isEmpty()) { queryParams.add(QueryParam.equalsTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.STATUS.columnName(), status.toArray(new String[0]))); } return queryParams; } }
TaskAssigningRuntimeServiceQueryHelper { List<QueryParam> buildQueryParams(Map<String, Object> params) { List<QueryParam> queryParams = new ArrayList<>(); if (params.get(FROM_TASK_ID) instanceof Number) { Long fromTaskId = ((Number) params.get(FROM_TASK_ID)).longValue(); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), fromTaskId)); } if (params.get(TO_TASK_ID) instanceof Number) { Long toTaskId = ((Number) params.get(TO_TASK_ID)).longValue(); queryParams.add(QueryParam.lowerOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), toTaskId)); } if (params.containsKey(FROM_LAST_MODIFICATION_DATE)) { LocalDateTime fromLastModificationDate; if (params.get(FROM_LAST_MODIFICATION_DATE) instanceof LocalDateTimeValue) { fromLastModificationDate = ((LocalDateTimeValue) params.get(FROM_LAST_MODIFICATION_DATE)).getValue(); } else { fromLastModificationDate = (LocalDateTime) params.get(FROM_LAST_MODIFICATION_DATE); } if (fromLastModificationDate != null) { Date lastModificationDateValue = Date.from(fromLastModificationDate.atZone(ZoneId.systemDefault()).toInstant()); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.LAST_MODIFICATION_DATE.columnName(), lastModificationDateValue)); } } List<String> status = (List<String>) params.get(STATUS); if (status != null && !status.isEmpty()) { queryParams.add(QueryParam.equalsTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.STATUS.columnName(), status.toArray(new String[0]))); } return queryParams; } TaskAssigningRuntimeServiceQueryHelper(KieServerRegistry registry, UserTaskService userTaskService, QueryService queryService); }
TaskAssigningRuntimeServiceQueryHelper { List<QueryParam> buildQueryParams(Map<String, Object> params) { List<QueryParam> queryParams = new ArrayList<>(); if (params.get(FROM_TASK_ID) instanceof Number) { Long fromTaskId = ((Number) params.get(FROM_TASK_ID)).longValue(); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), fromTaskId)); } if (params.get(TO_TASK_ID) instanceof Number) { Long toTaskId = ((Number) params.get(TO_TASK_ID)).longValue(); queryParams.add(QueryParam.lowerOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), toTaskId)); } if (params.containsKey(FROM_LAST_MODIFICATION_DATE)) { LocalDateTime fromLastModificationDate; if (params.get(FROM_LAST_MODIFICATION_DATE) instanceof LocalDateTimeValue) { fromLastModificationDate = ((LocalDateTimeValue) params.get(FROM_LAST_MODIFICATION_DATE)).getValue(); } else { fromLastModificationDate = (LocalDateTime) params.get(FROM_LAST_MODIFICATION_DATE); } if (fromLastModificationDate != null) { Date lastModificationDateValue = Date.from(fromLastModificationDate.atZone(ZoneId.systemDefault()).toInstant()); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.LAST_MODIFICATION_DATE.columnName(), lastModificationDateValue)); } } List<String> status = (List<String>) params.get(STATUS); if (status != null && !status.isEmpty()) { queryParams.add(QueryParam.equalsTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.STATUS.columnName(), status.toArray(new String[0]))); } return queryParams; } TaskAssigningRuntimeServiceQueryHelper(KieServerRegistry registry, UserTaskService userTaskService, QueryService queryService); List<TaskData> executeFindTasksQuery(Map<String, Object> params); List<TaskData> readTasksDataSummary(long fromTaskId, List<String> status, int pageSize); }
TaskAssigningRuntimeServiceQueryHelper { List<QueryParam> buildQueryParams(Map<String, Object> params) { List<QueryParam> queryParams = new ArrayList<>(); if (params.get(FROM_TASK_ID) instanceof Number) { Long fromTaskId = ((Number) params.get(FROM_TASK_ID)).longValue(); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), fromTaskId)); } if (params.get(TO_TASK_ID) instanceof Number) { Long toTaskId = ((Number) params.get(TO_TASK_ID)).longValue(); queryParams.add(QueryParam.lowerOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.TASK_ID.columnName(), toTaskId)); } if (params.containsKey(FROM_LAST_MODIFICATION_DATE)) { LocalDateTime fromLastModificationDate; if (params.get(FROM_LAST_MODIFICATION_DATE) instanceof LocalDateTimeValue) { fromLastModificationDate = ((LocalDateTimeValue) params.get(FROM_LAST_MODIFICATION_DATE)).getValue(); } else { fromLastModificationDate = (LocalDateTime) params.get(FROM_LAST_MODIFICATION_DATE); } if (fromLastModificationDate != null) { Date lastModificationDateValue = Date.from(fromLastModificationDate.atZone(ZoneId.systemDefault()).toInstant()); queryParams.add(QueryParam.greaterOrEqualTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.LAST_MODIFICATION_DATE.columnName(), lastModificationDateValue)); } } List<String> status = (List<String>) params.get(STATUS); if (status != null && !status.isEmpty()) { queryParams.add(QueryParam.equalsTo(AbstractTaskAssigningQueryMapper.TASK_QUERY_COLUMN.STATUS.columnName(), status.toArray(new String[0]))); } return queryParams; } TaskAssigningRuntimeServiceQueryHelper(KieServerRegistry registry, UserTaskService userTaskService, QueryService queryService); List<TaskData> executeFindTasksQuery(Map<String, Object> params); List<TaskData> readTasksDataSummary(long fromTaskId, List<String> status, int pageSize);  }