@Override
    public int countTasksForFilter(final int filterId, final TaskStatus status) {
        return JooqUtil.contextResult(
                processorDbConnProvider, context ->
                        context
                                .selectCount()
                                .from(PROCESSOR_TASK)
                                .where(PROCESSOR_TASK.STATUS.eq(status.getPrimitiveValue()))
                                .and(PROCESSOR_TASK.FK_PROCESSOR_FILTER_ID.eq(filterId))
                                .fetchOne(0, int.class));
    }
Count the current number of tasks for a filter matching the specified status.

@param filterId The filter to count tasks for.
@param status   Task status.
@return The number of tasks matching the specified status.
stroom-processor/stroom-processor-impl-db/src/main/java/stroom/processor/impl/db/ProcessorTaskDaoImpl.java