Log into the xlates

Clovertech Forums Cloverleaf Log into the xlates

  • Creator
    Topic
  • #121183
    petitPadawan
    Participant

      Hello,
      I would like to be able to log into the xlates,
      on the following lines:
      table, copy, if

      in some cases, cloverleaf does not generate files, because we do not respect all the conditions in the xlate, so I have to be able to find the line that is causing the problem.
      do you have a simple solution?

      Thank you

    Viewing 5 reply threads
    • Author
      Replies
      • #121185
        petitPadawan
        Participant

          I want to display echo lines with the name of the variable and the content of the variable, in the watch output window of the thread process

        • #121186
          Jim Vilbrandt
          Participant

            Hello,

            not sure if I understand your question, but you can always add the following line to a Pre or Post Proc of most actions (Copy, Concat, Table, Call):

            echo [lindex $xlateInVals 0]

            = or =

            echo “Value: [lindex $xlateInVals 0]”

            You will see the results in “Browse/Watch Output” for the process where the sending process/route is located. Or in the output window when debuging an XLate.

            When this is in the Pre Proc, this is the value of the first argument passed into the action. In the Post Proc, it is the first value returned by the action (ie: the value returned from the table action).

            Some actions do not have pre/post procs, but you can always add a dummy copy before or after to evaluate variables/fields.

            Best Regards, Jim

          • #121187
            petitPadawan
            Participant

              thank you for your reply,
              I put in the preproc and proproc block,
              2 solutions
              echo “000 subscriber: [lindex $xlateInVals 0]”
              echo processing 000

              and I have no results for the 2 solutions by viewing the process window

            • #121188
              petitPadawan
              Participant

                by restarting it works,
                thank you,

                something else,
                is it possible to add a boolean on the line
                echo “000 subscriber: [lindex $xlateInVals 0]”
                in order to display if boolent equals true, and no display if false

              • #121189
                Jim Kosloskey
                Participant

                  If you are on a later release of Cloverleaf you can use the debugger to step through your Xlate and locate the issue.

                  If you have never used the debugger and would like a tutorial, email me and I will send you what I put together. I highly recommend everyone get familiar with the debugger – it can make resolving issues so much easier than just the basic testing tool.

                  Barring that, the Testing tool is your friend.

                  Echos are another way as is placing results of some actions in unused portions of the OB message temporarily while testing. Just remember to remove (or shut off if you have coded for external control) the echos before returning to production so as not to fill the log with unneeded output.

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

                • #121190
                  petitPadawan
                  Participant

                    thanks to Jim who give me a solution that works with a boolean,

                    this is a tcl “xltecho” script to import into the environment,
                    and we call in the xlate the CALL action,

                    we initialize a variable via Copy @xltecho_debug to Y or disabled

                    and we put in the CALL action, in source
                    @xltecho_debug
                    =”text to display”
                    @variable_to_display

                    and in proc, xltecho

                Viewing 5 reply threads
                • You must be logged in to reply to this topic.