Creating and Posting Message to a Specific Thread using TCL

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Creating and Posting Message to a Specific Thread using TCL

  • Creator
    Topic
  • #54560
    Tahir Shaikh
    Participant

      How do we post a message to a specific thread in a site using Tcl.  Problem statement goes like this. [flow diagram attached]

      I have a tcp/ip thread named “user_in” under the process name of “USERS” this thread based on user inputs queries the database and create a message let say “Input Result” now we need to post this message to another tcp/ip thread named “db_in” under the process name of “DATABASES”. All the threads are under the same site name “testsite”

      How do we achieve this using tcl script . Based on forum inputs i have written the following script but it does not seems to work.

      Code:



      set destinationThread “db_in”
      set databaseResult “Input Result”
      set metadata “ORIGSOURCECONN $::HciConnName SOURCECONN thread DESTCONN $destinationThread ORIGDESTCONN $destinationThread TYPE data CLASS engine”
      set newMessage [msgcreate -recover -meta $metadata]
      msgset $newMessage $databaseResult
      return lappend dispList “KILL $mh” “CONTINUE $newMessage”

    Viewing 0 reply threads
    • Author
      Replies
      • #81968
        Peter Heggie
        Participant

          I am not very knowledgeable about setting destinations in the meta-data, but an alternative is to perform the routing logic in the Trx ID Determination in the Inbound tab. Set the format to UPOC. Create a tcl proc to execute in this position, and the result returned from the UPOC is a ~name~ that is used in the routing. So your Thread Routing will have routes like DB_IN1 and DB_IN2, with raw or xlate route details to these destinations. So your new Trx ID UPOC tcl will examine the message and generate a result of ‘DB_IN1’ or ‘DB_IN2’, and this value will be used for routing.

          Maybe someone can respond to the question – is there a way to ‘jump’ to any thread from any other thread by supplying the target thread name in the meta-data?

          Peter Heggie

      Viewing 0 reply threads
      • The forum ‘Tcl Library’ is closed to new topics and replies.