use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class TableAnalysisWizard method initCWMResourceBuilder.
@Override
public ModelElement initCWMResourceBuilder() {
Analysis analysis = (Analysis) super.initCWMResourceBuilder();
NamedColumnSet[] ncss = getNamedColumnSet();
Connection tdp = getTdDataProvider();
if (ncss != null && getAnalysisBuilder() != null) {
List<Indicator> indicatorList = new ArrayList<Indicator>();
WhereRule[] whereRules = getWhereRules(dqruleSelectPage.getCViewer().getCheckedElements());
for (NamedColumnSet ncs : ncss) {
// add RowCountIndicator
RowCountIndicator rowCountIndicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(rowCountIndicator);
rowCountIndicator.setAnalyzedElement(ncs);
indicatorList.add(rowCountIndicator);
// add user selected WhereRuleIndicator
if (whereRules != null) {
for (WhereRule whereRule : whereRules) {
WhereRuleIndicator[] compositeWhereRuleIndicator = DQRuleUtilities.createCompositeWhereRuleIndicator(ncs, whereRule);
indicatorList.addAll(Arrays.asList(compositeWhereRuleIndicator));
}
}
}
getAnalysisBuilder().addElementsToAnalyze(ncss, indicatorList.toArray(new Indicator[indicatorList.size()]));
getAnalysisBuilder().setAnalysisConnection(tdp);
}
return analysis;
}
use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class RowCountIndicatorsAdapter method storeSqlResults.
/*
* (non-Javadoc)
*
* @see org.talend.dataquality.indicators.impl.IndicatorImpl#storeSqlResults(java.util.List)
*/
@Override
public boolean storeSqlResults(List<Object[]> objects) {
int index = 0;
for (RowCountIndicator rci : this.rowCountIndiSet) {
rci.storeSqlResults(objects);
index++;
}
if (index == 0 || index != rowCountIndiSet.size()) {
return false;
}
return super.storeSqlResults(objects);
}
use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class RowCountIndicatorsAdapter method setInstantiatedExpression.
/*
* (non-Javadoc)
*
* @see org.talend.dataquality.indicators.impl.IndicatorImpl#setInstantiatedExpression(orgomg.cwm.objectmodel.core.Expression)
*/
@Override
public boolean setInstantiatedExpression(Expression expression) {
int index = 0;
for (RowCountIndicator rci : this.rowCountIndiSet) {
TdExpression copySqlExpression = BooleanExpressionHelper.createTdExpression(expression.getLanguage(), expression.getBody());
rci.setInstantiatedExpression(copySqlExpression);
index++;
}
if (index == 0 || index != rowCountIndiSet.size()) {
return false;
}
return super.setInstantiatedExpression(expression);
}
Aggregations