if (targetDe == null || targetDe.length() == 0) {
Alert.error(this, "The selected target node cannot be mapped to.", "Illegal Mapping");
return;
}
String sourceExpr = "";
NodeMapping existingMapping = mappingManager.findMapping(targetDe);
if (existingMapping != null) {
sourceExpr = existingMapping.getExpression();
}
if (m_sourceTreeComponent.m_highLightedNode != null && sourceExpr == "") {
Node source = m_sourceTreeComponent.m_highLightedNode;
if (!isValidSourceNodeForMapping(target, source)) {
return;
}
if (targetDe.length() == 0) {
Alert.error(this, "This target data element cannot be mapped.", "Illegal Mapping");
return;
}
if (source.isFolder()) {
showFormula("", targetDe, existingMapping, result);
return;
}
NodeMapping newMapping = addMappingImpl(source, target);
if (showFormulaBuilder) {
showFormula(sourceExpr, targetDe, newMapping, result);
}
} else {
showFormula(sourceExpr, targetDe, existingMapping, result);