Author |
Message
|
WBIMaestro |
Posted: Tue Jan 03, 2012 3:18 pm Post subject: Reading FileOutput directory value into to a variable |
|
|
Acolyte
Joined: 18 Feb 2005 Posts: 53
|
Hi,
I have a situation, where I create a template message flow and abstracted it as a pattern to publish multiple versions of it reading from different queues. The Flow contains a FileOutPut Node and Ive made this a pattern property to be set for each instance. Now, I need to have the FileOutput Directory value available in the message flow to populate into a variable. Googling the infocenter leads me to beleive that I should be using :
Code: |
SET LocalFileDirectory = OutputLocalEnvironment.WrittenDestination.File.Directory;
|
However this ends up producing a null value. Ive declared the variable as a shared character:
Code: |
DECLARE LocalFileDirectory SHARED CHARACTER;
|
Im going by the infocenter page at :
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac55160_.htm
What could I be doing wrong?
On a side note, Is it possible to set custom pattern properties on say a compute node, so that I can abstract say variable values also to the pattern level? from what I can see it only seems to allow the out-of-the-box node properites to be abstracted to the pattern.
This is with Broker v7
Thanks for the assistance
Cheers |
|
Back to top |
|
 |
Esa |
Posted: Tue Jan 03, 2012 11:38 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Hi,
it seems you are trying to read the name of the directory where a FileOutput node has just written a file. This can be done in a compute node that is wired after the FileOutput node. What is wrong with your code is that you should read the value from InputLocalEnvironment, not OutputLocalEnvironment.
But why would you put that value into a shared variable? Are you trying to cache the name of the directory for loggging purposes or something?
Because if you have put the directory name in a pattern property, the logical procedure would be to use that property to configure the output directory in runtime. In that case you would have a compute node before the FileOutput and your code would be something like this:
Code: |
SET OutputLocalEnvironment.Destination.File.Directory = <your property value> |
Check the details from here: http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac55410_.htm |
|
Back to top |
|
 |
Esa |
Posted: Wed Jan 04, 2012 1:04 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Sorry.
I misunderstood something. You also want the flow to be aware of the directory name that you have made a pattern property. In that case the only mistake is that you try to read from OutputLocalEnvironment.
I thought you had made an UDP for configuring the directory name and made that a pattern property. That's how I would have done it. Then you can read the directory name straight from an external variable and you don't have to try to recover it from WrittenDestination (and cache it, as you are obviously doing now). The only drawback is that you will have to set the actual output directory of the FileOutput node dynamically by LocalEnvironment override. But that's just a couple of more code lines in your pattern exemplar. |
|
Back to top |
|
 |
WBIMaestro |
Posted: Wed Jan 04, 2012 9:53 am Post subject: |
|
|
Acolyte
Joined: 18 Feb 2005 Posts: 53
|
so I can only read the name of the FileOutout Directory AFTER the Fileoutout Node? I am currently trying to do it before and I think that is what is resukting in a NULL value. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 04, 2012 9:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WBIMaestro wrote: |
so I can only read the name of the FileOutout Directory AFTER the Fileoutout Node? |
It's populated by the FileOuput node as the directory it actually used, hence WrittenDestination
In your position I'd use a UDP. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WBIMaestro |
Posted: Wed Jan 04, 2012 1:55 pm Post subject: |
|
|
Acolyte
Joined: 18 Feb 2005 Posts: 53
|
|
Back to top |
|
 |
Esa |
Posted: Wed Jan 04, 2012 11:31 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Jan 05, 2012 5:37 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 05, 2012 5:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
lancelotlinc wrote: |
Esa - don't give away the secrets. Else, whats a consultant to do? |
Live off accumulated earnings?
Move on to the next site where they still don't know the secrets. Before you say anything, this is not the first time someone's asked what a UDP is in this forum and it will not IHMO be the last.
Your future earnings potential is as safe as it ever was. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Esa |
Posted: Thu Jan 05, 2012 5:55 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
lancelotlinc wrote: |
Esa - don't give away the secrets. Else, whats a consultant to do? |
Lancelot - UDPs and mqsiapplybaroverride are yesterday anyway and free to be revealed to the public  |
|
Back to top |
|
 |
WBIMaestro |
Posted: Thu Jan 05, 2012 10:21 am Post subject: |
|
|
Acolyte
Joined: 18 Feb 2005 Posts: 53
|
Quote: |
UDPs and mqsiapplybaroverride are yesterday |
These are yesteday? So whats today? Deployable patterns? just curious... |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jan 05, 2012 10:56 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If you have ever faced the issue where the UAT bar override file has been applied to the .BAR files destinged for Production and everyone flaty denying they did anything wrong, you might understand any aversion I might have to using Barfile overrides.
I prefer to keep configuration data in a DB and change that between different systems.
The only time I recommend using a bar file override is to set the number of additional instances.
But hey, you have a choice. Use whatever method rocks your boat. _________________ 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 |
|
 |
Vitor |
Posted: Thu Jan 05, 2012 11:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
If you have ever faced the issue where the UAT bar override file has been applied to the .BAR files destinged for Production and everyone flaty denying they did anything wrong, you might understand any aversion I might have to using Barfile overrides. |
With a feeling of dread at this can of worms opening again, that's not a problem if you remove the humans from the bar file processing with Any or similar. Which has been discussed in depressing levels of detail on this forum and probably is about to be again.
smdavies99 wrote: |
I prefer to keep configuration data in a DB and change that between different systems. |
Which doesn't fix the problem, just moves it to the DBAs. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 05, 2012 11:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WBIMaestro wrote: |
Quote: |
UDPs and mqsiapplybaroverride are yesterday |
These are yesteday? So whats today? Deployable patterns? just curious... |
I'm curious too... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Jan 05, 2012 11:11 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Vitor wrote: |
smdavies99 wrote: |
If you have ever faced the issue where the UAT bar override file has been applied to the .BAR files destinged for Production and everyone flaty denying they did anything wrong, you might understand any aversion I might have to using Barfile overrides. |
With a feeling of dread at this can of worms opening again, that's not a problem if you remove the humans from the bar file processing with Any or similar. Which has been discussed in depressing levels of detail on this forum and probably is about to be again.
smdavies99 wrote: |
I prefer to keep configuration data in a DB and change that between different systems. |
Which doesn't fix the problem, just moves it to the DBAs. |
Korek, sir Vitor. The problem still exists, just Davies prefers to have DBA humans solve it.
I like the Bar File Override concept, because it greatly assists the automation of your Continuous Integration.
I wonder what Davies does with regard to Web Services? How does Davies override a SOAP Request node's property if not using BFOs? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|