fileset-ftp examples/documentation

Clovertech Forums Read Only Archives Cloverleaf Documentation fileset-ftp examples/documentation

  • Creator
    Topic
  • #52985
    Ed Hafner
    Participant

      Just looking for a little help w/ using this protocol.

    Viewing 5 reply threads
    • Author
      Replies
      • #76171
        Jim Kosloskey
        Participant

          Ed,

          I don’t have any examples, etc. to share with you but if you email me I will try to walk you through the basics.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #76172
          Scott Folley
          Participant

            The options available in the GUI are fairly self-explanatory, I think.  That said, all of those options can be overridden using the DRIVERCTL metadata field within the message.

            First, there is the question of inbound vs outbound.

            Both Fileset-FTP and Fileset-Local handle the inbound the same way, by default they will read everything in the directory specified and delete it when they are done.  How the messages enter the engine is determined by the style.  If the style is single or eof then the full content of the file will be in the message.  If the style is hl7 or nl then each file will be split accordingly and the content of the message just one hl7 or nl terminated message.  When you use the latter methods there is a fileset file that is created in the applicable process directory that keeps track of where in the file the process was at (in case the process is cycled before the engine is done with the file).  That is very important because if you want to start over with the file you have to get rid of that fileset file or you will have problems.

            If you do not want to process all of the files in the directory then you will have to create directory parse and deletion parse procs.  Those procs get a list of the files that are in the directory (not the contents of the files but a file listing).  You can then use TCL to traverse the list and remove any that you do not want to process.  Once you have removed them you continue the message and the Inbound TPS will get a message with the FILE CONTENTS.  If you want the original filename it is held in the message metadata.  The deletion parse gets passed the list of files that came out of the directory parse and you remove from that list any files that you do not want to be deleted.  Keep in mind that you must do something with the files or they will still be there and will be processed by the next iteration.

            Okay, that is how the inbound works.  I will separate the outbound into another post because this one is getting long.

          • #76173
            Scott Folley
            Participant

              OUTBOUND:

              Here is a basic proc that shows how you use the DRIVERCTL metadata

              Code:


              proc ftpAdtOutputFileVPN { args } {
                 keylget args MODE mode                      ;# Fetch mode

                 set dispList {}                             ;# Nothing to return

                 switch -exact — $mode {
                     start {
                         # Perform special init functions
                         # N.B.: there may or may not be a MSGID key in args
                     }

                     run {
                         # ‘run’ mode always has a MSGID; fetch and process it

                         keylget args ARGS.ACCTNUM acctnum
                         set timestamp [ clock format [ clock seconds ] -format %Y%m%d%H%M%S ]
                         set transTimeInClicks [ clock clicks ]

                         keylget args MSGID mh
                         set extension “DAT”
                         set prefix “CLF”
                         set outboundFilename “$prefix$timestamp$acctnum$transTimeInClicks”
                         set filename “$outboundFilename.$extension”
                         keylset fileKeys OBFILE $filename
                         keylset filesetKeys FILESET $fileKeys
                         msgmetaset $mh DRIVERCTL $filesetKeys
                           lappend dispList “CONTINUE $mh”
                     }

              I have only included the run mode and I have only included the OBFILE key in order to set the outbound filename but there are keys that match the password and the username and the host, etc…

              There is almost nothing that you cannot change about the outbound using this technique.  You just put a proc like this on the Outbound TPS, configure the thread to be Fileset-FTP and voila!

              Here is the list of the other keys that you have available:

                 FTPACCT

                 FTPCLOSE

                 FTPHOST

                 FTPOBDIR

                 FTPPASSWD

                 FTPPORT

                 FTPTYPE

                 FTPUSER

                 OBAPPEND

                 OBDIR

                 OBFILE

                 OBSTYLE

              This comes from the help under configuration->protocols->Fileset FTP but it is a little difficult to follow without understanding the code snippet above.

              Enjoy!

            • #76174
              Ed Hafner
              Participant

                Jim/Scott,

                I appreciate your help and the time you put into your replies.

              • #76175
                David Barr
                Participant

                  Ed Hafner wrote:

                  Jim,

                  Just for reference – I determined that on VMS the command is ‘nlist’ instead of ‘nlst’.

                  Are you sure about that? There are two types of ftp commands: commands to type at the FTP client prompt and the raw commands that the client sends to the server. I think that nlist is a client command and nlst is a raw command. There are similar pairs of commands like put/stor, mkdir/mkd, etc. What you enter in the netconfig field for “dir list command” is the raw command and is usually nlst.

                • #76176
                  Charlie Bursell
                  Participant

                    If you are attempting to use The Cloverleaf FTP with VMS it probably will not work.

                    Cloverleaf uses Curl internally.  Curl attempts to size the file going up or down to make sure it was transferred.  Curl looks at bytes and VMS does its size in clocks so they will never match.  When I spoke to the guy that developed Curl he said he had never seen a VMS box.

                    I have done it but had to use the FTP library from TclLib

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