Reply To: Question on Regular Expression routing

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Question on Regular Expression routing Reply To: Question on Regular Expression routing

#58026
Peter Heggie
Participant

    That worked – thank you

    This is the trxid proc:

    Code:

    proc trxidFileName { msgId } {
       set msg [msgget $msgId]

       set debug 1
       set module “trxidFileName”
       if {$debug > 2} {echo “$module msg: $msg”}

       # Get the metadata portion that contains the inbound filename with directory path.
       set driverctl [msgmetaget $msgId DRIVERCTL]
       if {$debug > 1} {echo “$module input file path key: $driverctl”}

       # If the output file name is already set, use that name, else use default input file name
       set obfilepos [string first “OBFILE” “$driverctl”]
       if {$obfilepos > -1} {
           set result [keylget driverctl FILESET.OBFILE filename]
         } else {
           set result [keylget driverctl FILENAME filename]
         }
       if {$debug > 1} {echo “$module keylget filename result: $result filename: $filename”}

       # check for error getting the filename from DRIVERCTL – set trxid to error text for visibility in process log
       if {$result eq 0} {
           echo “$module ERROR – unable to keylget filename from DRIVERCTL $driverctl”
           return “ERROR_filename”
       }

       set basename [file tail “$filename”]
       if {$debug > 1} {echo “$module input file name: $basename”}

       set trxid “$basename”
       if {$debug} {echo “$module trxid: $trxid”}

       return $trxid        
    }

    I have attached a picture of the routing.

    I’m trying to strike a balance between a clever solution that requires no dynamic routing logic in each pre-translate proc (andwhich is also ‘self-explanatory’ in the routing syntax), and a ‘normal’ solution that requires only a basic understanding of Cloverleaf filtering in tcl.

    Peter Heggie
    PeterHeggie@crouse.org