Job executor hook before start/end execution

Hi
Whenever async activity is found in bpmn, remaining bpmn blocks will be executed by camunda job executor. Is there a way to hook into before and after job execution task is done. Looking for functionality similar to ExecutionListener for the tasks executed by job.

One of the requirement is to log certain process variables or processinstanceId along with each log statement printed by log4j. Or do some common process before a bpmn’s blocks are executed by job executer. It will be better to manage at Job executor level compared to each block that we map to.

Thanks.

Hi,

Im not aware of a job executor hook, but I can think of a work around. In your process model, you define the job executor job boundaries via the async continuation flags. Hence the process model provides the job boundaries.

You could consider adding something like a none intermediate event before and after each boundary, and change the model such that these intermediate event pairs comprise an async before and an async after on each intermediate event respectively. Thus now you could use an execution listener in these intermediate events to perform the job executor code you want, knowing that they are occuring just after the start, and just before the end of a job executor task set.

Note - the intermediate none events are just for visibility and possibly re-use as say a modeller template. They are unnecessary if you add the execution listeners to appropriate points on your actual tasks…

regards

Rob

Thanks Rob for reply.

I understand this is a way to do in bpmn. Was looking for a way to do this outside bpmn.