processBusinessKey available in expression but not in code

When I pass the processBusinessKey like this:

Screen Shot 2021-08-20 at 8.36.39 AM

I get a string like ProcessInstance[“d975ed7f-fb34-4325-8d84-eca8e7e3a127”]

If I pass just “execution”, execution.processBusinessKey is null, though (although processInstance.toString() has the same value, ideally I’d like to use processBusinessKey). Any thoughts on why processBusinessKey is null or what I’m missing?

Hi @marko.galesic,

where do you use the expression?

The expression language uses the DelegateExecution interface, you could try to use execution.getProcessBusinessKey() to access the current businessKey (if a businessKey is set before).

Hope this helps, Ingo

Hi @Ingo_Richtsmeier ,

I should have clarified. I’m using Kotlin instead of Java, where execution.processBusinessKey gets translated to execution.getProcessBusinessKey()