Author |
Message
|
trongbx |
Posted: Wed Apr 08, 2009 2:07 am Post subject: Problem with FileOutput node |
|
|
Novice
Joined: 23 Nov 2008 Posts: 21
|
Hi all
I am getting stuck on FileOutput node on wmb project. My message flow have to generate or custom the filename and directory name in runtime..but it failed.
my message flow is:
MQInput ----> Compute node ----->FileOutput ---->MQOutput.
My esql code:
DECLARE NEW_DIR_NAME CHARACTER;
DECLARE NEW_FILE_NAME CHARACTER;
DECLARE NEW_FILE_SUFFIX CHARACTER;
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.BLOB = InputRoot.BLOB;
SET OutputLocalEnvironment = InputLocalEnvironment;
SET NEW_DIR_NAME = 'C:\FileOutput\TestFileName';
SET NEW_FILE_NAME = 'newfilename';
SET NEW_FILE_SUFFIX ='.txt';
-- file directory root name
SET OutputLocalEnvironment.Destination.File.Directory = NEW_DIR_NAME;
-- new file name with file suffix
SET OutputLocalEnvironment.Destination.File.Name = NEW_FILE_NAME|| NEW_FILE_SUFFIX;
Please give me any suggestion on this issue.
Have a great day. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 08, 2009 2:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Did you set Compute Mode on Compute node to include Local Environment? |
|
Back to top |
|
 |
trongbx |
Posted: Wed Apr 08, 2009 8:10 pm Post subject: |
|
|
Novice
Joined: 23 Nov 2008 Posts: 21
|
Hi jeff
I missed that. I changed the compute mode to All and the msg flow worked fine.
Thank you very much. |
|
Back to top |
|
 |
trongbx |
Posted: Wed Apr 08, 2009 9:40 pm Post subject: |
|
|
Novice
Joined: 23 Nov 2008 Posts: 21
|
Hi.
Now, My msg flow can custom the filename and directory of the FileOutput node which is after the Compute node. But it is not working with FileOutput node which is before the Compute node. I have to archive the original file before it is changed.
Are there any way to do that?
Have a great day. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Apr 08, 2009 10:01 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Your original Post stated:-
Quote: |
my message flow is:
MQInput ----> Compute node ----->FileOutput ---->MQOutput.
|
There is no mention of a FileOutput Node BEFORE the Compute Node.
Would you care to elaborate further?
Also the ESQL you have posted AFAIK, does not alter the contents of the Message Received at the MQInputNode _________________ 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 |
|
 |
trongbx |
Posted: Wed Apr 08, 2009 11:11 pm Post subject: |
|
|
Novice
Joined: 23 Nov 2008 Posts: 21
|
The message flow that i posted is just used for testing.
Now, i am working on the msg flow as below:
JMSInput ----> FileOutput ---> JMSMQTransform ---->Compute node ---> FileOutput ----> WTX node ----> FileOutput ---> MQJSMTranform ---> JMSOutput.
So that, i want to archive the original message before adding some mq header and some changes in compute node.
Thanks. |
|
Back to top |
|
 |
sebastianhirt |
Posted: Wed Apr 08, 2009 11:13 pm Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
trongbx wrote: |
Hi.
Now, My msg flow can custom the filename and directory of the FileOutput node which is after the Compute node. But it is not working with FileOutput node which is before the Compute node. I have to archive the original file before it is changed.
Are there any way to do that?
Have a great day. |
Have you considered, setting the action on successful completion on the FileInput Node to Archive instead of Delete? |
|
Back to top |
|
 |
sebastianhirt |
Posted: Wed Apr 08, 2009 11:17 pm Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
trongbx wrote: |
The message flow that i posted is just used for testing.
Now, i am working on the msg flow as below:
JMSInput ----> FileOutput ---> JMSMQTransform ---->Compute node ---> FileOutput ----> WTX node ----> FileOutput ---> MQJSMTranform ---> JMSOutput.
So that, i want to archive the original message before adding some mq header and some changes in compute node.
Thanks. |
So I was to late with my last post.
This will only work if you set up a file and a directory name in the FileOutput Node. There is a way to let the Message Broker set parts or the filename. All just a matter of configuration. You might want to look up the info center.
HTH Sebastian
EDIT: Why would you need to write the Message out so often during processing? |
|
Back to top |
|
 |
trongbx |
Posted: Thu Apr 09, 2009 1:01 am Post subject: |
|
|
Novice
Joined: 23 Nov 2008 Posts: 21
|
As i mentioned above. The msg flow could custom file name and directory for the FileOutput nodes which are after the Compute node but is not working with another FileOutput whic is before the Compute node.
About why i need to use fileoutput node, that is because my msg flow get the files from partner and i want to archive and save those file into hard disk. I set the FileOutput node before the compute node because i have to get the original file for other tasks.
Please give me any suggestion about how to custom file name for the FileOutput node that is before the Compute node.
I am really appreciated. |
|
Back to top |
|
 |
MQEnthu |
Posted: Thu Apr 09, 2009 2:05 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
trongbx wrote: |
The msg flow could custom file name and directory for the FileOutput nodes which are after the Compute node but is not working with another FileOutput whic is before the Compute node. |
Because you are setting the file name and directory in the compute node. How can you expect to take these values in the File node that comes before the compute node or did I misunderstood your question
trongbx wrote: |
I set the FileOutput node before the compute node because i have to get the original file for other tasks. |
as per your ESQL code, you are not manipulating the message, so you should still have your original message at 2nd file output node aswell _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 09, 2009 2:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sebastianhirt wrote: |
Why would you need to write the Message out so often during processing? |
trongbx wrote: |
About why i need to use fileoutput node, that is because my msg flow get the files from partner and i want to archive and save those file into hard disk. I set the FileOutput node before the compute node because i have to get the original file for other tasks. |
OK so you have to do a number of things ... but you are certainly not going the most efficient way about it.
Instead of saving to disk save to a DB. Do not save at each stage of the flow but save at input and after reply (including the relevant information from the environment to link reply to the request). If you do not want the dependency to the DB you can output to a queue and have a process pick from the queue to put to the DB...
Don't understand the reference to other tasks. Shouldn't they also be taken care of in the flow?.
Saving at each stage of the flow looks more like a debug trace and justification that your process is right. I would have thought your process to be of the "black box" type...
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
|