Maintain IB File name in OB message

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Maintain IB File name in OB message

  • Creator
    Topic
  • #53976
    Danny Wheeler
    Participant

    I have looked at several posts that all seem to be older posts on this topic.  I have yet to find a solution for this problem.  I need to be able to maintain the IB file name when using Fileset/local and moving files.  Has anyone solved this?  I am on Windows 5.8.5.  Thanks!

Viewing 9 reply threads
  • Author
    Replies
    • #79738
      Jerry Tilsley
      Participant

      See code below, I’m sure there can be improvements in it, but it gets the job done!

      Hope this helps!

      Jerry

      Code:

             

      keylget args MSGID mh
      echo “MODULE: ”

      #Get the metadata portion that contains the inbound filename
      #with directory path.
        set filepath [msgmetaget $mh DRIVERCTL]

      #Split it up so we can pull just the filename.
        set parse [split $filepath “/”]

      #Get only the filename, always the last item in the index.
      #Truncate the extra bracket from the righthand side.
        set filename [string map {”}” “”} [string range [lindex $parse end] 0 end-1]]
        echo “FILENAME: ”

      #Append the filename to the OBFILE metadata.
        msgmetaset $mh DRIVERCTL “{FILESET {{OBFILE $filename}}}”

      #Continue the message.
        lappend dispList “CONTINUE $mh”

    • #79739
      Danny Wheeler
      Participant

      Where do you normally place this proc?  I actually got this proc from a earlier post and could not get it to work.  I am realizing now that maybe I am placing it in the wrong place?  I have two threads File_Inbound > File_Outbound.  I was placing this in the File_Inbound inbound TPS and the File_Outbound Outbound TPS sections.  Is this incorrect?

    • #79740
      Jerry Tilsley
      Participant

      I use the proc during the translation on a RAW type route.

    • #79741
      Danny Wheeler
      Participant

      When I do this it continues to use the required name I place in “File” on the Fileset/Local tab.  I feel like I am doing something silly but I cannot pinpoint it.

    • #79742
      Jim Kosloskey
      Participant

      Danny,

      I have a proc that does what you want. I place mine in the outbound Tps on the Outbound thread.

      If the proc you are using is one you got from me email me and I will help you.

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

    • #79743
      Jerry Tilsley
      Participant

      Does the “echo” statement print out the name in the testing tool or logs to show it is pulling the name correctly?

    • #79744
      Jim Kosloskey
      Participant

      Danny,

      I just noted you are using the FILE Protocol.

      I do not believe you can change the file name on the fly in using the FILE Protocol.

      Try to use the Fileset/Local protocol – among other things you can change the file name in that protocol.

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

    • #79745
      Danny Wheeler
      Participant

      I finally got it working.  The issue ended up being a TCL callout error:

      [xlt :xlat:ERR /0:Radiology_xlate:12/23/2013 14:44:59] Tcl error:

      msgId = message0

      proc = ‘tps_set_obfilename_eq_ibfilename2’

      args = ”

      result = ‘can’t read “module”: no such variable’

      errorInfo: ‘

      can’t read “module”: no such variable

         while executing

      “echo “MODULE: “”

         (“run” arm line 4)

         invoked from within

      “switch -exact — $mode {

             start {

                 # Perform special init functions

         # N.B.: there may or may not be a MSGID key in args

            …”

         (procedure “tps_set_obfilename_eq_ibfilename2” line 6)

         invoked from within

      “tps_set_obfilename_eq_ibfilename2 {MSGID message0} {CONTEXT xlt_raw} {ARGS {}} {MODE run} {VERSION 3.0}”‘

      I removed this line (echo “MODULE: ) and it allowed it to process correctly.  Thanks so much for you help!

    • #79746
      Jim Kosloskey
      Participant

      Danny,

      Glad to hear it is working.

      Did you get this working with FILE Protocol or Fileset/Local protocol?

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

    • #79747
      Danny Wheeler
      Participant

      2 FilesetLocal Threads.

      1) Inbound_file

      2) Outbound_file

      I then placed this proc in the raw route message detail.

      Inbound_file > HCI_static_route_ raw (this proc) > Outbound_file

      Thanks so much for your help.

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10