KILL $mh help

  • Creator
    Topic
  • #51227
    mike brown
    Participant

    I have this tcl script that is leaving a instance of the message in the RDB when it processes the message through the engine. I know I need a KILL $mh, but where I need this KILL the problem.

    I tried to put it in several places in the tcl script, but it either stops the message totally or it keeps leaving one in the RDB with no destination.

    any help appreciated, tcl script below. thanks in advance

    Stuck in RDB                                              Source                         dest

    11:33:29  [0.0.3784014] P D N 5120     1   1320 coldfd_ftp_adm_  

               

    11:08:34  [0.0.3783837] P D N 5120     1   1320 coldfd_ftp_adm_    

               

    11:25:48  [0.0.3783922] P D N 5120     1   1320 coldfd_ftp_adm_    

               

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

    # Name: x_sms_coldfeed_frl_oru_shift1

    # Purpose:

    # UPoC type: tps

    # Args: tps keyedlist containing the following keys:

    #

Viewing 5 reply threads
  • Author
    Replies
    • #69276
      Robert Kersemakers
      Participant

      Hi Mike,

      At the end of your proc, you do an

      Code:

      if {[cequal $new 1]} {


      On TRUE, you CONTINUE the message, but nothings happens when this condition is FALSE, so the message gets stuck. I think you need to use an ELSE with this IF to KILL the message if the condition is not met.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #69277
      mike brown
      Participant

      I am now confused, i added the else to my proc :

         if {[cequal $new 1]} {

             set newmsg “”

             set new “0”

             

                       append newmsg $mshr

                       append newmsg $pidr

                       append newmsg $orcr

             append newmsg $obxlst

                       set mh [msgcreate]

                       msgset $mh $newmsg

                      lappend dispList “KILL $mh”

            lappend dispList “CONTINUE $newmsg”

            set obxlst “”

                      } else {

                      lappend dispList “KILL $mh”

                     }

                  }

      }

             }

             time {

                 # Timer-based processing

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

             }


      now i get this in my testing tool ROUTE TEST :

      Output going to stdout

      INBOUND TPS PROCS

      PROC=x_sms_coldfeed_frl_oru_adm ARGS=

      RUNNING INBOUND TPS IN START MODE

      DONE STARTING INBOUND TPS

      ADMISSION  ASSESSMENT —

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :WARN/0:  UNNAMED_TID:10/07/2009 12:14:29] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [tps :tps :

      In my TPS TEST I get this

      [0:TEST] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [0:TEST] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [0:TEST] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [0:TEST] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [0:TEST] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      [0:TEST] ‘x_sms_coldfeed_frl_oru_adm ‘ returned bogus strMsgId ‘message0’ — ignored

      any ideas… I have seen these errors mentioned in CL before but no answers..

    • #69278
      Robert Milfajt
      Participant

      What I see is that you are trying to CONTINIE $newmsg, which is the actual message and not a message handle.

      You are using mh to be both your new message handle and your existing message handle.  I believe you need to use another variable, like new_mh for your new message handle.  Then you would just CONTINUE $new_mh and KILL $mh.

       

      Hope this helps,

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #69279
      Robert Kersemakers
      Participant

      Robert is right, I overlooked the ‘set mh [msgcreate]’.

      You either use the current mh to put the new message in (‘msgset $mh $newmsg’ without a msgcreate) and CONTINUE this message, or you create a new messagehandle (‘set new_mh [msgcreate]’), CONTINUE this new_mh and KILL the mh.

      This probably explains though what you are doing in your IF: creating a new message. But you still need to handle (either KILL or CONTINUE) your current message.

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #69280
      Charlie Bursell
      Participant

      If you use msgcreate here it will probably blow up on you.  Since there is no meta data the engine does not know how to treat the message.

      Use msgcopy instead to maintain the meta data.

      set newMh [msgcopy $mh]

      msgset $newMh $data

      lappend displist “CONTINUE $newMh” “KILL $mh”

      or whatever

    • #69281
      mike brown
      Participant

      Thanks Robert and Robert and Charlie, I understand it now, I am working on it as this comes to you. your help is greatly appreciated.. thanks again

      mike

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10