Can not find symbol method getJobEntityManager(org.flowable.common.engine.impl.interceptor.CommandContext)

I have used methods getJobEntityManager and getJobManager in flowable 6.4.1. Now I need to migrate my java application from java 8 to java 17. what are the alternative methods for getJobEntityManager and getJobManager that can be used from flowable 6.7.0?

    JobEntity jobEntity = CommandContextUtil.getJobEntityManager(commandContext).create();
    jobEntity.setJobType(JobEntity.JOB_TYPE_MESSAGE);
    jobEntity.setJobHandlerType(MessageForSingletonConfig.TYPE);
    jobEntity.setJobHandlerConfiguration(marshal(config));
    jobEntity.setRevision(1);
    jobEntity.setRetries(LOCK_RETRIES);

    managementService.
    CommandContextUtil.getJobManager(commandContext).scheduleAsyncJob(jobEntity);

    log.info("Scheduled {} async job: {}", jobEntity.getId(), jobEntity.getJobHandlerConfiguration());
    return null;
}

Hi @ishum

There is now a JobServiceConfiguration in place where you get the JobManager and the JobEntityManager.

Regards,
Simon

@amporsim Could you please provide an example?

For example:

JobService jobService = CommandContextUtil.getProcessEngineConfiguration().getJobServiceConfiguration().getJobService();
JobEntity jobEntity = jobService.createJob();
jobEntity.setJobType(JobEntity.JOB_TYPE_MESSAGE);
jobEntity.setJobHandlerType(MessageForSingletonConfig.TYPE);
jobEntity.setJobHandlerConfiguration(marshal(config));
jobEntity.setRevision(1);
jobEntity.setRetries(LOCK_RETRIES);
jobService.scheduleAsyncJob(jobEntity);

Regards,
Simon

@amporsim Thank you for the reply. But there is no getProcessEngineConfiguration method in CommandContextUtil in flowable 6.8.

There are a few CommandContextUtil classes.

In org.flowable.engine.impl.util.CommandContextUtil you should have a getProcessEngineConfiguration() method.

@amporsim Thank you very much. It worked.
Do you know from which class we should import getEventSubscriptionEntityManager?

That logic has moved (a long time ago) to EventSubscriptionUtil. However, that’s an internal class, the API way to call that logic is by calling messageEventReceived or signalEventReceived on the RuntimeService.

@joram Can you please provide an example?

Not sure what you mean? RuntimeService#messageEventReceived is the method. You are already using the message name and the executionId (the parameters of that method) in the screenshot you pasted above.

Thank you very much.