Scheduler Plugin

Introduction

The Scheduler Plugin allows you to schedule tasks to run automatically in your Joget application at a specific date and time. You can use this plugin to trigger any process tools (except the Form Data Update Tool, which only runs in a process flow).

For example, you can configure the Scheduler Plugin to call a JSON POST API to start a process every day at 8:00 am throughout September. This process could be set to update database records and send email notifications.

The Scheduler Plugin uses Java Cron Expressions to define when tasks will run. A Cron Expression is a string made up of six or seven parts that specify the timing details. These fields, separated by spaces, contain values and characters that tell the system when the task should be executed. Only future dates are allowed when using cron expressions.

You can access the source code for this plugin at JogetOSS's open-source repository. JogetOSS is a community-led initiative for developing open-source tools for the Joget no-code/low-code platform. You are welcome to contribute to these projects.

Plugin information

  • Plugin Name: Scheduler Plugin
  • Joget DX Compatibility: Joget DX 7.0.7 and onwards

This plugin is not compatible with Joget Cloud and was designed to work only in Joget On-Premise.

Get started

Where to get the plugin

How to install the plugin

  1. Download the plugin JAR file from the releases page.
  2. Go to Settings > Manage Plugins > Upload Plugin.
  3.  You can import the demo app or create the app from scratch.

How to use it 

  1. To access the Scheduler menu in your app, add a Scheduler menu inside your UI.
  2. Publish and run the UI.
  3. Access the Scheduler Menu and create a new task.
  4. In this example, you will create a task that adds a new record daily at 00:00.

Configure scheduler menu properties

Fields to configure:

  • Job Name: The label for the scheduled job.
  • Cron Expression: A string comprising five or six fields separated by white space representing a set of times, generally as a schedule to execute some routine.
You can find Cron Expression Generator online. One such example is this
  • App: The selected app for the task.
  • Plugin: Select from a list of tools to schedule:
    • BeanShell
    • Counter Increment
    • SQL Query
    • Email
    • Export Form Email
    • File Add Image Tool
    • Update Form Date

    and many more.

Exporting scheduler data

when you export an app, it will not include the scheduler records by default, so you will have to handle this separately. To ensure that your scheduled job configurations are successfully promoted across environments, you will need to perform a manual data export and import of the Scheduler data records, specifically for the sch_job_def table, which stores the Scheduler job definitions.

Here is how you can do it:

  1. Export the Scheduler Data:
    • Use a database utility like SQLyog (for MySQL/MariaDB) or any other SQL client to connect to your Joget development environment's database.
    • Export the contents of the sch_job_def table into a .sql file.
  2. Import the Scheduler Data:
    • Connect to your test environment’s database using the same SQL client.
    • Import the .sql file into the test environment's database, ensuring that the sch_job_def table is populated with the necessary job configurations.
  3. Edit and Start Scheduler Jobs:
    • After importing the application and the sch_job_def database records into your Joget test environment, go to the userview where the Scheduler is configured.
    • Click to edit each scheduled job record to ensure the settings are correct, and then start the scheduler jobs as needed.

This process should successfully transfer your scheduled job configurations from the development environment to the test environment.

Expected outcome

Create scheduled tasks through the UI menu in Joget.

Related documentation

Download plugin

Download demo app

Download the demo app for Scheduler Plugin:
Created by Julieth Last modified by Aadrian on Nov 25, 2024