Developer forum

Forum » Dynamicweb 10 » Custom Source provider and conditionals

Custom Source provider and conditionals

Andrejs Zavorotnijs
Reply

Hello

 

I’ve implemented a custom source provider by inheriting from BaseProvider. Everything is working as expected except for conditionals.

  • In Dynamicweb 9, conditionals behave correctly across all destination providers — Ecom, User, and Dynamicweb.
  • In Dynamicweb 10, however, all conditionals are being ignored for the same destination providers (Ecom, User, Dynamicweb).

 

Were there any changes in the handling or architecture of conditionals between DW9 and DW10 that we are missing?


Replies

 
Frederik Nielsen Dynamicweb Employee
Frederik Nielsen
Reply
This post has been marked as an answer

Hi Andrejs,

You're right that there's an architectural change - we've removed the conditional check on all destination providers, as we think they should handle the data they receive, not filter it.
So the responsibility to check the conditionals are on the source provider. The source provider is also in a much better place to do this, as it has control over where it fetches the data, and could potentially do the filtering process in an optimized way. Additionally we're avoiding forcing multiple conditionals checks, as our providers were already doing it as a source provider.

You could simply do the mapping.Conditionals.CheckConditionals(row) check just before you send the row to the destination writer, if you want to replicate the previous behaviour.

I hope this makes sense, otherwise let me know!

 

Best regards,
Frederik Nielsen

Votes for this answer: 1
 
Andrejs Zavorotnijs
Reply

Hello Frederik

That makes perfect sense, thank you for the clear explanation and solution!

 

 

You must be logged in to post in the forum