use of org.talend.designer.core.model.utils.emf.talendfile.impl.ProcessTypeImpl in project tdi-studio-se by Talend.
the class ExportJobUtil method getJobContexts.
/**
*
* Gets the set of current job's context.
*
* @return a List of context names.
*
*/
public static List<String> getJobContexts(ProcessItem processItem) {
List<String> contextNameList = new ArrayList<String>();
for (Object o : ((ProcessTypeImpl) processItem.getProcess()).getContext()) {
if (o instanceof ContextType) {
ContextType context = (ContextType) o;
if (contextNameList.contains(context.getName())) {
continue;
}
contextNameList.add(context.getName());
}
}
return contextNameList;
}
use of org.talend.designer.core.model.utils.emf.talendfile.impl.ProcessTypeImpl in project tdi-studio-se by Talend.
the class JobJavaScriptsManager method getJobContextsComboValue.
@Override
public List<String> getJobContextsComboValue(ProcessItem processItem) {
List<String> contextNameList = new ArrayList<String>();
for (Object o : ((ProcessTypeImpl) processItem.getProcess()).getContext()) {
if (o instanceof ContextType) {
ContextType context = (ContextType) o;
if (contextNameList.contains(context.getName())) {
continue;
}
contextNameList.add(context.getName());
}
}
return contextNameList;
}
use of org.talend.designer.core.model.utils.emf.talendfile.impl.ProcessTypeImpl in project tdi-studio-se by Talend.
the class ExportJobUtil method getJobContextValues.
/**
* DOC zli Comment method "getJobContextValues".
*
* @param processItem
* @param contextName
* @return
*/
@SuppressWarnings("rawtypes")
public static List<ContextParameterType> getJobContextValues(ProcessItem processItem, String contextName) {
if (contextName == null) {
return null;
}
// else do next line
List<ContextParameterType> list = new ArrayList<ContextParameterType>();
EList contexts = ((ProcessTypeImpl) processItem.getProcess()).getContext();
for (int i = 0; i < contexts.size(); i++) {
Object object = contexts.get(i);
if (object instanceof ContextType) {
ContextType contextType = (ContextType) object;
if (contextName.equals(contextType.getName())) {
EList contextParameter = contextType.getContextParameter();
for (int j = 0; j < contextParameter.size(); j++) {
Object object2 = contextParameter.get(j);
if (object2 instanceof ContextParameterType) {
ContextParameterType contextParameterType = (ContextParameterType) object2;
list.add(contextParameterType);
}
}
return list;
}
}
}
return null;
}
Aggregations