Out of one, come two

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Out of one, come two

  • Creator
    Topic
  • #51661
    Jeff Manley
    Participant

      I am trying to write a tcl proc that takes one message in and creates two new messages, then kills off the first.

      I am using a foreach to zip thru repeating fields and create the two new messages.

      What is the code to create a new message and send it out?  I have tried msgcreate, but it does not seem to work right, or I am using it impropely.

      Then after the two messages are created/sent, how do I kill off the original message so it is not sent?  As normal?  lappend dispList “KILL $mh”

      Thanks,

      Jeff

    Viewing 1 reply thread
    • Author
      Replies
      • #71165
        James Cobane
        Participant

          Jeff,

          You can use the msgcopy command to create a copy of the inbound message (and retain the associated metadata) then KILL the original inbound message handle; i.e

          set newmh1 [msgcopy $mh]

          set newmh2 [msgcopy $mh]

          …other code to do whatever to the new messages….

          lappend dispList “KILL $mh” “CONTINUE $newmh1” “CONTINUE $newmh2”

          return $dispList

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #71166
          Jim Kosloskey
          Participant

            Jeff,

            Or you could do this with an Xlate (no need to KILL anything then) – your choice .

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

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