Is it possible to get trxID of a message from the meta ?

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Is it possible to get trxID of a message from the meta ?

  • Creator
    Topic
  • #54290
    Anwar Husain
    Participant

      Hi,

      Is it possible to get trxID of a message from the meta properties, after it has got through translation, without running the trxID routine again on the source message?

      I am trying to log the entry & exit of messages. I would like to find the trxID of the source message from a destination message. For eg: message M1 gets

      translated to M2. I can get M1 is MID from M2’s metadata (SOURCEMID). Is it possible to query M1 or M2 to get M1’s trxID ?

      Thanks

      Anwar

    Viewing 7 reply threads
    • Author
      Replies
      • #80890
        James Cobane
        Participant

          Anwar,

          The TRXID is not stored as part of the metadata, but you could store it in the metadata using the User Metadata field.  You would need a proc to pull the TRXID from the message and store it into the User Metadata field; i.e.

          msgmetaset $mh USERDATA “Your TRXID here”

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #80891
          Anwar Husain
          Participant

            Thanks James. I thought of the idea, but yes, we would need a proc doing that.

            Thanks for your time again.

            Anwar

          • #80892
            Terry Kellum
            Participant

              I think the message is protected from writing in the TrxID proc.

              I’m wondering if this goes for the Metadata as well…?

            • #80893
              Richard Hart
              Participant

                Hi Anwar.

                We use this routing method frequenty. Our ‘generic’ routing TCL code is:

                proc gen_code_trx_id {aMsgId} {

                 

                               #

                               # The Application is in the message user data set in the xlate function

                               #

                       set myTrxId [msgmetaget $aMsgId USERDATA]

                       return $myTrxId

                }

                You will need to ensure that the ‘Trx Id determonation Format’ information is set correctly (newer versions have UPOC) in the NetConfig file and that the meta data is set correctly for ALL messages in another TCL script with appropriate logic.

                eg

                set myRoute A

                if {} {

                   set myRoute B

                }

                msgmetaget $aMsgId USERDATA $myRoute

              • #80894
                Anwar Husain
                Participant

                  Many thanks Richard & Terry.

                  How do I get access to the USERDATA metafield in the Xlate pane ? I don’t see getting access to the message handle for querying the metadata.

                  Thanks

                  Anwar

                • #80895
                  Mark Thompson
                  Participant

                    Hi Anwar,

                    In an xltp proc, $xlateId is the message handle.  You can use:

                    Code:

                    xmpmetaget $xlateId USERDATA


                    to access USERDATA.  Other metadata keys are also available.

                    This is a powerful way to communicate information about a message as it passes through various stages of Cloverleaf.  Many people choose to treat USERDATA as a keyed list, allowing it to organize and store multiple values.

                    - Mark Thompson
                    HealthPartners

                  • #80896
                    Anwar Husain
                    Participant

                      Perfect. Thanks Mark. Have a good day.

                      Thanks

                      Anwar

                    • #80897
                      Russ Ross
                      Participant

                        Anwar Husain:

                        I posted an example of a xlt proc ( xlt_USERDATA_keylset.tcl ) I wrote to set user meta-data at this URL to show exactly how others could do the same thing.

                        <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=1367&highlight=xltuserdatakeylset&#8221; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1367&highlight=xltuserdatakeylset

                        Since the proc is argument driven you can simply use it without having to do much inventing yourself.

                        The post also shows how my downstream outbound interface extracts the user meta-data of interest, which might be a similar enough example to be somewhat applicable for you to use parts of.

                        Even though my downstream logic is embedded in a downstream UPOC, the logic could have been inside a TPS proc and worked in case you are wondering about that.

                        As others have mentioned I choose to have user meta-data be a keyed list so multiple things could be valued for a single message if desired.

                        Russ Ross
                        RussRoss318@gmail.com

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