Search in sources :

Example 16 with MatchRule

use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.

the class AnaMatchSurvivorSection method getCurrentTabDefinitions.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataquality.record.linkage.ui.section.MatchingKeySection#getCurrentTabDefinitions()
     */
@Override
protected List<?> getCurrentTabDefinitions() {
    MatchKeyAndSurvivorTableComposite matchRuleTableComp = (MatchKeyAndSurvivorTableComposite) getCurrentMatchRuleTableComposite();
    MatchRule matchRule = matchRuleTableComp.getMatchRule();
    List<MatchKeyAndSurvivorDefinition> matchAndSurvDefList = matchRuleWithSurvMap.get(matchRule);
    return matchAndSurvDefList;
}
Also used : MatchKeyAndSurvivorTableComposite(org.talend.dataquality.record.linkage.ui.composite.MatchKeyAndSurvivorTableComposite) MatchRule(org.talend.dataquality.rules.MatchRule) MatchKeyAndSurvivorDefinition(org.talend.dataquality.record.linkage.ui.composite.tableviewer.definition.MatchKeyAndSurvivorDefinition)

Example 17 with MatchRule

use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.

the class AnaMatchSurvivorSection method deleteMatchRuleTab.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.dataquality.record.linkage.ui.section.MatchingKeySection#deleteMatchRuleTab(org.eclipse.swt.custom
     * .CTabItem)
     */
@Override
protected void deleteMatchRuleTab(CTabItem tabItem) {
    MatchRule matchRule = getMatchRule(tabItem);
    List<MatchKeyAndSurvivorDefinition> matchAndSurvDefList = matchRuleWithSurvMap.get(matchRule);
    MatchRuleDefinition matchRuleDefinition = getMatchRuleDefinition();
    for (MatchKeyAndSurvivorDefinition matchAndSurvDef : matchAndSurvDefList) {
        matchRuleDefinition.getSurvivorshipKeys().remove(matchAndSurvDef.getSurvivorShipKey());
    }
    matchRuleWithSurvMap.remove(matchRule);
    super.deleteMatchRuleTab(tabItem);
}
Also used : MatchRuleDefinition(org.talend.dataquality.rules.MatchRuleDefinition) MatchRule(org.talend.dataquality.rules.MatchRule) MatchKeyAndSurvivorDefinition(org.talend.dataquality.record.linkage.ui.composite.tableviewer.definition.MatchKeyAndSurvivorDefinition)

Example 18 with MatchRule

use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.

the class EditSortMatchRuleNamesDialog method okPressed.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.Dialog#okPressed()
     */
@Override
protected void okPressed() {
    resultMatchRuleList.clear();
    // set the modified name to Matchrule
    for (int i = 0; i < orderMatchRuleList.size(); i++) {
        OrderMatchRule orderMatchRule = orderMatchRuleList.get(i);
        MatchRule matchRule = orderMatchRule.getMatchRule();
        matchRule.setName(orderMatchRule.getName());
        resultMatchRuleList.add(matchRule);
    }
    super.okPressed();
}
Also used : MatchRule(org.talend.dataquality.rules.MatchRule)

Example 19 with MatchRule

use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.

the class MatchingKeySection method getCurrentMatchRuleTableComposite.

protected AbsMatchAnalysisTableComposite<?> getCurrentMatchRuleTableComposite() {
    CTabItem currentTabItem = ruleFolder.getSelection();
    if (currentTabItem == null) {
        // $NON-NLS-1$
        log.warn(DefaultMessagesImpl.getString("MatchingKeySection.ONE_MATCH_RULE_REQUIRED"));
        MatchRule newMatchRule = getNewMatchRule();
        addRuleTab(false, newMatchRule);
        addMatchRuleToAnalysis(newMatchRule);
        currentTabItem = ruleFolder.getSelection();
    }
    AbsMatchAnalysisTableComposite<?> matchRuleTableComp = getMatchRuleComposite(currentTabItem);
    return matchRuleTableComp;
}
Also used : MatchRule(org.talend.dataquality.rules.MatchRule) CTabItem(org.eclipse.swt.custom.CTabItem)

Example 20 with MatchRule

use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.

the class MatchingKeySection method getCurrentMatchRule.

protected MatchRule getCurrentMatchRule() throws Exception {
    CTabItem currentTabItem = ruleFolder.getSelection();
    if (currentTabItem == null) {
        // $NON-NLS-1$
        throw new Exception(DefaultMessagesImpl.getString("MatchingKeySection.ONE_MATCH_RULE_REQUIRED"));
    }
    MatchRuleTableComposite matchRuleTableComp = (MatchRuleTableComposite) getMatchRuleComposite(currentTabItem);
    MatchRule matchRule = matchRuleTableComp.getMatchRule();
    return matchRule;
}
Also used : MatchRuleTableComposite(org.talend.dataquality.record.linkage.ui.composite.MatchRuleTableComposite) MatchRule(org.talend.dataquality.rules.MatchRule) CTabItem(org.eclipse.swt.custom.CTabItem)

Aggregations

MatchRule (org.talend.dataquality.rules.MatchRule)29 MatchKeyDefinition (org.talend.dataquality.rules.MatchKeyDefinition)14 ArrayList (java.util.ArrayList)10 MatchRuleDefinition (org.talend.dataquality.rules.MatchRuleDefinition)8 HashMap (java.util.HashMap)7 RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)6 AlgorithmDefinition (org.talend.dataquality.rules.AlgorithmDefinition)6 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)5 BlockKeyDefinition (org.talend.dataquality.rules.BlockKeyDefinition)5 Test (org.junit.Test)4 BlockKeyIndicator (org.talend.dataquality.indicators.columnset.BlockKeyIndicator)4 MatchGroupResultConsumer (org.talend.dataquality.record.linkage.grouping.MatchGroupResultConsumer)4 MatchKeyAndSurvivorDefinition (org.talend.dataquality.record.linkage.ui.composite.tableviewer.definition.MatchKeyAndSurvivorDefinition)4 ExecuteMatchRuleHandler (org.talend.dq.analysis.match.ExecuteMatchRuleHandler)4 CTabItem (org.eclipse.swt.custom.CTabItem)3 MatchKeyAndSurvivorTableComposite (org.talend.dataquality.record.linkage.ui.composite.MatchKeyAndSurvivorTableComposite)3 SurvivorshipKeyDefinition (org.talend.dataquality.rules.SurvivorshipKeyDefinition)3 Map (java.util.Map)2 MatchRuleTableComposite (org.talend.dataquality.record.linkage.ui.composite.MatchRuleTableComposite)2 KeyDefinition (org.talend.dataquality.rules.KeyDefinition)2