Is this possible?

 16 Replies
 1 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Ronnie
Veteran Member
Posts: 152
Veteran Member

    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??

    Terry P
    Veteran Member
    Posts: 234
    Veteran Member
      If you have Process Automation, use the FTP node.
      John Henley
      Posts: 3353
        Two other options:
        File Access node to read/write
        system command node to use copy / cp command
        Thanks for using the LawsonGuru.com forums!
        John
        Ronnie
        Veteran Member
        Posts: 152
        Veteran Member

          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.

           

          Joan Herzfeldt
          Veteran Member
          Posts: 74
          Veteran Member

            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

            John Henley
            Posts: 3353
              What IPA version?
              Is IPA on same server as LSF?
              Is the file on the IPA server or a different server?
              How are you reading the file (file access or iterator)?
              Thanks for using the LawsonGuru.com forums!
              John
              mikeP
              Veteran Member
              Posts: 151
              Veteran Member

                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:

                 

                 

                File locking problem

                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.

                John Henley
                Posts: 3353
                  Agree with Mike. Usually the best practice (particularly if LSF and IPA on different servers) is to use File Access to read the file, then use iterator over the data. This will prevent the locking. Also assumes the files aren't huge
                  Thanks for using the LawsonGuru.com forums!
                  John
                  John Henley
                  Posts: 3353
                    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.


                    Thanks for using the LawsonGuru.com forums!
                    John
                    Joan Herzfeldt
                    Veteran Member
                    Posts: 74
                    Veteran Member

                      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!

                      Ronnie
                      Veteran Member
                      Posts: 152
                      Veteran Member

                        It would just be moving a ton of files from one directory to another. 

                        John Henley
                        Posts: 3353
                          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


                          Thanks for using the LawsonGuru.com forums!
                          John
                          Ronnie
                          Veteran Member
                          Posts: 152
                          Veteran Member
                            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 Henley
                            Posts: 3353
                              I also use an inexpensive "file mover" tool called Syncovery ... it handles almost every protocol (UNC/SMB, FTP, AWS S3, etc. etc.) under the sun. It has scheduling, and it sends emails. Highly recommend it.
                              Thanks for using the LawsonGuru.com forums!
                              John
                              sadams
                              Basic Member
                              Posts: 8
                              Basic Member

                                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.

                                 

                                Thanks

                                Steve

                                sadams
                                Basic Member
                                Posts: 8
                                Basic Member

                                  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.


                                  Thanks

                                  Steve

                                  steve finger
                                  Veteran Member
                                  Posts: 47
                                  Veteran Member
                                    a simple solution would be to use the FTP node to transfer and rename the files. You must set up a configuration set and configure the FTP node in each set (server name/address, userID, and pwd) for each remote machine where you want to read or write a file...just like you have probably already configured the LSF server in the "main" configuration set's FTP node. the destination file name would be different from the source file name to do the renaming. Note that unless the server (either source or destination) is the IPA server, then the file path and name in the FTP node itself is supposed to be relative to the ftp home of the userid used in the FTP node configuration for that server. There are ways around that but are those are beyond the scope of this discussion

                                     

                                    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