TrxId Upoc to determine File Name

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf TrxId Upoc to determine File Name

  • Creator
    Topic
  • #53384
    Raj
    Participant

    Can some one tell me what am I missing here i want to find file name from a directory and set the Trxid to route message.I am missing something which i am unable to know in the code i built here is error i get when run route test

    Please Wait ……

    Command Issued: hciroutetest -x ASCII -d -f eof -e hciroutetestshowbydest Test_In /hci/cis5.8/integrator/fm_finance/Data/WESTR_PARK_NIC_2K12_410834920_NOPAY20121109130507.835

    Command output:

    Output going to stdout

    UNKNOWN_FILE_NAME

    [xlt :rout:ERR /0:  UNNAMED_TID:11/27/2012 12:10:33] No routes defined for TrxId ‘UNKNOWN_FILE_NAME’

    Below is TCL Upoc code i sm trying to wor on please some one can tell what i am missing or what should i be doing to get this file name Trxid working .

    ######################################################################

    # Name: trxid_Filename

    # Purpose:

    # UPoC type: trxid

    # Args: msgId = message handle

    # args  = (optional) user arguments

    # Returns: The message’s transaction ID

    #

    # Notes:

    # The message is both modify- and destroy-locked — attempts to modify

    # or destroy it will error out.

    #

    proc trxid_Filename { mh {args {}} } {

       global HciConnName                          ;# Name of thread

       

       keylget args MODE mode                         ;# Fetch mode

       set ctx “”   ; keylget args CONTEXT ctx        ;# Fetch tps caller context

       set uargs {} ; keylget args ARGS uargs         ;# Fetch user-supplied args

     

       set debug 0  ;                                 ;# Fetch user argument DEBUG and

       catch {keylget uargs DEBUG debug}              ;# assume uargs is a keyed list

     

       set module “trxid_Filename/$HciConnName”   ;# Use this before every echo/puts

     

       set msgSrcThd [msgmetaget $mh SOURCECONN]   ;# Name of source thread where message came from

                                                   ;# Use this before necessary echo/puts

                                                    ;# args is keyed list when available

       

       set msg [msgget $mh]

         

             # Get the IB message handle

               keylget args MSGID mh

       # Original filename should be in the meta data

       # if not, default to UNKNOWN

       # Default name

       set OBFN UNKNOWN_FILE_NAME

       # Get driver control metadata

       set klst [msgmetaget $mh DRIVERCTL]

       # Get file name and remove from path

       keylget klst FILENAME OBFN

       set OBFN [file tail $OBFN]

                 echo $OBFN

                 return $OBFN

                           

                 if{[lcontain

  • $OBFN]}{

           set trxId “TRICARE”    ;# determine the trxid

                    }else{

           set trxId “UNKNOWN”

                    }

          echo $trxId

                    return $trxId           ;# return it

             

               }

    Thanks

    Raj 🙂

Viewing 2 reply threads
  • Author
    Replies
    • #77520
      Jerry Tilsley
      Participant

      Echo out the $OBFN variable before and after you use the file tail command to be sure the variable is being populated as you would expect them go from there.  Also, because of the return statement in the middle of your code, you never get to the if statement, just a FYI.

    • #77521
      Vaughn Skinner
      Participant

      Does the DRIVERCTL have a FILESET?

      Here is code from a working files_out proc.  I cut out extraneous code.  This only sets the directory and leaves the filename alone.  You might be able to do something similar from the trxid proc.

      proc files_out_ld_route_minimal_out { args } {

       set dispList {}

       keylget args MODE mode                ;# Fetch mode

       switch -exact — $mode {

         start {

         }

         run {

           keylget args MSGID mh

           set msg [msgget $mh]

           set base_outdir “/ftp/Labdaq/Cloverleaf/results_minimal”

           ##############################

           # set the directory name

           ##############################

           set driverctl [msgmetaget $mh “DRIVERCTL”]

           set fileset {}

           keylget driverctl “FILESET” fileset

           set outdir “/new/out/dir”

           # add OBDIR back into the FILESET key without clobbering any filenames that are there

           keylset fileset “OBDIR” $outdir

           keylset driverctl “FILESET” $fileset

           msgmetaset $mh DRIVERCTL $driverctl

           lappend dispList “CONTINUE $mh”

         }

         time {

           # Timer-based processing

         }

         shutdown {

         }

         default {

           error “Unknown mode ‘$mode’ in fileset_numfile_out”

         }

       }

       return $dispList

      }

    • #77522
      Russ Ross
      Participant

      I did not take the time to look in great detail at your proc to solve all your concerns but your failed test brought to my attention a point that you may have overlooked.

      Be sure to define a route for all possible trixId possibilities or include one for static raw that kills all the messages thus acting as a catch all for trixIds that have no route defined.

      Apparently you had no route defined for the trixId=”UKNOWN_FILE_NAME” in addition to the expected TrixId value of TRICARE.

      To be consistant with the bottom half of the proc where you (set trxId “UNKNOWN”) you might consider just setting the default OBFN to UNKNOWN instead of UNKOWN_FILE_NAME.

      Russ Ross
      RussRoss318@gmail.com

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

Forums

Forum Statistics

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