private void insertTasks(final DSLContext context,
                             final Object[][] allBindValues) {
        BatchBindStep batchBindStep = null;
        int i = 0;

        for (final Object[] bindValues : allBindValues) {
            i++;

            if (batchBindStep == null) {
                batchBindStep = context
                        .batch(
                                context
                                        .insertInto(PROCESSOR_TASK)
                                        .columns(PROCESSOR_TASK_COLUMNS)
                                        .values(PROCESSOR_TASK_VALUES));
            }

            batchBindStep = batchBindStep.bind(bindValues);

            // Execute insert if we have reached batch size.
            if (i >= processorConfig.getDatabaseMultiInsertMaxBatchSize()) {
                executeInsert(batchBindStep, i);
                i = 0;
                batchBindStep = null;
            }
        }

        // Do final execution.
        if (batchBindStep != null) {
            executeInsert(batchBindStep, i);
        }
    }
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