private void createProcessorFilters(final List<DocRef> feeds) {
        // Create stream processors for all feeds.
        feeds.parallelStream()
                .forEach(feed -> {
                    // Find the pipeline for this feed.
                    final List<DocRef> pipelines = pipelineStore.list().stream()
                            .filter(docRef -> feed.getName()
                                    .equals(docRef.getName()))
                            .collect(Collectors.toList());

                    if (pipelines == null || pipelines.size() == 0) {
                        LOGGER.warn("No pipeline found for feed '" + feed.getName() + "'");
                    } else if (pipelines.size() > 1) {
                        LOGGER.warn("More than 1 pipeline found for feed '" + feed.getName() + "'");
                    } else {
                        final DocRef pipeline = pipelines.get(0);

                        // Create a processor for this feed.
                        final QueryData criteria = QueryData.builder()
                                .dataSource(MetaFields.STREAM_STORE_DOC_REF)
                                .expression(ExpressionOperator.builder()
                                        .addTextTerm(MetaFields.FEED, ExpressionTerm.Condition.EQUALS, feed.getName())
                                        .addOperator(ExpressionOperator.builder().op(Op.OR)
                                                .addTextTerm(MetaFields.TYPE,
                                                        ExpressionTerm.Condition.EQUALS,
                                                        StreamTypeNames.RAW_EVENTS)
                                                .addTextTerm(MetaFields.TYPE,
                                                        ExpressionTerm.Condition.EQUALS,
                                                        StreamTypeNames.RAW_REFERENCE)
                                                .build())
                                        .build())
                                .build();
                        final Processor processor = processorService.create(ProcessorType.PIPELINE, pipeline, true);
                        LOGGER.info("Creating processor filter on {} for feed {}", pipeline.getName(), feed.getName());
                        final ProcessorFilter processorFilter = processorFilterService.create(
                                processor,
                                CreateProcessFilterRequest
                                        .builder()
                                        .pipeline(pipeline)
                                        .queryData(criteria)
                                        .build());
                        LOGGER.debug(processorFilter.toString());
                    }
                });
    }
Script to create some base data for testing.
stroom-app/src/test/java/stroom/test/SetupSampleDataBean.java