Search in sources :

Example 1 with RoutineItemRecord

use of org.talend.designer.core.ui.routine.RoutineItemRecord in project tdi-studio-se by Talend.

the class SetupProcessDependenciesRoutinesAction method createRoutinesDependencies.

private void createRoutinesDependencies(ProcessType process, List<RoutineItemRecord> routineRecords) {
    if (routineRecords == null) {
        return;
    }
    for (RoutineItemRecord r : routineRecords) {
        List<RoutinesParameterType> routinesDependencies = process.getParameters().getRoutinesParameter();
        boolean found = false;
        for (RoutinesParameterType type : routinesDependencies) {
            // if (r.isSystem() == type.isSystem()) {
            if (type.getId().equals(r.getId()) || type.getName().equals(r.getName())) {
                found = true;
                break;
            }
        // }
        }
        if (!found) {
            RoutinesParameterType itemRecordType = TalendFileFactory.eINSTANCE.createRoutinesParameterType();
            itemRecordType.setName(r.getName());
            itemRecordType.setId(r.getId());
            process.getParameters().getRoutinesParameter().add(itemRecordType);
        }
    }
}
Also used : RoutineItemRecord(org.talend.designer.core.ui.routine.RoutineItemRecord) RoutinesParameterType(org.talend.designer.core.model.utils.emf.talendfile.RoutinesParameterType)

Aggregations

RoutinesParameterType (org.talend.designer.core.model.utils.emf.talendfile.RoutinesParameterType)1 RoutineItemRecord (org.talend.designer.core.ui.routine.RoutineItemRecord)1