@Override
    public int releaseTasks(final Set<Long> idSet, final TaskStatus currentStatus) {
        final long now = System.currentTimeMillis();

        final Condition statusCondition = PROCESSOR_TASK.STATUS.eq(currentStatus.getPrimitiveValue());
        final Condition condition = PROCESSOR_TASK.ID.in(idSet).and(statusCondition);

        return JooqUtil.contextResult(
                processorDbConnProvider, context -> {
                    // Update the records.
                    return changeStatus(
                            context,
                            null,
                            TaskStatus.CREATED,
                            now,
                            condition);
                });
    }
Change the node ownership of the tasks in the id set and select them back to include in the queue.

@param idSet    The ids of the tasks to take ownership of.
@param nodeName This node name.
@return A list of tasks to queue.
stroom-processor/stroom-processor-impl-db/src/main/java/stroom/processor/impl/db/ProcessorTaskDaoImpl.java