Developer forum

Forum » Feature requests » Notification before export and after import

Notification before export and after import

Lars Larsen
Reply

Hi,

At the moment it's possible to manipulate the data file that is either imported or exported by a XSLT script that is attached to a Data Integration Activity. But it would be nice if there was a notfication from the Integration Framework before export and after import of a data file. In that way it would be possible to manipulate the data file with .Net code before it is imported into Dynamicweb or before it is exported to another system.


Replies

 
Jonas Krarup Dam
Reply
This post has been marked as an answer

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();
                }
            }
        }
    }
Votes for this answer: 1
 
Lars Larsen
Reply

Hi Jonas

Your'e right about using a custom scheduled task. That's exactly what I can do. Thanks.