Scheduler 2.0 API REST

<< Click to Display Table of Contents >>

Navigation:  Automation Server > Automation Server configuration and administration guide > System maintenance and monitoring > Environment settings and administration > Management Console > Scheduled jobs administration > Scheduler 2.0 >

Scheduler 2.0 API REST

Overview

Scheduler 2.0 offers an API REST where you can manage maintenance tasks. For example, if you need to change the hour of a maintenance task, or disable them. This section explains the operations that you can execute through the Scheduler API REST.

 

Before You Start

Make sure that you have upgraded your Scheduler to version 2.0. Refer to Scheduler 2.0.

This API REST uses Bizagi's OAuth authentication. Therefore, you need to define the OAuth credentials and get an authentication token. Refer to Bizagi API authentication.

This API is intended for maintenance tasks. Other tasks executed by the scheduler like timers or custom jobs can be managed in the Management Console.

 

Make sure that you configure the following:

Allowed Scope: API

Grant Type: If you are going to use Postman as your client to invoke the Scheduler API, we recommend using Client Credentials associated with the admon user.

 

Scheduler 2.0 API properties

Bizagi executes tasks that help to do maintenance to some tables of the database and keep the performance, and other system tasks like user synchronizations with LDAP or parameter entities replication. By default, these tasks have some recurrence and time defined. The following section describes the tasks and how you can manage them using the API methods.

 

Type of Maintenance Tasks

The following tasks can be managed using this API:

 

Task Name

Type Number

Description

Frequency (recurrence) by default

Start Time by Default

LDAPSynch

1

User synchronization using LDAP. Refer to Importing LDAP users.

Daily

As set in your LDAP synchronization configuration.

Replication

2

Replication of parameter entities. Refer to Data Replication.

As set in the replication schema.

As set in the replication schema.

Clean WFE Data

3

This task cleans cases marked as closed and activities from the table that stores cases' information.

Daily

22:00

DataStore

5

For on-premises projects, you can configure an Operational Data Store (ODS), where Bizagi can use a replica of your database for your reports. Refer to Setting up a Bizagi ODS.
 
*This option does not apply to Automation Service projects.

Daily

22:00

Delete Case Resources

6

When users leave comments or upload files in the case folder, they can delete these files or comments at any time. When deleted, Bizagi marks them to be deleted, and this maintenance task deletes the comment or file later.

Daily

22:00

StartCases

7

Jobs associated with Timer Start events in processes, to start cases automatically.

As defined in the Start Event.

As defined in the Start Event.

Email Browser

8

This task is executed when the Scheduler looks for new emails received in the inbox configure for complete tasks via email.

Every minute

N/A

Move Closed Cases

16

This task cleans closed cases from the table that stores cases' information. It must be executed only if the Clean WFE data task was not enough to clean all cases.

Not enabled by default

Not enabled by default

CleanOperationalTables

17

Clean all the temporal tables that are not being used in the database.

Hour

00:00

CleanCatalogTables

18

All objects of a Bizagi project, like tasks, entities, attributes, alarms, are described in the catalog. The catalog contains the metadata and properties of those objects. If an object is deleted, the catalog must be updated. This task cleans the catalog when an object is deleted.

Daily

22:00

 

The following are methods associated with maintenance tasks.

 

Get Status of Maintenance Tasks

URL: [Project URL]/api/GetAllMaintenanceTask

Invocation method: GET

Authorization: Bearer [TOKEN]

Content-type: application/json

Body: N/A

 

The method returns a JSON with the information of all Maintenance Tasks. For each task, Bizagi shows the following information:

 

jobGuid: Scheduler task identifier

Name: Name of the scheduler task

Description: Applies for replication jobs. Displays the description registered in the replication configuration.

Enabled: True or False, depending on whether the job is enabled or not.

Type: Task Type number of the task. Refer to types of tasks.

Scheduling: This is the JSON format that holds the scheduling information for each task. The format can be different depending on the maintenance task. You can use the same JSON structure if you need to update the task information using the next method.

 

Example

In the following example, Postman client is used to execute the method.

 

Scheduler2_7

 

Update a Maintenance Task

This method can be used to change the properties of a maintenance task, as the execution time, recurrence, and others.

URL: [Project URL]/api/BackgroundJob/UpdateMaintenanceTask

Invocation method: POST

Authorization: Bearer [TOKEN]

Content-type: application/json

Body: JSON

 

The method let you perform the following actions:

 

Enable /disable a maintenance task

Re-schedule a maintenance task

Change the operation mode (only applies to the Clean WDE Data task)

 

JSON for each Action

To execute any of the actions you need the following JSON structure in the body of the method invocation:

 

To Enable/ Disable the task

{ "type": 3, "enabled": false }

 

Where:

Type: Is the Type Number of the task described in the previous table.

Enabled: True or false.

 

To Reschedule  or change the frequency of the task

{ "type": 3, "scheduling": "{\"recurring\":true,\"enabled\":true,\"startHour\":\"22:00\",\"endHour\":\"23:00\",\"frequency\":{\"type\":\"Daily\",\"recurrence\":1}}" }

 

Where

Type: Is the Type Number of the task described in the previous table.

Recurring: True or false, depending on you want to set the task as a repetitive (recurrent) job.

Enabled: True or false depending on you want to activate or deactivate the task.

startHour: the time when the job starts (24H format). If the task is recurrent, for example, daily, it is the time the job is executed every day.

endHour; Time when the task must be forced to end  (24H format).

Frequency - Type: This can be Monthly, Weekly, Daily, Hours, or Minutes.

Frequency -Recurrence: Depending on the frequency type, is how often the task is repeated.

 

Change the operation mode (only for the Clean WFE Data)

{ "type": 3, "OperationMode" 2 }

 

Where:

Type; must be always 3 for this action.

OperationMode: 0 = None, 1 = DownTime, 2 = Online.

 

The Clean WFE Data task can be executed in three modes:

 

No mode

Downtime: When the maintenance window is activated so Bizagi can clean the tables in low usage peaks, By default it is configured using this mode, at 22 hours every day.

Online: This mode lets Bizagi clean the table immediately after a task or a case is closed. This mode must be used with extreme precaution because it can affect the performance of the Scheduler and database. It is advisable to analyze the best scenario before changing the execution mode of the Clean WFE Data task.  

 

To change the LDAP synchronization hour

{ "type": 1, "enabled": true, "scheduling": "{\"syncHour\":14}" }

 

Type: Is the Type Number of the task described in the previous table.  For the LDAP synchronization, this value must be always 1.

Enabled: True or false.

Scheduling - SyncHour: This is the day time when the synchronization is triggered on a daily basis. This value uses a military format. For example, 14 is 2 pm.

 

Example

In the following example, we are using Postman to execute the method and rescheduled the task "Clean WFE Data" is to be started 23:00 and repeated twice a day:

 

Scheduler2_6