Is there a way to know if a task is multiinstance?


#1

Hi,

Is there any way to know if a task is multiinstance or not in Java?

Regards,
Hetal


#2

Hi Can someone help here?


#3

Hi,

as it says in the documentation, the engine creates process variables with information about the multi-instance-task. These variables are: nrOfInstances, nrOfActiveInstances, nrOfCompletedInstances and loopCounter.

I am not sure if there is a way to exactly get the information if a task is multi-instance or not but you could check it on your own if you use the execution.hasVariable() method in your Java Code and check if the variables that are created for multi-instance tasks are there or not.

I know that this might not be the best answer to the problem but it should definetly work.

Regards
Michael


#4

Hi Michael,

Thanks for the response. I agree I can do that. I was more looking for something like getBpmnModelElementInstance() which could tell that the task/process is multiInstance.

Regards,
Hetal