Search in sources :

Example 1 with AutoOptimizationService

use of org.pentaho.di.trans.dataservice.optimization.AutoOptimizationService in project pdi-dataservice-server-plugin by pentaho.

the class ParameterGenerationController method runAutoGenerate.

public void runAutoGenerate() throws XulException {
    DataServiceModel dialogModel = model.getDialogModel();
    try {
        AutoOptimizationService autoOptimizationService = factory.createAutoOptimizationService();
        Collection<PushDownOptimizationMeta> found = autoOptimizationService.apply(dialogModel.getDataService());
        if (dialogModel.addAll(found)) {
            model.updateParameterMap();
        }
        info(getString(PKG, "ParameterGenerationController.AutoGen.Title"), getString(PKG, "ParameterGenerationController.AutoGen.Message", found.size()));
    } catch (Exception e) {
        String message = getString(PKG, "ParameterGenerationController.AutoGen.Error");
        getLogChannel().logError(message, e);
        error(getString(PKG, "ParameterGenerationController.AutoGen.Title"), message);
    }
}
Also used : DataServiceModel(org.pentaho.di.trans.dataservice.ui.model.DataServiceModel) PushDownOptimizationMeta(org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta) AutoOptimizationService(org.pentaho.di.trans.dataservice.optimization.AutoOptimizationService) BaseMessages.getString(org.pentaho.di.i18n.BaseMessages.getString) XulException(org.pentaho.ui.xul.XulException)

Aggregations

BaseMessages.getString (org.pentaho.di.i18n.BaseMessages.getString)1 AutoOptimizationService (org.pentaho.di.trans.dataservice.optimization.AutoOptimizationService)1 PushDownOptimizationMeta (org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta)1 DataServiceModel (org.pentaho.di.trans.dataservice.ui.model.DataServiceModel)1 XulException (org.pentaho.ui.xul.XulException)1