Scheduled Tasks

The ToDo Pier app has a dependency on Sean DeNigris's Scheduler so that it can run tasks at specific times. This is done by:

  1. first creating a normal task, and adding reformatted code to execute, such as:

    (PRScheduledTaskExamples newForKernelNamed: 'Pier') reportOfHistoryOnPageAt: '/John Borden/Todo/Add a History Report/Report'

  2. Create the report page (in this example /John Borden/Todo/Add a History Report/Report). This can be an empty page.
  3. In the Pharo image, execute:

    (PRPathLookup start: (PRKernel instanceNamed: 'Pier') root path: '/John Borden/Todo/Add a History Report') automate.

    This will change the task to be marked as completed and hidden from the menus. If the task was given a repeat duration, it will execute the above code with that frequency.

Once several tasks are automated like this, it is valuable to add a report of tasks, such as:

Runs every 5 hours:

Report generated on 2 March 2021 18:59

Task NameNext RunRun Count
Find Broken LinksMar-03184
Add a History ReportMar-02 5:59 pm874
Update Overdue Repeating TasksMar-03184
Add a Scheduler ReportMar-02 6:59 pm870
Update Tasks for RainMar-02 5:59 pm728

(PRScheduledTaskExamples newForKernelNamed: 'Pier') reportOfSchedulerAt: '/John Borden/Todo' onPageAt: '/John Borden/Todo/Add a Scheduler Report/report'