You are viewing the documentation for Blueriq 16. Documentation for other versions is available in our documentation directory.

Overview

Migration is relevant only if the Advanced Scheduler is enabled.

Once the Advanced Scheduler is enabled we have to make sure that the already created timer node, expiring tasks, task with priority algorithms and the pending automatic tasks still behave correctly.

We provide a Migration Rest API which is responsible for creating and scheduling a quartz job for each of these task. The main functionality of these endpoints is to read information from tasks table, blueriq database and insert new job details along with triggers in quartz tables.

The Migration API uses OAuth2 for authorization. Only users with certain permissions can use these endpoints. An authentication token must be issued before executing the calls. The token should be sent in the header of the calls in order to authorize the requests. See the Preconditions sections for more details.

The Migration API is configurable via a setting. In configuration files, you can specify to enable or disable the migration endpoints. See the Preconditions sections for more details.

API Description

The following endpoints are available:

The endpoint are disabled by default. See the Preconditions sections for more details.

 

Timer Nodes Endpoint

POST http://[host]:[port]/[runtime]/api/v1/scheduler/migration/timerNodes
  • Finds all open or started tasks, with task type 'WAIT' within all process engines.
  • Schedules a quartz job which fires at the task's start time.
  • A new row is inserted in quartz database in qrtz_job_details, qrtz_simple_triggers and qrtz_triggers tables.

Expiring Nodes Endpoint

POST http://[host]:[port]/[runtime]/api/v1/scheduler/migration/expiringNodes
  • Finds all open or started tasks within all process engines, with the timeout date greater than today.
  • Schedules a quartz job which fires at the task's timeout date.
  • A new row is inserted in the quartz database, in qrtz_job_details, qrtz_simple_triggers and qrtz_triggers tables.

Priority Nodes Endpoint

POST http://[host]:[port]/[runtime]/api/v1/scheduler/migration/priorityNodes
  • Finds all open or started tasks within all process engines.
  • Extracts the tasks which have a priority algorithm with a reevaluation time other than NEVER.
  • Schedules a quartz job which fires periodically at the priority algorithm's reevaluation time.
  • A new row is inserted in the quartz database, in qrtz_job_details, qrtz_cron_triggers and qrtz_triggers tables.

Pending Automatic Tasks Endpoint

POST http://[host]:[port]/[runtime]/api/v1/scheduler/migration/automaticTasksRecovery
  • Finds all open or started tasks within all process engines.
  • Extracts the tasks which are defined as 'Automatic'.
  • Schedules a quartz job which fires in the next minute.
  • A new row is inserted in the quartz database, in qrtz_job_details, qrtz_simple_triggers and qrtz_triggers tables.

Preconditions

Scheduler Quartz Component installation and configuration steps have to be done. More information can be found here.

  1. The user who executes the call needs to have one of the following permissions:  SCHEDULER_MANAGER.
  2. The REST API oauth2.client and oauth2.secret have to be defined in aquima.properties.
  3. Swagger should be used for token generation and rest call execution.
  4. Add the following line in your application.properties file: blueriq.scheduler-quartz.enable-task-migration=true in order to enable the migration endpoints.
  5. We advise you to not close the client connection, in order to see the response feedback of the operations in the end.
  6. This API should be executed only once. In case of multiple executions, the already created quartz jobs will be overridden with new ones.
  7. After starting the migration,the runtime logs can be checked to verify that everything runs correctly. To see the information about migration configure the logs to be on DEBUG level. Do this by adding the following line to application.properties file: logging.level.com.blueriq.component.scheduler.quartz=DEBUG.

Usage

  1. Access http://{server}:{port}/{runtime}/api/v1/docs/index.html .
  2. Fill the user and the password in order to obtain authentication token. 
  3. Expand the nodes endpoint, and after that the corresponding migration endpoint you wish to proceed with.
  4. Click on 'Try it out!'.
  5. If everything works, a 200 http status is received, otherwise an error message with the root cause is displayed.

 

Table of Contents

 


  • No labels