SharePoint.NintexDeployment.Infrastructure.NWFAdapter.RetrieveContextDataMappings C# (CSharp) Method

RetrieveContextDataMappings() public method

Retrieve Context Data Mappings
public RetrieveContextDataMappings ( string mappingFileName ) : ContextItemMappingEntries
mappingFileName string
return ContextItemMappingEntries
        public ContextItemMappingEntries RetrieveContextDataMappings(string mappingFileName)
        {
            var mappingFullPath = Path.Combine(properties.Definition.RootDirectory, mappingFileName);
            return Serializer.DeserializeObject<ContextItemMappingEntries>(File.ReadAllText(mappingFullPath));
        }

Usage Example

 private void RegisterContextDataItems(SPFeatureReceiverProperties properties)
 {
     var workflowAdapter = new NWFAdapter(properties);
     var ctxItemsMappings = workflowAdapter.RetrieveContextDataMappings("ContextItemsMappings.xml");
     foreach (var mapping in ctxItemsMappings)
     {
         try
         {
             CustomCommonDataCollection.Add(mapping.TypeName, mapping.AssemblyName, mapping.DisplayName, mapping.Description, string.Empty);
         }
         catch (Exception ex)
         {
             NWLoggingService.WriteError(ex);
         }
     }
 }