ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to pass parameters to .bat file from message flow in IIB

Post new topic  Reply to topic
 How to pass parameters to .bat file from message flow in IIB « View previous topic :: View next topic » 
Author Message
SDS
PostPosted: Tue Sep 20, 2016 10:59 pm    Post subject: How to pass parameters to .bat file from message flow in IIB Reply with quote

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
View user's profile Send private message
martinb
PostPosted: Tue Sep 20, 2016 11:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
SDS
PostPosted: Wed Sep 21, 2016 12:17 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Sep 21, 2016 12:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
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
View user's profile Send private message Send e-mail
SDS
PostPosted: Wed Sep 21, 2016 12:43 am    Post subject: Reply with quote

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
View user's profile Send private message
martinb
PostPosted: Wed Sep 21, 2016 2:38 am    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Wed Sep 21, 2016 2:45 am    Post subject: Reply with quote

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
View user's profile Send private message
SDS
PostPosted: Wed Sep 21, 2016 4:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to pass parameters to .bat file from message flow in IIB
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.