trying to create a default value for a variable

This is a message end event I need to include the variable named repetitionInterval.
I’m trying to create a default value for this variable. If it is present, I want to use the existing value. If it is not present, I want to use “0 0 0 * * ?” for the value. Simple right? It’s a empty/null check with a conditional operator. So, why doesn’t it work?

${empty repetitionInterval ? “0 0 0 * * ?” : repetitionInterval}

Hi @Jon_H
I can’t test it myself at the moment but what if you try something like the following?

${execution.getVariable("repetitionInterval") != null ? execution.getVariable("repetitionInterval") : "0 0 0 * * ?"}

Regards,
Alex

Thanks @Alex_Voloshyn. Yes, that is pretty much exactly what I ended up with and it does work.

The documentation claims to support “Jakarta Expression Language 4.0 standard” here, Expression Language | docs.camunda.org. That’s where that “empty” syntax comes from, but it doesn’t seem to work as advertised.

Thanks again.
Jon

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.