Scheduled Jobs with Sitecore Experience Extractor

Note: Experience Extractor requires direct access to Mongo DB and Sitecore’s item database, and is currently not compatible with Sitecore xDB Cloud Service.

In my previous post I gave an Introduction to Sitecore Experience Extractor. This post builds upon that and introduces the scheduled jobs functionality available in Experience Extractor.

Scheduled jobs with Experience Extractor allow you to set up recurring tasks that run a job at a specified time interval. The idea is that the data exported via the scheduled jobs will be consumed by other tools. The scheduled job helps ensure that the consumed data is fresh and up to date. Experience Extractor can export data in a couple different ways so the data can be read by external tools in the form of a CSV formatted file or directly from a database (mssql or msaccess).

Setting Up a Scheduled Job

After installing the Experience Extractor module, a new “Experience Extractor” node will be created with a “Scheduled jobs” child node in the Marketing Control Panel. You can add scheduled jobs in this location in the content tree or a different location if needed since the root node can be modified in the ExperienceExtractor.config file.

scheduled_job_item

The job specification to be run should be added to the “Specification” field on the scheduled job item. This job specification should be in JSON format and you should test it to make sure it will run correctly without errors. You can test the JSON and find an example via the following URL in your Sitecore solution: /sitecore/admin/experienceextractor/shell.aspx.

The “Update Interval” field should be set to the recurring time interval that defines how often the job is run and the data is updated. Note that there is also a “ExperienceExtractor.Scheduling.JobUpdateAgent” setting in the ExperienceExtractor.config file that is set to one minute intervals by default. The update interval you enter should be a larger value than this setting.

The “Type” field gave me a lot of problems since I had no idea what to enter and it would not allow an empty field. After taking a peek at the code, it appears that you need to enter “direct” into the “Type” field. I believe this is the only option at the moment and could maybe be expanded when Experience Extractor supports Sitecore’s xDB Cloud Service (At least that’s my best guess).

So there you have it – sit back and wait for your scheduled job to be executed and keep an eye on the Sitecore log files to get more information about any errors.

If a scheduled job is successful, the “Last success” field on the scheduled job item will be populated. If an error occurs during the scheduled job it will likely appear in the log file in the following format (exact error will differ but prepended with “Experience Extractor -“):

ManagedPoolThread #6 11:00:14 ERROR Experience Extractor - Invalid spec for scheduled job Test Scheduled Job. (No job loader factory is registered for '')

One last note – I came across an issue where the MSSQL database defined in the post-processing step will not be automatically created for you if it does not already exist when using a scheduled job. This is strange because a MSSQL database is automatically created if necessary if you run the same job from the user interface in Sitecore or from the /sitecore/admin/experienceextractor/shell.aspx page. Just run the job once from either of those locations before testing the scheduled job.

Advertisements
Posted in Sitecore

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s