+++ This bug was initially created as a clone of Bug #983347 +++ Description of problem: "Error : no viable alternative at character '\'" is seen in logs when using "/n" in a Script Task as follows: I figured this out and it is from the script tasks: Example: <drools:script><![CDATA[com.llnw.bpm.UpdateObject _update = new com.llnw.bpm.UpdateObject();\n\n_update.setMessage("This is the message");\n_update.setOppId(324);\n_update.setType("INFO");\n\nkcontext.setVariable("updateObject",_update);]]></drools:script> they are from the /n. If I remove the /n then the errors don't show up in logs. It seems to be a regression as a similar issue was reported in the cloned bz and it seems as that had been fixed.
This is fixed in bpmsuite-6.2.0.GA
This is still present in 6.3.0.DR2. Steps to reproduce: 1. Create simple process with script task in Business Central. 2. Add text com.llnw.bpm.UpdateObject _update = new com.llnw.bpm.UpdateObject();\n\n_update.setMessage("This is the message");\n_update.setOppId(324);\n_update.setType("INFO");\n\nkcontext.setVariable("updateObject",_update); as the body of the script task. 3. Save process. 4. See logs. 10:01:54,048 ERROR [stderr] (EJB default - 8) line 1:69 no viable alternative at character '\' 10:01:54,048 ERROR [stderr] (EJB default - 8) line 1:71 no viable alternative at character '\' 10:01:54,048 ERROR [stderr] (EJB default - 8) line 1:115 no viable alternative at character '\' 10:01:54,049 ERROR [stderr] (EJB default - 8) line 1:139 no viable alternative at character '\' 10:01:54,049 ERROR [stderr] (EJB default - 8) line 1:165 no viable alternative at character '\' 10:01:54,049 ERROR [stderr] (EJB default - 8) line 1:167 no viable alternative at character '\' Reproduced using EAP 6.4.4 and JBoss BPM Suite 6.3.0.DR2.
Looking at the original Description for this BZ, I think the issue is about the way new-lines typed by the user in scripts were serialized into BPMN2 XML. e.g. if the user typed the next 3 lines (including a blank line) in a script: com.llnw.bpm.UpdateObject _update = new com.llnw.bpm.UpdateObject(); _update.setMessage("This is the message"); this was serialized to BPMN2 as: <drools:script><![CDATA[com.llnw.bpm.UpdateObject _update = new com.llnw.bpm.UpdateObject();\n\n_update.setMessage("This is the message");]]></drools:script> i.e. the string "\n" isn't something the user enters, but was part of the BPMN2 serialization of the Javascript typed by the user. In Javascript, the characters '\' and '/' are only valid in string constants, so a script which includes either of these characters outside of a string constant should generate an error, and this is what's seen in Comment3 above. I therefore think it's valid to say this has been fixed.
After discussion with Jeremy I opened another bug related to this logged error. The bug is here [1]. So I consider tihs verified. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1316902