getting message from within an xlate call or copy in the pre

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf getting message from within an xlate call or copy in the pre

  • Creator
    Topic
  • #55486
    Bob Schmid
    Participant

      drawing a blacnk – I would ike to do something like a msgget from within the preproc code inside the xlate

      so I have $xlateId…….. so is there an analogous “msgget” in xpm ?

    Viewing 7 reply threads
    • Author
      Replies
      • #85521
        Keith McLeod
        Participant

          Look up your xpm commands.  I don’t recall there being an xpmmsgget.  Or are you just after the metadata in which case you would use xpmmetaget $xlateId

          returns keys that you can get information on the message back…

        • #85522
          Bob Schmid
          Participant

            🙁   gotta be away to get ahold of entire message for making decisions via string and / regexp commands

          • #85523
            Jim Kosloskey
            Participant

              I think in one of the later releases (perhaps 6.2) there is an option to have the message stored in the metadata (probably User Data).

              If you are not on one of those releases then a simple proc either tps Inbound or pre-xlate could do the same.

              Once in the User Data Metadata field, you could capture the message inside an Xlate Proc from the User Data metadata field.

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

            • #85524
              Jim Kosloskey
              Participant

                Here is the issue though I think:

                If you do anything to the message I don’t think it will be reflected in what the Xlate sees as the message is already parsed.

                So the most useful thing I think one could do is to just search the message for some string or such but changing the message at this point I don’t think will accomplish anything.

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

              • #85525
                Keith McLeod
                Participant

                  Can you provide an example of what you are trying to accomplish.

                • #85526
                  Rob Abbott
                  Keymaster

                    Hi Bob

                    Best way to do this is to have a pre-xlate (or elsewhere) UPoC that puts the message content in USERDATA.

                    Then you can use xpmmetaget on USERDATA to retrieve the original message content.

                    There’s also a check box in on the route properties that will do this storage for you (Store original message in metadata for downstream processing) — this was added in 6.1 or 6.2.

                    Rob Abbott
                    Cloverleaf Emeritus

                  • #85527
                    Bob Schmid
                    Participant

                      💡

                      wonder why there isn’t an xpmmsgget….but yes….we can work with Rob’s suggested solution.

                      Thanks folks!

                      Always fruitful!

                    • #85528
                      Jim Kosloskey
                      Participant

                        Also note now your message will be approximately 2 times the size (message plus metadata).

                        Should you go this route I would suggest you consider a post Xlate Proc to remove the User Data to shrink the message size for Cloverleaf.

                        I am not sure what you are attempting but I can’t think of too many reasons this would be useful inside an Xlate. Most condition checking, string manipulation, etc. can be accomplished with less impact either natively within the Xlate with no Tcl or in the Xlate with little additional Tcl.

                        So if you would share what you are doing I would be enlightened to understand a reason to do this.

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

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