Using JobExecutor for Jobs independent of processes

Hi guys,

I have a question regarding the JobExecutor.

Would it be possible to use it for job execution independent of processes or cases?

In our project we need to support async execution of work on a specific point in time. For example Quartz would support this (http://www.quartz-scheduler.org/).
We are also using Camunda BPM 7.5 in our project.
Now my idea was to use camundas JobExecutor to execute scheduled Jobs instead of using a second framework which is able to schedule and execute jobs.

My question is , if it is possible to schedule Jobs at runtime which have a specific JobHandler but are independent of BPMN oder CMMN Executions.
Or would it be a wrong use case for camunda job executor?

Best regards,

Markus

I analysed that JobEntities are added via JobManager. To retrieve the JobManager it is necessary to get CommandContext first.

So in my opinion it is not possible at the moment to schedule JobEntities for example a TimerEntity which is independent from a specific Execution.

Therefore the JobExecutor can not be used to schedule for example reports or nightly tasks which are independent from bpmn or cmmn.

Any comments?

Best regards,

Markus

Hi Markus,

First of all, there is no API to create and handle a job that does not belong to a process instance. Second, you could create a custom job handler and insert jobs via JobManager. This also works if it does not reference an execution entity. For example, a job for a BPMN timer start event of a process does not reference an execution.

Is creating custom jobs a use case that the job executor is intended for? No, there is no public API for that.
Can you do it anyway? Very likely yes.
Should you do it? Only if you do not mind porting your code to future Camunda versions on upgrade since internal API is not guaranteed to remain stable.

Note that there is also a public API way to do such things: Deploy a BPMN process with a timer start event that triggers the maintenance activity. By using authorizations, you could even hide them from your users.

Cheers,
Thorben