Search in sources :

Example 1 with TDQAnalysisItemImpl

use of org.talend.dataquality.properties.impl.TDQAnalysisItemImpl in project tdq-studio-se by Talend.

the class DependenciesHandler method getAnaDependency.

/**
 * get Analysis Dependency (for indicator only).
 *
 * @return get the list of indicator which in use by the analysis
 */
public List<Property> getAnaDependency(Property property) {
    Item item = property.getItem();
    List<Property> listProperty = new ArrayList<Property>();
    if (item instanceof TDQAnalysisItemImpl) {
        TDQAnalysisItemImpl tdqAnaItem = (TDQAnalysisItemImpl) item;
        Analysis anaElement = tdqAnaItem.getAnalysis();
        List<Indicator> indicators = IndicatorHelper.getIndicators(anaElement.getResults());
        for (Indicator indicator : indicators) {
            boolean isContain = false;
            IndicatorDefinition newIndicatorDefinition = indicator.getIndicatorDefinition();
            // MOD qiongli 2012-5-11 TDQ-5256
            if (newIndicatorDefinition == null) {
                continue;
            }
            for (Property containViewObject : listProperty) {
                Item item2 = containViewObject.getItem();
                if (item2 instanceof TDQIndicatorDefinitionItemImpl) {
                    IndicatorDefinition oldIndicatorDefinition = ((TDQIndicatorDefinitionItemImpl) item2).getIndicatorDefinition();
                    if (ModelElementHelper.compareUUID(oldIndicatorDefinition, newIndicatorDefinition)) {
                        isContain = true;
                        break;
                    }
                }
            }
            if (!isContain) {
                Property iniProperty = PropertyHelper.getProperty(indicator.getIndicatorDefinition());
                if (iniProperty != null) {
                    listProperty.add(iniProperty);
                }
            }
        }
    }
    return listProperty;
}
Also used : TDQAnalysisItem(org.talend.dataquality.properties.TDQAnalysisItem) Item(org.talend.core.model.properties.Item) TDQSourceFileItem(org.talend.dataquality.properties.TDQSourceFileItem) TDQFileItem(org.talend.dataquality.properties.TDQFileItem) TDQIndicatorDefinitionItemImpl(org.talend.dataquality.properties.impl.TDQIndicatorDefinitionItemImpl) Analysis(org.talend.dataquality.analysis.Analysis) ArrayList(java.util.ArrayList) Property(org.talend.core.model.properties.Property) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition) TDQAnalysisItemImpl(org.talend.dataquality.properties.impl.TDQAnalysisItemImpl) Indicator(org.talend.dataquality.indicators.Indicator)

Aggregations

ArrayList (java.util.ArrayList)1 Item (org.talend.core.model.properties.Item)1 Property (org.talend.core.model.properties.Property)1 Analysis (org.talend.dataquality.analysis.Analysis)1 Indicator (org.talend.dataquality.indicators.Indicator)1 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)1 TDQAnalysisItem (org.talend.dataquality.properties.TDQAnalysisItem)1 TDQFileItem (org.talend.dataquality.properties.TDQFileItem)1 TDQSourceFileItem (org.talend.dataquality.properties.TDQSourceFileItem)1 TDQAnalysisItemImpl (org.talend.dataquality.properties.impl.TDQAnalysisItemImpl)1 TDQIndicatorDefinitionItemImpl (org.talend.dataquality.properties.impl.TDQIndicatorDefinitionItemImpl)1