I am hoping to use an inline groovy script to perform some transformations involving regex and the method call includes a dollar sign. Camunda is complaining and escaping the characters does not work. I cannot use an external script in this case. Does anyone know of a technique for handling this inline? Thanks.
Please post some sample code snippet
This is an example of a script in the Modeller that won’t work
public static String camelToSnake(final String camelStr) { String ret = camelStr.replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2").replaceAll("([a-z])([A-Z])", "$1_$2"); return ret.toLowerCase(); }
Just keep the string inside a single quotes rather than double quotes and try. It is not Camunda rather it is the groovy engine that complaints about the string. A ‘$’ inside a groovy string has different meanings.