Reply after Xlate in single thread

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Reply after Xlate in single thread

  • Creator
    Topic
  • #54784
    Elisha Gould
    Participant

      In Cloverleaf 6.1, Is there any way to have an inbound message translated by an Xlate, then reply after the Xlate in the same thread, or does it require a second thread to generate the reply?

      ie

      message inbound to thread 1 -> Xlate -> Continue and Reply Xlate -> Route continue to Thread X

      Or does it have to be:

      message inbound to thread 1 -> Xlate -> Continue to thread 2 -> thread 2 generates continue and reply -> Reply Xlate -> thread 1

    Viewing 3 reply threads
    • Author
      Replies
      • #82981
        Jim Kosloskey
        Participant

          Perhaps reroute will help you.

          In the first Xlate cut 2 messages wiith the second message specifieed for reroute (you can specify that right in the Xlate if you want) then on the route definitions for the IB thread specify the reroute TrxID and a new Xlate with the destination being the ib_thread.

          That might work.

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

        • #82982
          Elisha Gould
          Participant

            Thanks Jim,

            Is there a sample anywhere for this case?

            Otherwise I’ll have a play to try figure it out.

          • #82983
            Jim Kosloskey
            Participant

              I have done the reroute via Xlate.

              I have not done the rest but it seems all the pieces should work.

              So do you need an example of how to do the reroute in an Xlate?

              The User Doc on 6.0.0 is pretty clear but if you want I can see what I have and send that to you. Send me an email so I have your email.

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

            • #82984
              Elisha Gould
              Participant

                Many thanks Jim for your help with this.

                I ended up going with using an Xlate with the following Post Proc in the Route Message section.

                The Xlate stores the relevant information in the USERDATA.

                The result will kill or continue depending on the fault status in the USERDATA, and a reply message is rerouted to the Route Replies.

                The reply is handled in the Route Replies section and can handle different replies based on TRX id.

                Code:

                proc XlateReplySplitter {args} {
                   global HciConnName
                   keylget args MODE       aMode
                   keylget args MSGID      aMsgId
                   keylget args CONTEXT    aContext
                   keylget args ARGS       aArgs
                   if {$aContext eq “xlt_post”} {
                       set myMsgId [msgcreate -type reply -recover [msgget $aMsgId]]
                       set myConn [msgmetaget $aMsgId SOURCECONN]
                       set myUserData [msgmetaget $aMsgId USERDATA]
                       set myDriverCtrl [msgmetaget $aMsgId DRIVERCTL]
                       set myTrxId “”
                       keylget myUserData TRX_ID myTrxId
                       msgmetaset $myMsgId SOURCECONN $myConn DESTCONN $myConn USERDATA $myUserData DRIVERCTL $myDriverCtrl

                       set myDisp “{REROUTE {{$myMsgId $myTrxId}}}”
                       set myFaultString “”
                       keylget myUserData FAULT_STRING myFaultString
                       if {$myFaultString eq “”} {
                           lappend myDisp “CONTINUE $aMsgId”
                       } else {
                           lappend myDisp “KILL $aMsgId”
                       }
                       return $myDisp
                   }
                }

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