System - Scheduled tasks

From Cyclos Wiki
Jump to navigation Jump to search

Related sub-modules

System - Scripts

Description

Custom scheduled tasks can be programmed to run periodically. They have a script which is used to perform the main logic. Each execution will generate a log, which can be searched on the Logs tab in the Details page.

Each execution returns a log message, which is stored on the log when the execution succeeds. That message is visible in the logs tab.

Business rules

  • Every time a task is modified or executed, the next execution date must be re-calculated.
  • The expected execution date is not realtime-precise. For example, if the expected execution is at 2014-06-01 05:00, it will run after that time, but normally would run before 2014-06-01 06:00

Notifications

N/a.

Page: List page

Security

Roles:

  • administrator

View permission:

Other permissions:

Page sections

Search result (list *)

  • Automatically shows all custom scheduled tasks,. sorted by name.
Fields Type Rules
Name Text The custom operation name
  • When the operation is disabled, show as strikethrough
Last status Text The status of the last execution, or 'Never ran' if didn't execute yet
Next execution Text The date of the next expected execution
Remove Icon If confirming, removes the custom operation



Page: Details page

Tabs:

  • Details
  • Log

Security

Roles:

  • administrator

View permission:

Other permissions:

Page sections

Details page

Fields Type Rules
Name Text field The scheduled task name
  • Required
  • Unique
Description Text area Optional description (only shown in this page)
Enabled Checkbox Indicates whether this operation is enabled for use
Script Single selection Defines which script runs when this custom operation is executed
  • Required
  • Should show all scripts with type = Scheduled task
Script parameters Text area Parameters passed to the script, with the same format as Java Properties
Recurrence Time interval Determines the task recurrence interval.
  • Required
  • Allows picking from hours to months
Day Single selection Determines the day the task will run
  • Hidden when interval of hours or days
  • The options will be the days (from 1 to 28) if the recurrence interval is months
  • The options will be week days if the recurrence interval is weeks
  • Required
Hour Single selection Determines the hour of day the task will run
  • Hidden when the recurrence interval is hours
  • Required


Log tab

Shows the log for previous executions of the task

Search page (filters)

Fields Type Rules
Date Date period Filters logs by date period
Status Multi selection Filters logs by status


Search result (list *)

  • Automatically shows all logs, sorted by date descending
Fields Type Rules
Date Text The date the task started running
Status Text The log status. Can be either:
  • Running
  • Success
  • Error
Time taken Text The amount of time the execution took to complete.
  • Formatted like 4h 30m 20s
  • Only visible if the status is Success
Result Text or link Depends on the status
  • If the status is Success, shows the log message, as returned by the script
  • If the status is Error, shows a link which, when clicked, shows the error stack trace in a popup