7.4 - Update job sceduerEntry in SchedulerJobConfiguration

I am migrating the code from 7.3 to 7.4 . As a part of this I have moved my scheduler to use 7.4 framework which uses SchedulerJobConfiguration.

In 7.3 we had below customisation

@Activate
	@Modified
	protected void activate(@NonNull final Map<String, Object> properties) {
		val listenerClass = getClass();

		val className = listenerClass.getName();
		this.schedulerGroupName = className;

		val configuration = ConfigurableUtil.createConfigurable(EdemailServiceConfiguration.class, properties);

		log.info("Scheduling weekly Ed-e-Mail using crontab: {}",  configuration.getDigestCrontab());

		val trigger = triggerFactory.createTrigger(className, className, new Date(), null, configuration.getDigestCrontab());
		val schedulerEntry = new SchedulerEntryImpl(className, trigger);
		schedulerEngineHelper.register(this, schedulerEntry, DestinationNames.SCHEDULER_DISPATCH);

		log.info("Activated {}", this.getClass().getSimpleName());
	}

I would like to do something similar in 7.4 . How to do it ?

Something inside

@Activate
	@Modified
	protected void activate(final Map<String, Object> properties) {
		log.info("Activate succeeded ------------------({}).", this.getClass().getSimpleName());
		this.edemailServiceConfiguration = com.liferay.portal.configuration.metatype.bnd.util.ConfigurableUtil.createConfigurable(EdemailServiceConfiguration.class, properties);
		
		log.info("Activated/Modified {} cron='{}'", getClass().getSimpleName(), edemailServiceConfiguration.getDigestCrontab());
		
	}

1 Answer

1

Hello @Life_doe,

Could you please review the following articles, as they will help you identify changes introduced in the Job Scheduler Framework from 7.4:

https://liferay.dev/de/b/liferay-7-4-scheduled-tasks

https://learn.liferay.com/w/dxp/development/traditional-java-based-development/core-frameworks/job-scheduler-framework/job-scheduler-dispatch-framework-reference