2

I have an issue with a custom value mapping set.

Env-nt:

  • Sitecore.NET 9.0.1 (rev. 171219)
  • Data Exchange Framework 2.0.1

Installed packages:

  1. Data Exchange Framework SDK 2.0.1
  2. Sitecore Provider for Data Exchange Framework 2.0.1(to store items in Sitecore)

My goal is to read list of entities from web service and create/update items in Sitecore. Decided to use data mapping in the code.

  1. Custom Value Mapping Set
  2. Converter
  3. Mapping Set Class
  4. Using in a Pipeline Step

I just followed the manual, but didn't configure any mappings. In addition, added couple Value Accessors(Property and Sitecore ones) which are used to specify the unique field/property in "Resolve Product Item Step".

I received following messages when I tried to run Pipeline Batch(manually). I receive the same error for each entity(I have 5 ones). I can reach constructor of the converter in the debug mode, but I can't reach the constructor of a mapping set.

Will appreciate any help. Thanks in advance.

  • Does "SupportedId" (point 2) correspond item template ID of "Product Value Mapping Set" (point 1) ? – Vlad Shpak May 4 '18 at 10:18
  • Hi Vlad. Yep, it corresponds screencast.com/t/r4KjWUgs. Otherwise, I think, I couldn't reach the breakpoint in the Converter. – Max May 4 '18 at 10:39
  • 1
    Just for the test. Can you change (point 2) BaseItemModelConverter<ProductValueMappingSet> to BaseItemModelConverter<IMappingSet>? – Vlad Shpak May 4 '18 at 10:46
  • Hm, it seems it helped, at least I have another error atm. screencast.com/t/qfoWlFMm Also, I changed not only the base class declaration: screencast.com/t/ntAnGUmVfXLE I wonder what should we have instead of Not Implemented collection? public ICollection<IMapping> Mappings => throw new NotImplementedException(); I just used the provided example. – Max May 4 '18 at 11:09
  • 1
    In (point 3) you have Mappings => throw new NotImplementedException() but in (point 4) "ApplyMappingStepProcessor" checks if "Mappings == null" and writes the error to the log. Try set empty collection. – Vlad Shpak May 4 '18 at 11:33
1

Vlad Shpak helped me to solve the issue.

Following was changed in the example(from the documentation)

  1. Converter was changed
  2. Initialization of Mappings property in class which implements IMappingSet:

    public ICollection<IMapping> Mappings => new List<IMapping>();
    
  3. Decided to use SitecoreItemFieldWriter(Sitecore.DataExchange.Providers.Sc.DataAccess.Writers) instead of PropertyValueWriter.

    private static IValueWriter valueWriter1 = new SitecoreItemFieldWriter("ID");
    private static IValueWriter valueWriter2 = new SitecoreItemFieldWriter("Title");
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.