public static void main(String[] args) throws Throwable {
LookAndFeelManager.getInstance().init();
// run a small job
AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(), "conf.xml"));
AnalysisRunner runner = new AnalysisRunnerImpl(conf);
AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);
Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
ajb.setDatastore(ds);
DataContextProvider dcp = ds.getDataContextProvider();
Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.ORDERS");
ajb.addSourceColumn(table.getColumnByName("ORDERDATE"));
ajb.addSourceColumn(table.getColumnByName("SHIPPEDDATE"));
ajb.addSourceColumn(table.getColumnByName("CUSTOMERNUMBER"));
@SuppressWarnings("unchecked")
InputColumn<Date> orderDateColumn = (InputColumn<Date>) ajb.getSourceColumnByName("ORDERDATE");
@SuppressWarnings("unchecked")
InputColumn<Date> shippedDateColumn = (InputColumn<Date>) ajb.getSourceColumnByName("SHIPPEDDATE");
@SuppressWarnings("unchecked")
InputColumn<Integer> customerNumberColumn = (InputColumn<Integer>) ajb.getSourceColumnByName("CUSTOMERNUMBER");
@SuppressWarnings("unchecked")
MutableInputColumn<String> customerNumberAsStringColumn = (MutableInputColumn<String>) ajb
.addTransformer(ConvertToStringTransformer.class).addInputColumn(customerNumberColumn).getOutputColumns()
.get(0);
DateGapAnalyzer dga = ajb.addRowProcessingAnalyzer(DateGapAnalyzer.class).getConfigurableBean();
dga.setFromColumn(orderDateColumn);
dga.setToColumn(shippedDateColumn);
dga.setGroupColumn(customerNumberAsStringColumn);
AnalysisResultFuture resultFuture = runner.run(ajb.toAnalysisJob());
if (resultFuture.isErrornous()) {
throw resultFuture.getErrors().get(0);
}