Search in sources :

Example 1 with UpdateLookupColumnConversion

use of org.talend.core.model.components.conversions.UpdateLookupColumnConversion in project tdi-studio-se by Talend.

the class UpdateLookupColumnMigrationTask method execute.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.core.model.migration.AbstractJobMigrationTask#executeOnProcess(org.talend.core.model.properties.ProcessItem)
     */
@Override
public ExecutionResult execute(Item item) {
    ProcessType processType = getProcessType(item);
    if (processType == null) {
        return ExecutionResult.NOTHING_TO_DO;
    }
    // TODO Auto-generated method stub
    try {
        // 1.tFuzzyMatch:
        //$NON-NLS-1$
        IComponentFilter filter1 = new NameComponentFilter("tFuzzyMatch");
        //$NON-NLS-1$
        IComponentConversion lookupProperty = new UpdateLookupColumnConversion("LOOKUP_COLUMN");
        ModifyComponentsAction.searchAndModify(item, processType, filter1, Arrays.<IComponentConversion>asList(lookupProperty));
        // 2.tIntervalMatch
        //$NON-NLS-1$
        IComponentFilter filter2 = new NameComponentFilter("tIntervalMatch");
        ModifyComponentsAction.searchAndModify(item, processType, filter2, Arrays.<IComponentConversion>asList(lookupProperty));
        return ExecutionResult.SUCCESS_NO_ALERT;
    } catch (Exception e) {
        ExceptionHandler.process(e);
        return ExecutionResult.FAILURE;
    }
}
Also used : ProcessType(org.talend.designer.core.model.utils.emf.talendfile.ProcessType) IComponentFilter(org.talend.core.model.components.filters.IComponentFilter) NameComponentFilter(org.talend.core.model.components.filters.NameComponentFilter) UpdateLookupColumnConversion(org.talend.core.model.components.conversions.UpdateLookupColumnConversion) IComponentConversion(org.talend.core.model.components.conversions.IComponentConversion)

Aggregations

IComponentConversion (org.talend.core.model.components.conversions.IComponentConversion)1 UpdateLookupColumnConversion (org.talend.core.model.components.conversions.UpdateLookupColumnConversion)1 IComponentFilter (org.talend.core.model.components.filters.IComponentFilter)1 NameComponentFilter (org.talend.core.model.components.filters.NameComponentFilter)1 ProcessType (org.talend.designer.core.model.utils.emf.talendfile.ProcessType)1