use of org.talend.dataquality.rules.MatchRuleDefinition in project tdq-studio-se by Talend.
the class MatchRuleElementTreeSelectionDialog method getBlockingKeysFromNodes.
public List<Map<String, String>> getBlockingKeysFromNodes(Object[] nodes, boolean retrieveDisplayValue) {
List<Map<String, String>> ruleValues = new ArrayList<Map<String, String>>();
for (Object rule : nodes) {
if (rule instanceof RuleRepNode) {
RuleRepNode node = (RuleRepNode) rule;
MatchRuleDefinition matchRuleDefinition = (MatchRuleDefinition) node.getRule();
ruleValues.addAll(getBlockingKeysFromRules(matchRuleDefinition, retrieveDisplayValue));
}
}
return ruleValues;
}
use of org.talend.dataquality.rules.MatchRuleDefinition in project tdq-studio-se by Talend.
the class NewMatchRuleWizard method initCWMResourceBuilder.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.wizard.ICWMResouceAdapter#initCWMResourceBuilder()
*/
public ModelElement initCWMResourceBuilder() {
if (matchRule != null) {
MatchRuleDefinition copiedMatchRuleDefinition = EcoreUtil.copy(matchRule);
copiedMatchRuleDefinition.setName(parameter.getName());
return copiedMatchRuleDefinition;
}
MatchRuleBuilder ruleBuilder = new MatchRuleBuilder();
boolean ruleInitialized = ruleBuilder.initializeDqRuleBuilder(parameter);
if (ruleInitialized) {
return ruleBuilder.getMatchRule();
}
return null;
}
use of org.talend.dataquality.rules.MatchRuleDefinition in project tdq-studio-se by Talend.
the class NewMatchRuleWizard method createAndSaveCWMFile.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.wizard.ICWMResouceAdapter#createAndSaveCWMFile(orgomg.cwm.objectmodel.core.
* ModelElement)
*/
public TypedReturnCode<Object> createAndSaveCWMFile(ModelElement repositoryObject) {
MatchRuleDefinition newMatchRule = (MatchRuleDefinition) repositoryObject;
TaggedValueHelper.setValidStatus(true, newMatchRule);
// Added for export an match rule created by the match analysis, which need to replace the rules in createdItem,
MatchRuleDefinitionWriter matchRuleWriter = ElementWriterFactory.getInstance().createdMatchRuleWriter();
if (isExport) {
matchRuleWriter.copy(newMatchRule, this.matchRule);
}
IFolder folder = parameter.getFolderProvider().getFolderResource();
TypedReturnCode<Object> createdItem = matchRuleWriter.create(newMatchRule, folder);
return createdItem;
}
use of org.talend.dataquality.rules.MatchRuleDefinition in project tdq-studio-se by Talend.
the class TDQMatchRuleItemImpl method setMatchRule.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMatchRule(MatchRuleDefinition newMatchRule) {
MatchRuleDefinition oldMatchRule = matchRule;
matchRule = newMatchRule;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.TDQ_MATCH_RULE_ITEM__MATCH_RULE, oldMatchRule, matchRule));
}
use of org.talend.dataquality.rules.MatchRuleDefinition in project tmdm-studio-se by Talend.
the class AbstractDeployAction method filterMatchRuleObjs.
// remove match rule and add associated model objects
protected void filterMatchRuleObjs(List<IRepositoryViewObject> viewObjs) {
for (Object obj : viewObjs.toArray()) {
if (obj instanceof IRepositoryViewObject) {
IRepositoryViewObject viewObject = (IRepositoryViewObject) obj;
Item item = viewObject.getProperty().getItem();
if (item instanceof TDQMatchRuleItem) {
MatchRuleDefinition matchRule = ((TDQMatchRuleItem) item).getMatchRule();
String name = matchRule.getName();
if (getMapInfoService() != null) {
List<IRepositoryViewObject> dataModels = service.findReferencedDataModels(name);
viewObjs.remove(obj);
for (IRepositoryViewObject modelObj : dataModels) {
if (!viewObjs.contains(modelObj)) {
viewObjs.add(modelObj);
}
}
}
}
}
}
}
Aggregations