2.1 to 2.2 Migration
This module requires at least Broadleaf 5.2.0-GA
What's changed?
- Support for maintaining scheduled jobs through the Admin interface
- Updated domain for
BLC_SCHED_JOB
,BLC_SCHED_JOB_DETAIL
,BLC_SCHED_JOB_DETAIL_VAL
, andBLC_SYSTEM_EVENT
- New Admin permissions and section to control access to Scheduled Jobs through the Admin interface
- Moved
blEventPU
configuration to the Process module and introduced a dependency on the module - Added support for Process-Aware System Events and Scheduled Jobs
Migration
pom.xml Updates
In your application's pom.xml, change the version for broadleaf-jobs-events
to 2.2.0-GA
Domain Updates
BLC_SCHED_JOB
MANAGE_IN_ADMIN
(Boolean)- Default value:
FALSE
- Default value:
ARCHIVED
(Character)ADMIN_ADDITION_STATUS
(String)
BLC_SCHED_JOB_DETAIL
ARCHIVED
(Character)
BLC_SCHED_JOB_DETAIL_VAL
ARCHIVED
(Character)
BLC_SYSTEM_EVENT
PROCESS_ID
(Long)- Renamed
PROCESS_MARKER
(Long) toPROCESS_STATUS_MARKER
(Long)
Update Script
You can run the following script AT YOUR OWN RISK to update your tables.
alter table BLC_SCHED_JOB add column MANAGE_IN_ADMIN TINYINT;
alter table BLC_SCHED_JOB add column ARCHIVED CHAR;
alter table BLC_SCHED_JOB add column ADMIN_ADDITION_STATUS VARCHAR;
alter table BLC_SCHED_JOB_DETAIL add column ARCHIVED CHAR;
alter table BLC_SCHED_JOB_DETAIL_VAL add column ARCHIVED CHAR;
alter table BLC_SYSTEM_EVENT add column PROCESS_ID BIGINT;
alter table BLC_SYSTEM_EVENT change column PROCESS_MARKER PROCESS_STATUS_MARKER BIGINT;
New Admin Permission Data (Optional)
If you wish to expose Scheduled Jobs in the Admin interface, then the load_jobsevents_admin_security.sql
script should be executed in one of the following ways:
Note: this SQL scrip assumes that the Process module's permissions and admin module already exist in the database.
If you are creating the database using
blPU.hibernate.hbm2ddl.auto=create
and theblPU.hibernate.hbm2ddl.import_files
list to include this data, then you must ensure that you have setimport.sql.enabled=true
anddemo.import.sql.enabled=true
as well.If you wish to run the script manually, here it is:
-- Scheduled Jobs
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-35000,'Read Scheduled Jobs','PERMISSION_READ_SCHEDULED_JOB', 'READ', FALSE);
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-35001,'All Scheduled Jobs','PERMISSION_ALL_SCHEDULED_JOB', 'ALL', FALSE);
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (-35000, 'com.broadleafcommerce.jobsevents.domain.ScheduledJob', -35000);
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (-35001, 'com.broadleafcommerce.jobsevents.domain.ScheduledJob', -35001);
-- Scheduled Job Details
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-35002,'Read Scheduled Job Details','PERMISSION_READ_SCHEDULED_JOB_DETAIL', 'READ', FALSE);
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-35003,'All Scheduled Job Details','PERMISSION_ALL_SCHEDULED_JOB_DETAIL', 'ALL', FALSE);
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (-35002, 'com.broadleafcommerce.jobsevents.domain.ScheduledJobDetail', -35002);
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (-35003, 'com.broadleafcommerce.jobsevents.domain.ScheduledJobDetail', -35003);
-- Friendly permissions
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-35004,'View Scheduled Jobs','PERMISSION_SCHEDULED_JOB', 'READ', TRUE);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-35004, -35000);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-35004, -35002);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-35004, -45004);
INSERT INTO BLC_ADMIN_PERMISSION (ADMIN_PERMISSION_ID, DESCRIPTION, NAME, PERMISSION_TYPE, IS_FRIENDLY) VALUES (-35005,'Maintain Scheduled Jobs','PERMISSION_SCHEDULED_JOB', 'ALL', TRUE);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-35005, -35001);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-35005, -35003);
INSERT INTO BLC_ADMIN_PERMISSION_XREF (ADMIN_PERMISSION_ID, CHILD_PERMISSION_ID) VALUES (-35005, -45005);
-- Mapping from Roles to permissions
INSERT INTO BLC_ADMIN_ROLE_PERMISSION_XREF (ADMIN_ROLE_ID, ADMIN_PERMISSION_ID) VALUES (-1,-35005);
-- Mapping sections and permissions
INSERT INTO BLC_ADMIN_SECTION (ADMIN_SECTION_ID, CEILING_ENTITY, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, USE_DEFAULT_HANDLER, DISPLAY_ORDER) VALUES (-35000, 'com.broadleafcommerce.jobsevents.domain.ScheduledJob', -45000, 'Scheduled Jobs', 'Scheduled Jobs', '/scheduled-jobs', TRUE, 1000);
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-35000,-35004);
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-35000,-35005);
Note: With the introduction of this functionality, you may see a slightly increased load on your
jdbc/event
database resource, which may require an increase in the connection pool size.
API Updates
Newly Deprecated Items
- The
NodeRegistration
interface andNodeRegistrationImpl
class have been deprecated in preference to theRegisteredNode
interface andRegisteredNodeImpl
class. - The
SystemEventNodeFinished
interface andSystemEventNodeFinishedImpl
class have been deprecated in preference to theProcessedEvent
interface andProcessedEventImpl
class.