Package org.eobjects.analyzer.job.runner

Examples of org.eobjects.analyzer.job.runner.AnalysisRunnerImpl


  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);
    }
View Full Code Here


  private final ProgressInformationPanel _progressInformationPanel;
  private AnalysisResultFuture _resultFuture;

  public AnalysisRunnerSwingWorker(AnalyzerBeansConfiguration configuration, AnalysisJob job, ResultWindow resultWindow,
      ProgressInformationPanel progressInformationPanel) {
    _analysisRunner = new AnalysisRunnerImpl(configuration, this);
    _job = job;
    _resultWindow = resultWindow;
    _progressInformationPanel = progressInformationPanel;
  }
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.job.runner.AnalysisRunnerImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.