Sending Replies to a 3rd thread

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Sending Replies to a 3rd thread

  • Creator
    Topic
  • #55094
    Rob Lindsey
    Participant

      OK… I have a special case here I need to take the replies from a Web Service call that I have setup in a TPS proc that sits on the outbound tab in of the outbound thread.  The reason for using TclCurl is that the vendors web service call requires a lot of specialized HTTP headers that change depending on the data message and other fields within the data that need to change.  So I am putting this on the OB TPS stack on the outbound tab.  I want to take the reply from the TclCurl call, that comes back and Route it to a third thread.

      Thread_1 –> Thread_2 –> Thread_3

      Thread 1 receives the data from an internal system.  It converts it from XML to HL7 and routes it to Thread_2.  Thread_2 sends the data to the Web Service via the Outbound TPS stack.    Thread_3 is an outbound thread that needs to receive the Reply received on Thread_2.  I just don’t know how to put the data in the right context on Thread_2 so that the data will go out via the “Route Replies” tab on Thread_2.

      Thread_2 is setup as outbound only.

      I have tried OVER and REROUTE and CONTINUE.  

      Has anyone ever done this?

      Thanks in advance.

      Rob

    Viewing 2 reply threads
    • Author
      Replies
      • #84058
        Jim Kosloskey
        Participant

          Depending on the release of Cloverleaf:

          Some releases (later ones in thee 6.x familly I thiink) I believe you can Route Reply on the outbound thread and route to a 3rd thread.

          On earlier releases you can configure the Route Reply but the only place it will go is to the originating thread (thread11 in your case I think) – not what you want.

          In the second case what I have done is to Copy the reply, OVER the COPY so it gets on the inbound side of the outbound thread – this means you can now do a Route Data to thread3 – and KILL the Reply.

          I have a proc which does that – if you woud like to have it as a base email me.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #84059
          Robert Milfajt
          Participant

            Yes, we have done that here at NM on Cloverleaf 6.0 rev 1.  Here is what we did.  Using your model with Thread 1, 2 and 3.

            1.  Thread 2 is not outbound only and Protocol is http-client.

            2.  Under HTTP Client Protocol Properties I have a Query TPS which uses tclcurl to run http post command (so not same as yours in that regard).  The following code excerpt is how I process the reply.

            Code:

                                   # check for     success (status code 100-299)
                                   if {($statCode >= 100) && ($statCode $repmsg<"
                                        msgmetaset $outMsg DESTCONN $destconn
                                        msgmetaset $outMsg SOURCECONN [msgmetaget $mh DESTCONN]
                                        msgmetaset $outMsg DRIVERCTL [msgmetaget $mh DRIVERCTL]
                                                           
                                        lappend dispList "KILL $mh"
                                        lappend dispList "OVER $outMsg"
                                   } else {
                                        # otherwise, report     the     error and send orig     msg     to error DB
                                        set msg "(httpQuery/Run) Error fetching URL $url: $status"
                                        lappend dispList "PROTO $mh"
                                   }


            3.  Since I created a data message, and since not outbound only, I can use normal Route Messages and treat message as a normal message to Thread 3 with Xlate, etc.

            Hope this helps,

            Robert Milfajt
            Northwestern Medicine
            Chicago, IL

          • #84060
            Rob Lindsey
            Participant

              Thanks all for the replies.  I also talked to a few people off board and got this up and running.

              It is setup just like Robert points out in the above post.  Thread2 needs to NOT be an outbound only.  I wrote in the TCL proc that sends the data to the web service to OVER the reply to the inbound side of Thread2 and route all messages to Thread3.

              It has worked very well so far.

              Thanks again for everyone replying.

              Rob

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