Monday 20 April 2015

TIBCO Business Events: Execute External command

There are few occasions where Business Events need to execute operating system's commands. Just like TIBCO Business Works external command, TIBCO Business Events can also execute "External commands". But there are some limitations. Unlike TIBCO BW, TIBCO BE cannot invoke external command synchronously, so that the RTC should not hang or involve in long time execution.

To execute an external command, use
void System.exec(String command).

Depending on the Operating System the command text must be passed. for example

Windows
=======
System.exec("cmd /c START D:/STUDYMETERIAL/hello.bat");

Where "cmd /c" represent this is being executed in Windows.
START represents, the command is going to execute as a different process.
D:/STUDYMETERIAL/hello.bat is the batch file, containing the sequence of batch commands that need to execute.


Unix
=====
System.exec("sh D:/STUDYMETERIAL/hello.sh &");
Where "sh" represent this is being executed in UNIX as shell script.
"&" represents, the command is going to execute as a different process.
D:/STUDYMETERIAL/hello.sh is the Shell file, containing the sequence of shell commands that need to execute.

No comments:

Post a Comment