/// <summary> /// Try getting a mapped value given a migration source unique Id and the value to be mapped. /// </summary> /// <param name="fromSide">Left or Right of the migration source in the session configuration</param> /// <param name="sourceFieldValue">Value before the mapping rule is applied</param> /// <param name="valueMapName"></param> /// <param name="descriptionDocRootNode">The document that contains all the field information in a particular revision</param> /// <param name="mappedValue">Value after the mapping rule is applied</param> /// <returns>True if a mapping rule is applied; FALSE otherwise</returns> private bool GetMappedFieldValue( SourceSideTypeEnum fromSide, string sourceFieldValue, string valueMapName, XmlElement descriptionDocRootNode, out string mappedValue) { TraceManager.TraceVerbose("Getting mapped field value of '{0}' in Value Map '{1}'", sourceFieldValue ?? string.Empty, valueMapName ?? string.Empty); ValueMap valueMapEntry = null; foreach (ValueMap valueMap in m_session.WITCustomSetting.ValueMaps.ValueMap) { if (valueMap.name == valueMapName) { valueMapEntry = valueMap; break; } } if (null != valueMapEntry) { TraceManager.TraceVerbose("Applying mapped field value of '{0}' in Value Map '{1}'", sourceFieldValue ?? string.Empty, valueMapName ?? string.Empty); return(valueMapEntry.TryGetMappedValue(fromSide, sourceFieldValue, descriptionDocRootNode, out mappedValue)); } else { TraceManager.TraceVerbose("Cannot find Value Map '{0}'", valueMapName ?? string.Empty); mappedValue = sourceFieldValue; return(false); } }