Documentation Home

Historical Order Purging

A historical purge process has been added as of Enterprise 4.2.6-GA (6.1.6-GA core). This new process will purge (delete) submitted orders and associated data that is older than a specified date.

As with other background jobs, this process is designed to be initiated by a Scheduled Job. The below SQL statements is an example of entries that can be added to the BLC_SCHED_JOB and BLC_SCHED_JOB_DETAIL tables. These entries will configure the job to run hourly at the 30 minute mark. The settings will purge any orders older than 6 years. The time period is determined by comparing the date in the SUBMIT_DATE column of BLC_ORDER table to the job parameter that configures "days old." The OLDER_THAN_DAYS and frequency that the job runs (cron expression) can be adjusted from the admin console

Configuration

In order to prevent unintentional purging, there is additional property to enable the purge. By default this is set to false and needs to be set to true.

enable.purge.order.history=true

Here is MySQL example to setup the scheduled job with this order purge

-- setup the job
INSERT INTO BLC_SCHED_JOB (SCHED_JOB_ID, TYPE, NAME, ENABLED, DATE_UPDATED, CRON_EXPRESSION, MANAGE_IN_ADMIN) VALUES (-125, 'ORDER_HISTORY_PURGE', 'Order History Purge', FALSE, CURRENT_TIMESTAMP, '0 30/59 * * * ?', TRUE);
-- parameters for the job
INSERT INTO BLC_SCHED_JOB_DETAIL (SCHED_JOB_DETAIL_ID, SCHED_JOB_ID, NAME, FRIENDLY_NAME, VALUE) VALUES (-125, -125, 'OLDER_THAN_DAYS', 'Delete orders older than a 6 years', '2190');
INSERT INTO BLC_SCHED_JOB_DETAIL (SCHED_JOB_DETAIL_ID, SCHED_JOB_ID, NAME, FRIENDLY_NAME, VALUE) VALUES (-126, -125, 'BATCH_SIZE', 'Delete orders batch size', '100');
-- declare the enum (required)
INSERT INTO BLC_DATA_DRVN_ENUM_VAL (ENUM_VAL_ID, ENUM_TYPE, ENUM_KEY, DISPLAY, HIDDEN) VALUES (-35006, -35000, 'ORDER_HISTORY_PURGE', 'Order History Purge', false);