use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class SurvivorShipTableViewer method createNewKeyDefinition.
/*
* (non-Javadoc) columnList.toArray(new String[0])
*
* @see org.talend.dataquality.record.linkage.ui.composite.tableviewer.AbstractMatchAnalysisTableViewer#
* createNewKeyDefinition(java.lang.String)
*/
@Override
protected SurvivorshipKeyDefinition createNewKeyDefinition(String columnName) {
SurvivorshipKeyDefinition skd = RulesFactory.eINSTANCE.createSurvivorshipKeyDefinition();
skd.setName(MatchAnalysisConstant.SURVIVORSHIP_KEY_DEFAULT_VALUE);
skd.setColumn(columnName);
AlgorithmDefinition createAlgorithmDefinition = RulesFactory.eINSTANCE.createAlgorithmDefinition();
createAlgorithmDefinition.setAlgorithmType(SurvivorShipAlgorithmEnum.getTypeByIndex(3).getComponentValueName());
skd.setFunction(createAlgorithmDefinition);
skd.setAllowManualResolution(true);
return skd;
}
use of org.talend.dataquality.rules.SurvivorshipKeyDefinition in project tdq-studio-se by Talend.
the class MatchKeyAndSurvivorshipTableViewer method removeElement.
@Override
public void removeElement(MatchKeyAndSurvivorDefinition msDedefinition, List<MatchKeyAndSurvivorDefinition> matchKeys) {
Iterator<MatchKeyAndSurvivorDefinition> matchKeyIterator = matchKeys.iterator();
while (matchKeyIterator.hasNext()) {
MatchKeyAndSurvivorDefinition keyDef = matchKeyIterator.next();
if (StringUtils.equals(keyDef.getMatchKey().getName(), msDedefinition.getMatchKey().getName())) {
super.removeElement(keyDef, matchKeys);
// link the added MatchKeyAndSurvivorDefinition's match and survivor key with matchRuleDef's matchkey
// and
// survivorkey list;
SurvivorshipKeyDefinition survivorShipKey = msDedefinition.getSurvivorShipKey();
MatchRuleDefinition matchRuleDef = (MatchRuleDefinition) survivorShipKey.eContainer();
((MatchRule) msDedefinition.getMatchKey().eContainer()).getMatchKeys().remove(msDedefinition.getMatchKey());
matchRuleDef.getSurvivorshipKeys().remove(survivorShipKey);
break;
}
}
}
Aggregations