Search in sources :

Example 6 with AlgorithmDefinition

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

the class MatchKeyAndSurvivorshipTableViewer method createNewSurvivorshipKeyDefinition.

private SurvivorshipKeyDefinition createNewSurvivorshipKeyDefinition(String columnName) {
    SurvivorshipKeyDefinition skd = RulesFactory.eINSTANCE.createSurvivorshipKeyDefinition();
    skd.setName(columnName);
    AlgorithmDefinition createAlgorithmDefinition = RulesFactory.eINSTANCE.createAlgorithmDefinition();
    createAlgorithmDefinition.setAlgorithmType(SurvivorShipAlgorithmEnum.getTypeByIndex(3).getComponentValueName());
    skd.setFunction(createAlgorithmDefinition);
    skd.setAllowManualResolution(true);
    return skd;
}
Also used : SurvivorshipKeyDefinition(org.talend.dataquality.rules.SurvivorshipKeyDefinition) AlgorithmDefinition(org.talend.dataquality.rules.AlgorithmDefinition)

Example 7 with AlgorithmDefinition

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

the class MatchRuleElementTreeSelectionDialog method getParticularSurvivorshipRulesFromRules.

private List<Map<String, String>> getParticularSurvivorshipRulesFromRules(MatchRuleDefinition matchRuleDefinition, boolean retrieveDisplayValue) {
    if (matchRuleDefinition != null) {
        List<Map<String, String>> ruleValues = new ArrayList<Map<String, String>>();
        for (ParticularDefaultSurvivorshipDefinitions pdsd : matchRuleDefinition.getParticularDefaultSurvivorshipDefinitions()) {
            Map<String, String> pr = new HashMap<String, String>();
            String matchedColumnName = matchExistingColumnForKey(pdsd);
            pr.put(MatchRulesTableLabelProvider.INPUT_COLUMN, matchedColumnName);
            // set survivorship function and parameter
            AlgorithmDefinition algorithmDefinition = pdsd.getFunction();
            String functionType = algorithmDefinition != null && algorithmDefinition.getAlgorithmType() != null ? algorithmDefinition.getAlgorithmType() : StringUtils.EMPTY;
            pr.put(MatchRulesTableLabelProvider.SURVIVORSHIP_FUNCTION, functionType);
            pr.put(MatchRulesTableLabelProvider.PARAMETER, algorithmDefinition != null && algorithmDefinition.getAlgorithmParameters() != null ? algorithmDefinition.getAlgorithmParameters() : StringUtils.EMPTY);
            ruleValues.add(pr);
        }
        return ruleValues;
    }
    return null;
}
Also used : ParticularDefaultSurvivorshipDefinitions(org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AlgorithmDefinition(org.talend.dataquality.rules.AlgorithmDefinition) Map(java.util.Map) HashMap(java.util.HashMap)

Example 8 with AlgorithmDefinition

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

the class MatchKeyDefinitionImpl method basicSetAlgorithm.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetAlgorithm(AlgorithmDefinition newAlgorithm, NotificationChain msgs) {
    AlgorithmDefinition oldAlgorithm = algorithm;
    algorithm = newAlgorithm;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RulesPackage.MATCH_KEY_DEFINITION__ALGORITHM, oldAlgorithm, newAlgorithm);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) AlgorithmDefinition(org.talend.dataquality.rules.AlgorithmDefinition)

Example 9 with AlgorithmDefinition

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

the class ParticularDefaultSurvivorshipDefinitionsImpl method basicSetFunction.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetFunction(AlgorithmDefinition newFunction, NotificationChain msgs) {
    AlgorithmDefinition oldFunction = function;
    function = newFunction;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RulesPackage.PARTICULAR_DEFAULT_SURVIVORSHIP_DEFINITIONS__FUNCTION, oldFunction, newFunction);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) AlgorithmDefinition(org.talend.dataquality.rules.AlgorithmDefinition)

Example 10 with AlgorithmDefinition

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

the class SurvivorshipKeyDefinitionImpl method basicSetFunction.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetFunction(AlgorithmDefinition newFunction, NotificationChain msgs) {
    AlgorithmDefinition oldFunction = function;
    function = newFunction;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RulesPackage.SURVIVORSHIP_KEY_DEFINITION__FUNCTION, oldFunction, newFunction);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) AlgorithmDefinition(org.talend.dataquality.rules.AlgorithmDefinition)

Aggregations

AlgorithmDefinition (org.talend.dataquality.rules.AlgorithmDefinition)24 ArrayList (java.util.ArrayList)7 HashMap (java.util.HashMap)7 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)7 MatchKeyDefinition (org.talend.dataquality.rules.MatchKeyDefinition)7 RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)6 MatchRule (org.talend.dataquality.rules.MatchRule)6 MatchRuleDefinition (org.talend.dataquality.rules.MatchRuleDefinition)6 Test (org.junit.Test)5 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)5 MatchGroupResultConsumer (org.talend.dataquality.record.linkage.grouping.MatchGroupResultConsumer)5 BlockKeyDefinition (org.talend.dataquality.rules.BlockKeyDefinition)5 BlockKeyIndicator (org.talend.dataquality.indicators.columnset.BlockKeyIndicator)4 SurvivorshipKeyDefinition (org.talend.dataquality.rules.SurvivorshipKeyDefinition)4 ExecuteMatchRuleHandler (org.talend.dq.analysis.match.ExecuteMatchRuleHandler)4 Map (java.util.Map)3 ParticularDefaultSurvivorshipDefinitions (org.talend.dataquality.rules.ParticularDefaultSurvivorshipDefinitions)3 DefaultSurvivorshipDefinition (org.talend.dataquality.rules.DefaultSurvivorshipDefinition)2 List (java.util.List)1 EList (org.eclipse.emf.common.util.EList)1