public static void runPipeline(String pipelinePath, String datasetName, String sequenceId,
String question, String outputXmiPath) throws Exception {
String uuid = UUID.randomUUID().toString();
TypeSystemDescription typeSystem = TypeSystemDescriptionFactory.createTypeSystemDescription();
ExperimentBuilder builder = new BaseExperimentBuilder(uuid, pipelinePath, typeSystem);
AdHocDriver driver = new AdHocDriver(builder);
AdHocSource source = new BaseAdHocSource() {
public void publish(String quuid, String question) throws InterruptedException {
DataElement result = new DataElement(datasetName, sequenceId, question, quuid);
getReader().putQuestion(result);
}
};
XmiPrintCallbackListener callback = new XmiPrintCallbackListener(new File(outputXmiPath));
AdHocCollectionReader reader = driver.setupAndRun(source, callback);
String quuid = UUID.randomUUID().toString();
source.publish(quuid, question);
callback.await();
reader.shutdown();
}