Scheduled jobs with input parameters in EPiServer 7.5

The other day I got a question from a collegue of mine whether or not the piece I wrote on supplying scheduled jobs with input parameters (EPiServer CMS6R2) would still work for version 7.5. I suspected it would, but since I wanted to make sure I set up two of EPiServer’s Alloy template sites; one using WebForms and the other with MVC. Tweaked source code at GitHub.

I had expected there to be slightly more work to lift this functionality to 7.5 than it actually was; mostly what I had to do was change a base classes that I was using, as well as altering namespaces. Otherwise the EPiServer’s scheduled job functionality seemed to be pretty much intact between versions; as far as this adapter is concerned.

SampleParameterJob.cs

[ScheduledPlugInWithParameters(
    DisplayName = "Sample parameter job",
    Description = "Sample job with parameters",
    DefinitionsClass = "EPiServer.Templates.Alloy .ScheduledParameterJob.ExampleJob.DefinitionSample",
    DefinitionsAssembly = "EPiServer.Templates.Alloy.Mvc"
)]
public class SampleParameterJob : ScheduledJob
{
    public static string Execute()
    {
        var descriptor = PlugInDescriptor.Load("EPiServer.Templates.Alloy .ScheduledParameterJob.ExampleJob.SampleParameterJob", "EPiServer.Templates.Alloy.Mvc");

EPiServer relies on the same code for the admin mode scheduled jobs (DatabaseJob.aspx and so on) in both the Alloy WebForms templates as well as the MVC ones, so setting up adapter mappings in your App_Browsers\AdapterMappings.browser file(s) is not a problem, as you can see in the selected DefinitionsAssembly above.

Scheduled job with input parameters in EPiServer 7.5

For further notes on usage as well as installation instructions, please also see the previous article Supplying EPiServer scheduled jobs with parameters through Admin Mode.

3 Comments

  1. Allan Thraen May 5, 2014
    • Mathias Kunto May 9, 2014
  2. Mathias Kunto September 11, 2014