We currently have a server that has a scheduled task on it to run an executable. That executable takes files from one directory and moves them to another.
Is there a way that a process flow can be written that can take files and move them from one directory to another?
I know there is a file access node that can be used to check a location to see if a file exists, but what about moving files??
Thanks,
say its not just an individual file that needs moved, but more like 20,000 files from a folder every week that need to get moved.
I want to do the same thing except that at the end of the flow I want to move the file that was just read to a new location. I tried a FTP Node and IPA says the file is in use and will not move it. Is there a way to make IPA close the file so I can move it? Or is there a better way to do this?
Thanks
Joan
Did you read the file using a Data Iterator and terminate the loop before all records were read? I found that if I broke out of an iterator loop with an error handler, the loop would not complete, and the file being read would be locked. Here's my notes, including a workaround:
If you configure a Data Iterator to read a file directly using input method “File”, and the iterator is interrupted by an error before it reads all the records in the file, the input file may be locked; held open by the java runtime. In testing, this happened when an error was trapped by an error hander and control went to a node in the process that is outside the iterator loop. I did not test what happens if you stop the process when an error occurs.
When the file is locked, subsequent runs of the process won’t be able to access it, e.g., FTP a new version of the file into place, or to delete it; nor can it be deleted manually via Windows Explorer using a file share. This happens when running on the IPA server or on the PC in IPD.
A workaround is to configure the iterator input method to “Data”, read the file using a File Access node, then feed that node’s output data into the iterator. Presumably this works because the File Access node reads the entire file without interruption.
Another option would be to set an error flag when the error occurs, handle the error, then linking the last node of the error handler to the iterator’s end node. Then, first thing in the iterator loop, test the error code and branch directly to the end node if it was set. This would allow the iterator to complete, and presumably release its input file. That might result in many needless iterations if the error occurred early in a large file.
Posted By Ronnie on 10/26/2015 12:05 PM say its not just an individual file that needs moved, but more like 20,000 files from a folder every week that need to get moved.
Are you processing the files, or just moving them?
If just moving them, I would use a 'mv' command from the system command node. That is fastest.
IPA is version 10.1.1; The file is on the IPA server and yes they are different servers.
I'm picking up the file via an FTP from an outside source and putting it on the IPA server, then using a data iterator to read the file/records. What Mike explained is definitely what's happening in my flow. Thanks for the couple work arounds. I'll have to see which one works best.
thanks!
It would just be moving a ton of files from one directory to another.
Posted By Ronnie on 10/26/2015 1:30 PM It would just be moving a ton of files from one directory to another.
If it's windows, just use a task scheduler and robocopy
Posted By John Henley on 10/26/2015 1:36 PM Posted By Ronnie on 10/26/2015 1:30 PM It would just be moving a ton of files from one directory to another. If it's windows, just use a task scheduler and robocopy
thats what we are doing currently is using task scheduler and an executable that runs that moves the files. Something came up where a department wants to be able to get an email if this fails or does not run...and it was suggested to maybe move this process to a processflow.
John, do you have an example of using IPA (File Access or FTP) to copy files from a remote Server? I'm trying to transfer the file(s) and change the name of the individual files that are transferred. Ultimately trying to move a file to process the PR530 for multiple companies in their individual folders.
Steve
Mike, do you have an example of using IPA (File Access or FTP) to copy files from a remote Server? I'm trying to transfer the file(s) and change the name of the individual files that are transferred. Ultimately trying to move a file to process the PR530 for multiple companies in their individual folders.
In the PFAdmin program in the rich client (or the web version), the FTP node configuration is done in the "File Transfer" tab....hope that saying "configure the FTP node" didn't unnecessarily confuse you