Hi,

I am writing a very basic camel flow to test using scripts. But it gives me
a strange error. The route looks like this:

The main action happens here:
from("file://C:test?fileName=in.xml").routeId("ContentbasedRouter")
.choice()               
   .when(toXML)
        .script().javaScript("request.body.substring(3, 6)")
                
But when I run this I get
org.apache.camel.builder.script.ScriptEvaluationException: Failed to
evaluate: js: request.body.substring(3, 6). Cause: <eval>:1 TypeError:
GenericFile[C:\test\input.csv] has no such function "substring"

I have tried with script().groovy() but gives me similar error groovy
missingmethod.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-script-gives-strange-error-tp5778017.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to