Escape character(-) not supported

I am setting my custom variable with “-” and this works fine. But when I try to use in Execution listener expression then flowable gives below error:
"Caused by: org.flowable.common.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier ‘i’ "
My expression is : ${i-abcTest}.

If I use other custom variable which does’t contain - then its works fine.
Example: {amount} -> Works fine. Example: {i-abcTest} -> Gives error.

Please let me know escape characters for -

Thanks in advance!

Hi Sagar!

In your expression, the parser attempts to perform a subtraction, essentially “i minus abcTest” . that the dash represents a minus which then results in an attempted subtraction.

If you are in control of the variable names, I would advice against using dashes within variable names. You could potentially replace them with underlines which would most likely not cause any issues.
If you really want to retrieve the variable value, you can do this:
${execution.getVariable('i-abcTest')} (in BPMN)
${caseInstance.getVariable('i-abcTest')} (in CMMN)

Hope it helped!

Regards,
Matthias

@matthias.stoeckli Thanks for reply,

Now what happened is i have already used custom variable with name like : i-abcTest.
And i was create second variable but i have replacing this variable value from previously created variable. so that why i am using this and i was set custom variable with name i-abcTest it is working fine but in expression it is throwing error.

so is that any escape character in expression for ignore characters ??
just like in java \ is escape character.

Thanks .

Hey,

In theory, \ is indeed used for escaping, however, in this scenario, you will not be able to use it because you will essentially try to escape the minus operator.

Can you try to use above expression ${execution.getVariable('i-abcTest')} and see if it works out?

@matthias.stoeckli Thanks for reply i will try.

Hi @matthias.stoeckli,

I have tried your solution and Its works :slight_smile:

Thank you so much!!!