Posted on 25/08/2015 12:09:34
Hi Lars,
I'm not sure what you would want to do in a notification subscriber that is fired before an export is done. Can you give an example?
we already have a notification for when a an export activity is finished (I've included the example code from our visual studio templates below)
If you specifically need to do something after an export is done, but before the data is moved to an external system, when using the Data Integration Framework, I recommend doing so in a custom scheduled task instead - that way, you know you are "interrupting" the data flow in the place you need to.
example code for the scheduled tasks can also be found in the visual studio templates - if you need the code for one of the default scheduled tasks, and it isn't there, please let me know, and I'll make it available.
Regards, Jonas
Example code for notification subscriber:
public class JobFinishedObserver : Dynamicweb.Extensibility.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
{
Dynamicweb.Notifications.Integration.JobFinishedIntegrationArgs integrationArgs = args as Dynamicweb.Notifications.Integration.JobFinishedIntegrationArgs;
//TODO: Add code here
//Sample code:
//If the job finished successfully
if (!integrationArgs.JobFailed)
{
//Clear language cache if the import was to Languaguages table
if (integrationArgs.DestinationTables.Contains("EcomLanguages"))
{
Dynamicweb.eCommerce.International.Language.ClearLanguageCache();
}
}
}
}