Author |
Message
|
SDS |
Posted: Tue Sep 20, 2016 10:59 pm Post subject: How to pass parameters to .bat file from message flow in IIB |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
I need to call a windows batch file by passing parameters dynamically from the input message using IIB V10. I can invoke the batch file from the message flow but not able to pass parameters or arguments to the .bat file from the message flow.
Any help will be highly appreciated. |
|
Back to top |
|
 |
martinb |
Posted: Tue Sep 20, 2016 11:50 pm Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
What issue do you face?
Have you tried for example composing a string from the input message data in a Java Compute node and using Java's Runtime.getRuntime().exec()? |
|
Back to top |
|
 |
SDS |
Posted: Wed Sep 21, 2016 12:17 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Hi,
Instead of Java Compute, I have used Job Execution node which is a plugin to invoke the batch job. Is there a way to pass the parameters to the batch file using ESQL compute node before the Job Execution node? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 21, 2016 12:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SDS wrote: |
Hi,
Instead of Java Compute, I have used Job Execution node which is a plugin to invoke the batch job. Is there a way to pass the parameters to the batch file using ESQL compute node before the Job Execution node? |
What does the documentation of the Job Execution node say?
Any environmental overrides?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
SDS |
Posted: Wed Sep 21, 2016 12:43 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
That is also not much clear from the documentation. It can invoke the batch file as mentioned in the property.
If it is not possible using Job Execution node, can anyone please guide me to achieve this requirement using JCN? |
|
Back to top |
|
 |
martinb |
Posted: Wed Sep 21, 2016 2:38 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
Hi
I took a quick scan at the IA9Z Job Execution Node, it does not appear to support providing a LocalEnvironment override for the "Job location" property. Hence you can't dynamically pass parameter values to it.
As I've said you could write a JCN to extract your parameter values from your message input data and build up the command and parameters to pass into Java's Runtime.getRuntime().exec().
I guess one way you could make this work with the Job Execution Node would be to precede it with a FileOutput node to write a .bat file who's contents was the string you built to call the real target .bat file with the parameter values. Then the Job Execution Node is statically configured to run the .bat file written by the FileOutput node. Not elegant but could get the job done. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Sep 21, 2016 2:45 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
martinb wrote: |
Hi
I guess one way you could make this work with the Job Execution Node would be to precede it with a FileOutput node to write a .bat file who's contents was the string you built to call the real target .bat file with the parameter values. Then the Job Execution Node is statically configured to run the .bat file written by the FileOutput node. Not elegant but could get the job done. |
That's how I did it in the past. didn't always work though and we abandonded the support pack because we migrated to V7 and there was no version of the SP forthcoming at the time. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
SDS |
Posted: Wed Sep 21, 2016 4:06 am Post subject: |
|
|
 Apprentice
Joined: 13 Jun 2011 Posts: 47
|
Thanks a lot for the replies.
I am able to pass arguments to the .bat file using JCN. The next thing is I have to invoke a perl script from the batch file.
If I execute the batch in cmd prompt, I am able to invoke the perl script properly but if I execute the batch from IIB message flow using JCN, I am getting the following error as "'perl' is not recognized as an internal or external command, operable program or batch file."
Can anyone please help on this? |
|
Back to top |
|
 |
|