cancel
Showing results for 
Search instead for 
Did you mean: 

expression parse bug?

croc1
Champ in-the-making
Champ in-the-making
hi!
I encountered some troubles in activiti 5.9.
when parse  expression

the exception is

org.activiti.engine.impl.juel.TreeBuilderException: Error parsing '${userService.findUsers("{"id":"12"}"': syntax error at position 27, encountered 'id', expected ')'


and the bpmn is



<startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="P1" name="P1" activiti:candidateUsers="${userService.findUsers(&quot;{&quot;id&quot;:&quot;12&quot;}&quot;, var1)}"></userTask>
    <endEvent id="endevent1" name="End"></endEvent>


I want to pass a string like json in my service,but the "}" be resolved..  :?

How to solve that problem?

THX!
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
You're using double quotes around your string literal but also including double-quotes in the string literal body… As the (J)UEL specification says:

In section 1.3, "Literals", the specification states that "Quotes only need to be escaped in a string value enclosed in the same type of quote". This suggests that, e.g., "You could escape a single quote in a double-quoted string, but it's not necessary". JUEL guesses that you can't and that the above should read as "Quotes can only be escaped in a string value enclosed in the same type of quote".

Try something like this instead:


${userService.findUsers("{'id':'12'}")

or

${userService.findUsers('{"id":"12"}')

or even

${userService.findUsers("{\"id\":\"12\"}")

croc1
Champ in-the-making
Champ in-the-making
@frederikheremans

thank you!

i have solved the problem,

and the var1[process variable] have to write in front  of the string. Smiley Very Happy