Creating a New Message From a Directory Parse

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Creating a New Message From a Directory Parse

  • Creator
    Topic
  • #48894

    Cloverleaf 5.2.1

    fileset-Local/Directory Parse

       1) tpsScanDir -> passes a list of files (dispList: {CONTINUE message0})

       2) tpsPdfToTxt -> converts the files to text, passes a list of files (dispList: {CONTINUE message0})

       3) tpsMs4ParseTxt -> parses the text, creates new xml messages, passes the xml messages (dispList: {KILL message0} {CONTINUE message1} {CONTINUE message2} {CONTINUE message3})

    Route

       – static/raw

    Code Snippet

               

    Code:

    set fileList [msgget $mh]
               lappend dispList “KILL $mh”

               …. (loop) …

                       set newMsg [join $xmlMsg “”]
                       set mh [msgcreate -recover $newMsg]
                       lappend dispList “CONTINUE $mh”

    Why doesn’t this work?

    -- Max Drown (Infor)

Viewing 3 reply threads
  • Author
    Replies
    • #60029
      Michael Hertel
      Participant

        The $mh points to a message which contains the filenames only, not the data in the files.

        Number 1 should be done where it is,

        number 2 and 3 need to be done in inbound tps (where $mh points to the actual data in the file).

      • #60030

        Could someone post a brief summary of what happens to the messages between a directory parse and the inbound tab?

        -- Max Drown (Infor)

      • #60031

        More detailed information on what I need this interface to do …

        The sending application FTPs PDF documents to our server. The interface has to do two things: 1) parse the PDF and create an outgoing XML message, and 2) uuencode the original PDF and insert the results into a field in the XML message. The interface sends the outgoing XML message to our document repository using the MQ Series protocol.

        What is the best way to do this using Cloverleaf?

        -- Max Drown (Infor)

      • #60032
        Mike Grieger
        Participant

          For your question on Directory Parse, I’ll try to give a quick overview:

          The Dir. Parse tps is basically to give flexibility on choosing which files in the configured directory that you want to process.  The message handle delivered to this will be the list of files in the directory.  The list that you return will be the list of files that you want to process (so you can have logic to determine if you only want a certain file extension, file names, etc.  or even make copies of the files before processing and that sort of thing).

          The Deletion proc works about the same – but the list returned here would be the list of files to Delete after being read in.  So if this is blank, all of the files read in to Dir Parse will be ‘consumed’.

          From here, it is just like using a File protocol thread.  The data is sent through message by message as you have it configured (EOF, etc.).

          Hope that helps.

      Viewing 3 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.