camel exec is based on common-exec. 
Can you just try the your script just as the tutorial does?

[1]http://commons.apache.org/proper/commons-exec/tutorial.html
--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 10, 2014 at 6:20:21 PM, Chris Melikian ([email protected]) wrote:
> Hi,
>  
> I'm trying to execute a .cmd batch file in Camel 2.13.1 on Windows.
>  
> My endpoint looks like this:-
>  
> from("direct:start")
> .to("exec:c:\\batch-commands\\YIELDCurves.cmd?workingDir=c:\\batch-commands\\YIELDCurves.cmd")
>   
> .log("Exit code for cli execution was [${body.exitValue}]");
>  
> and I get the exitValue of 0 from the ExecResult object in the body of IN.
>  
> Now, if I want to return from the batch file with an error code e.g.
>  
> exit 1
>  
> I can't seem to get Camel to give me the '1' value in the log EIP statement
> above.
>  
> I've tried using:-
> - to("exec:cmd?args=c:\\batch-commands...etc but that doesn't execute the
> script at all and I don't get any output other than the Microsoft Command
> Interpreter message for the new cmd process and return code 0
> - exit /B 1 in the batch file but that also gives return code 0 in Camel
> - exit /B [1] as I saw that usage in a DOS forum, no luck
> - exit [1] see above, no luck
>  
> I've exhausted the options I can see.
>  
> Anyone had any success with this?
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-exec-component-and-return-codes-from-Windows-batch-files-tp5757466.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  

Reply via email to