|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Best Way To Handle File and Directory Management In Broker |
« View previous topic :: View next topic » |
Author |
Message
|
bdaoust |
Posted: Tue Dec 04, 2012 10:05 am Post subject: Best Way To Handle File and Directory Management In Broker |
|
|
Centurion
Joined: 23 Sep 2010 Posts: 130
|
I'm needing to create a directory based on information coming in from an XML and then place the XML within that directory, also based on the same value.
So directory ABC would have an XML within it called ABC.
I've gotten this to work by using the FileOutPut node and some ESQL as well:
SET OutputLocalEnvironment.Destination.File.Directory = 'D:\' || MyDir;
SET OutputLocalEnvironment.Destination.File.Name = InputRoot.XMLNSC.ns18:CaseImport.cmsCode;
How can I have this code check to see if the directory exists and if it does rename the existing directory with the original name of that directory and a datestamp?
I asked the user why I can't just rename if XML being placed within the directory, but they want the directory itself renamed. I told them I'm not sure that broker has the ability to rename an existing directory or not.
Thank you. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Dec 04, 2012 10:16 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
create the directory with a datestamp in the first place. |
|
Back to top |
|
 |
bdaoust |
Posted: Tue Dec 04, 2012 12:59 pm Post subject: |
|
|
Centurion
Joined: 23 Sep 2010 Posts: 130
|
The person wanting the directory does not want this because then when he dynamically goes to get to the directory, he won't know that exact name due to the datetime stamp. However, I'm thinking of creating the directory with the time date stamp and then sending him that value within the XML, which he can then parse to know what broker used at the time the directory was created. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Dec 04, 2012 6:45 pm Post subject: Re: Best Way To Handle File and Directory Management In Brok |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
bdaoust wrote: |
How can I have this code check to see if the directory exists and if it does rename the existing directory with the original name of that directory and a datestamp?
|
Are the directories created only from your flow? If yes, you can try this approach,
You can have a SHARED array which stores the dir names once they are created for the first time. Everytime you create a directory, check if the name already exists in the SHARED array. If yes, append a timestamp, else create it directly. |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Tue Dec 04, 2012 10:57 pm Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi bdaoust,
If nothing with built-in functionality or redesign helps you to solve the need you can perhaps consider to enhance brokers ability with Java.
--
Marko |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|