Reading ,Update & append files from FTP

Sort:
You are not authorized to post a reply.
Author
Messages
Ashish
Basic Member
Posts: 4
Basic Member

    Hi Team,

    Need your expert advice 

    I have to read multiple files from a FTP server directory update the data in file and append it in once file.

    I have used FTP node to get the file in Server and then use file access node to read the file in memory and then use Data Itarator to read each line content and replace some content using java script,but how can we read all file from a directory as we have to give name path in FTP. i have to read all .ord file fron directory.

    I am using Infor Cloudsuite MT Env .

    Can any body advice on this?

    as of now i am stuck in file access node  while reading the file 

    Activity completed: Start

    Activity started: FTP9410  (Run Id: 1)

    FTP9410_errorCode = 0
    FTP9410_informationCode = 0
    FTP9410_returnMessage = 
    FTP9410_outputData = 
    Activity completed: FTP9410

    Activity started: FileAccess690  (Run Id: 1)
    [Metrics - Workunit] WU Total Cpu:[875 ms] WU Total User:[812 ms] WU Total Duration:[12631 ms] WU Total Alloc:[17.86 MiB]
    [Metrics - Top list: Memory] WUDuration:[12631 ms] [#1 - |FTP9410|FTP|1x|10.32 MiB|687 ms|625 ms|11051 ms] [#2 - |FileAccess690|FileAccess|1x|1.26 MiB|31 ms|31 ms|677 ms] [#3 - |Start|Start|1x|0.63 MiB|0 ms|0 ms|17 ms] [#4 - |||0x|0.00 MiB|0 ms|0 ms|0 ms] [#5 - |||0x|0.00 MiB|0 ms|0 ms|0 ms]
    Process completed - 01/28/2021 15:39:08

    Error occurred while running the process
    Exception information:
    java.lang.NoClassDefFoundError: com/lawson/transactionmanager/TransactionLog
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.lawson.webservs.iface.ServiceFactory.getFactoryInstance(ServiceFactory.java:221)
        at com.lawson.webservs.iface.ServiceFactory.createInstance(ServiceFactory.java:166)
        at com.lawson.webservs.iface.ServiceFactory.createInstance(ServiceFactory.java:153)
        at com.lawson.webservs.iface.ServiceFactory.createInstance(ServiceFactory.java:143)
        at com.lawson.webservs.iface.ServiceFactory$Stub.createInstance(ServiceFactory.java:89)
        at com.lawson.rdtech.type.RemoteLOBLocator.getServiceInstance(RemoteLOBLocator.java:359)
        at com.lawson.rdtech.type.RemoteLOBLocator.getInputStream(RemoteLOBLocator.java:105)
        at com.lawson.rdtech.type.RemoteLOBLocator.getByteArray(RemoteLOBLocator.java:117)
        at com.lawson.rdtech.type.BLOBObject.getByteArray(BLOBObject.java:145)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgaFileAccess.readFileStorage(FgaFileAccess.java:1346)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgaFileAccess.executeInMultiTenant(FgaFileAccess.java:1119)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgaFileAccess.executeLocally(FgaFileAccess.java:711)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgaFileAccess.startActivity(FgaFileAccess.java:515)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgActivity.execute(FgActivity.java:1069)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgProcess.run(FgProcess.java:3024)
        at com.lawson.bpm.processflow.workFlow.flowGraph.FgProcess.run(FgProcess.java:2818)
        at com.lawson.bpm.designer.runtime.LocalFlowRunner.run(Unknown Source)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
    Caused by: java.lang.ClassNotFoundException: com.lawson.transactionmanager.TransactionLog
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 20 more

    Finished: 28 Jan, 2021 3:39:08 PM IST

    Ragu Raghavan
    Veteran Member
    Posts: 468
    Veteran Member
      You may need to do this is multiple steps -
      1. ftp all the .ord files to a local folder
      2. file access - list mode to generate a list of files in the local folder
      3. data iterator to process list from #2
      4. file access to process each file in the list
      Ashish
      Basic Member
      Posts: 4
      Basic Member

        Thanks Ragu, I will try but getting above issue while reading file using fileAccess node , listing of file is working  with File access. do you have any idea what could be the reason 

        Ragu Raghavan
        Veteran Member
        Posts: 468
        Veteran Member
          Are you able to read/write any file in that folder using the FileAccess node?
          Are you sure you have the file name (including the full path) correct?
          Ashish
          Basic Member
          Posts: 4
          Basic Member

            Hi Ragu,

            yes i am able to write the file in IPD server and File path is correct because i can able to list it as well. but i noticed when i writing the file it is stored in server as text type but when i move the file from SFTP to local server it is stored as type as Binary . that might be issue.

            so now i have to check how can we move files from sFTP to Local server as Text Type not Binary

            do you have any idea on it.

            and for reading file one by one i have used dataiterater activity node two times one as data for processing list files separed by comma, 2nd for reading line of file one by one ,used as file & separeted by line.

             

            Ashish
            Basic Member
            Posts: 4
            Basic Member

              Hi 

              I got the solution if i will test in server then its working 

              You are not authorized to post a reply.