use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.
the class AnaMatchSurvivorSection method removeMatchKeyFromCurrentMatchRule.
@Override
public void removeMatchKeyFromCurrentMatchRule(String column) {
MatchKeyAndSurvivorTableComposite matchRuleTableComp = (MatchKeyAndSurvivorTableComposite) getCurrentMatchRuleTableComposite();
MatchRule matchRule = matchRuleTableComp.getMatchRule();
List<MatchKeyAndSurvivorDefinition> matchAndSurvDefList = matchRuleWithSurvMap.get(matchRule);
matchRuleTableComp.removeKeyDefinition(column, matchAndSurvDefList);
}
use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.
the class MatchingKeySection method getMatchRule.
/**
* DOC zhao Comment method "getMatchRule".
*
* @param tabItem
* @return
*/
protected MatchRule getMatchRule(CTabItem tabItem) {
MatchRuleTableComposite matchRuleTableComp = (MatchRuleTableComposite) getMatchRuleComposite(tabItem);
MatchRule matchRule = matchRuleTableComp.getMatchRule();
return matchRule;
}
use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.
the class MatchingKeySection method createMatchRuleByCopy.
// copy a match rule to a new one
private MatchRule createMatchRuleByCopy(MatchRule oldRule) {
MatchRule newRule = RulesFactory.eINSTANCE.createMatchRule();
if (oldRule.getMatchKeys() != null && oldRule.getMatchKeys().size() > 0) {
for (MatchKeyDefinition matchKey : oldRule.getMatchKeys()) {
newRule.getMatchKeys().add(EcoreUtil.copy(matchKey));
}
}
newRule.setMatchInterval(oldRule.getMatchInterval());
return newRule;
}
use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.
the class MatchingKeySection method initMatchRuleTabs.
/**
* DOC zhao Comment method "initMatchRuleTabs".
*/
private void initMatchRuleTabs() {
List<MatchRule> matchRules = getMatchRuleList();
for (MatchRule matchRule : matchRules) {
addRuleTab(false, matchRule);
tabCount++;
}
if (matchRules.isEmpty()) {
// create one match rule tab when no one exist.
MatchRule newMatchRule = getNewMatchRule();
addRuleTab(false, newMatchRule);
matchRules.add(newMatchRule);
}
}
use of org.talend.dataquality.rules.MatchRule in project tdq-studio-se by Talend.
the class MatchAnalysisDetailsPage method canRun.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.analysis.AbstractAnalysisMetadataPage#canRun()
*/
@Override
protected ReturnCode canRun() {
ReturnCode rc = new ReturnCode(Boolean.FALSE);
// when the user didnot select any columns, can not run
if (analysisHandler.getAnalyzedColumns() == null || analysisHandler.getAnalyzedColumns().size() < 1) {
// $NON-NLS-1$
rc.setMessage(DefaultMessagesImpl.getString("MatchMasterDetailsPage.NoSelectColumn"));
return rc;
}
RecordMatchingIndicator recordMatchingIndicator = MatchRuleAnlaysisUtils.getRecordMatchIndicatorFromAna(getCurrentModelElement());
EList<MatchRule> matchRules = recordMatchingIndicator.getBuiltInMatchRuleDefinition().getMatchRules();
if (matchRules.size() > 0) {
MatchRule matchRule = matchRules.get(0);
if (matchRule.getMatchKeys().size() > 0) {
rc.setOk(Boolean.TRUE);
} else {
// $NON-NLS-1$
rc.setMessage(DefaultMessagesImpl.getString("MatchMasterDetailsPage.NoMatchKey"));
}
} else {
// $NON-NLS-1$
rc.setMessage(DefaultMessagesImpl.getString("MatchMasterDetailsPage.NoMatchKey"));
}
if (rc.isOk()) {
rc = this.particularDefaultSurvivorshipSection.checkResultStatus();
}
return rc;
}
Aggregations