Chapter 11. DotNetNuke Scheduled Tasks

In addition to the standard module development tasks and processes, DotNetNuke provides a scheduling engine that you can use to execute tasks at a specific interval. For example, you might use DotNetNuke scheduled tasks to clean up the site log or to re-index the search index for site search. Third-party modules (such as forum modules) use scheduled tasks to process e-mail from queues, rather than from inside the application process.

Although there is no relevant scheduled task item for this book's sample Guestbook module, this chapter introduces you nonetheless to the concept of DotNetNuke scheduled tasks. The chapter begins with an overview of the scheduled task system, including important points to consider to ensure that code written as tasks can execute as desired. You will also examine a sample written in both C# and VB code that demonstrates processing for scheduled tasks. The chapter concludes with an overview of installation procedures, schedule options, and the process to check on task success or failure.

Scheduling System Overview

DotNetNuke provides a scheduling system that can execute any code that uses the SchedulerClient base class provided by the DotNetNuke framework. This class contains two methods that must be defined in each implementation.

The first method is a constructor that accepts a ScheduleHistoryItem parameter. This parameter (passed by the core) is used to mark success and failure. In addition, it exposes a method for ...

Get Professional DotNetNuke® Module Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.