[jboss-user] [jBPM] - Action script - how to invoke an executable?

olddave do-not-reply at jboss.com
Wed Jan 18 11:42:33 EST 2012

olddave [https://community.jboss.org/people/olddave] created the discussion

"Action script - how to invoke an executable?"

To view the discussion, visit: https://community.jboss.org/message/647418#647418


This action script will give you the idea of what I need to do 
String osname = System.getProperty("os.name");
if(osname.equals("Linux")) {
           Runtime.getRuntime().exec("wineconsole --backend=user "/vendor_files/bbg_ps_enc/des.exe -D -u -k \"xcvfrew\" /vendor_files/bbg_ps_enc/equity_desc.enc.out /vendor_files/bbg_ps_out/equity_desc.out");
} else if(osname.indexOf("Windows") == 0) {
           Runtime.getRuntime().exec("cmd /c C:/vendor_files/bbg_ps_enc/des.exe -D -u -k \"xcvfrew\" C:/vendor_files/bbg_ps_enc/equity_desc.enc.out C:/vendor_files/bbg_ps_out/equity_desc.out");
The Window specific command works fine. The Linux command never works.

I have substituted the Linux cd with this "/vendor_files/bbg_ps_enc/rundes.sh" and that does not work either. Where rundes.sh has 

wineconsole --backend=user /vendor_files/bbg_ps_enc/des.exe -D -u -k "xcvfrew"  /vendor_files/bbg_ps_enc/equity_desc.enc.out /vendor_files/bbg_ps_out/equity_desc.out

I have tried both mvel and java types for the Action script

I have tried 
"/bin/bash -c 'wineconsole --backend=user "/vendor_files/bbg_ps_enc/des.exe -D -u -k \"xcvfrew\" /vendor_files/bbg_ps_enc/equity_desc.enc.out /vendor_files/bbg_ps_out/equity_desc.out'"

I tried adding the full path for wineconsole too, no change.

 And all combinations of the above. All these commands work perfectly inside a shell window. These techniques have been gleaned from a number of articles on the web about how to use Runtime.exec, but they do not appear to work within Drools

So is it possible? If so how?



Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120118/f57fa7cf/attachment.html 

More information about the jboss-user mailing list