Camunda DelegateTask getVariable doesn't work

This would be my first post here.
I have a camunda process, with two tasks, and the whole process has variables attached to it.
I have a class which implements TaskListener, and I’m trying to retrieve a certain variable, like this:


However, it returns null.
Can somebody explain how can I retrieve the variable?

Hi Eduard,

This API returns null if the variable value is actually null or if the variable does not exist.

  1. Are you sure the variable is set when your listener is executed?
  2. Are you sure you use the correct variable name?


1 Like

I attached the diagram associated with our process.
Actually, we set the variables on the Start node, and we’re trying to retrieve it with a TaskListener which is set on “Execute” task(via notify method)


Unfortunately, it returns null.