Two jobs for one execution

Hello,

is it possible that one execution belongs to two different jobs (of the job executor)? I seem to have encountered such sutuation:

processEngine.getManagementService()
  .createJobQuery().executionId(executionId)
  .singleResult() // <-- Here an exception was thrown
  .getId();

I got an exception (“Query return 2 results instead of max 1”) in the marked line. The situation was:

  • I had a process with an embedded subprocess
  • the embedded subprocess had a boundary timer event.
  • the executionId belongs to a step within the subprocess

Now I’m curious whether this is normal / should be possible. Until now I’ve thought that an execution can only belong to one job.

Thanks for any clarification.

I think I’ve understood why this happened. The subprocess is executed with one single execution. This execution is used for creating both the job for the boundary timer event and the jobs for the activities within the subprocess. Hence, when searching with executionId as the single search criterium, two jobs are found because both were created off of the same execution.

1 Like