User Defined Tcl Library

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf User Defined Tcl Library

  • Creator
    Topic
  • #50508
    John Zalesak
    Participant

      I want to set up a library of tcl prcs that I write.  I am concerned about the engine running them in startup / shutdown mode.  I am not sure exactly how this works.  Specifically:

      1) What logic does the engine use to determine which files to load and run in startup / shutdown mode?  Everything in tcl index??

      2) We have trxid and xltp procedures in the tclprocs directory.  How does it know not to run those?

      3) How do I set up the files so that I can call the proc with my own set of args instead of the standard keyed list?  Or do I have to always used the keyed list with MODE & MSGID as the 1st 2 keys?

    Viewing 11 reply threads
    • Author
      Replies
      • #66389
        Michael Hertel
        Participant

          Quote:

          I am concerned about the engine running them in startup / shutdown mode.  I am not sure exactly how this works.

          Startup and shutdown refers to the startup and shutdown of the thread that is calling the proc. These two items are “user point of controls”.

          Quote:

          1) What logic does the engine use to determine which files to load and run in startup / shutdown mode?  Everything in tcl index??

          Again, you need to have the procs defined in a thread. Starting and stopping the thread is when that logic kicks in.

          Quote:

          2) We have trxid and xltp procedures in the tclprocs directory.  How does it know not to run those?

          Don’t start the process and thread.

          Quote:

          3) How do I set up the files so that I can call the proc with my own set of args instead of the standard keyed list?  Or do I have to always used the keyed list with MODE & MSGID as the 1st 2 keys?

          You do not need to use the engine supplied args. This is mainly status information for the message referring to the metadata of the message.

          There are several “types” of procs which actually refer to the template choice you make. You can still write your own proc with out using the templates provided.

          That being said, it would probably be a good idea for you to view the documentation relating to the engine control and flow.

        • #66390
          Jim Kosloskey
          Participant

            John,

            You really need to attend Level 2 training.

            However, none of the procs you write (and only a few of those provided) run by themselves.

            You need to reference them at the appropriate UPoC points either within the NetConfig or within an Xlate.

            Of course, you can have commnad line Tcl procs as well and those only execute when you specify them at the command line.

            As far as arguments are concerned, you can specify your own arguments in the NetConfig (except for TrxID – a pet peave of mine) configuration where you specify the proc to run. There is typically an ‘Edit’ button.

            For the Xlate procs I use temp variables for my arguments. Some just place them positionally in the Inbound pane of the Action, others code in-line. We do not code inline for Xlates.

            You can also use Lookup Tables for your arguments (I have begun doing that a lot). Of course you need to do the lookup yourself inside each proc.

            I don’t find Lookup Table to be very useful in Xlates however.

            Command line arguments are a different story and I have seen a couple of methods for that.

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

          • #66391
            John Zalesak
            Participant

              Let me ask my question another way.

              When  a thread starts, what procedures get called by engine with the mode = STARTUP.

              Only those specified in the NetCofig or XLT.

            • #66392
              Jim Kosloskey
              Participant

                John,

                NetConfig.

                Xlate procs only get executed when the Xlate gets executed and references them not when the thread starts.

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

              • #66393
                John Zalesak
                Participant

                  Let me ask it one more way.

                  Proc X is listed in the TPS Inbound Data

                  Proc Y is called by Proc X

                  Proc Y is not called anywhere else

                  Proc X gets called by the engine at startup in startup mode

                  Proc Y does not get called by the engine at startup

                  thanks again for all your help

                • #66394
                  Michael Hertel
                  Participant

                    Proc Y will be called my Proc X

                    so

                    Since Proc X gets called at start up, it will call Y, so yes Y will get called at startup due to X calling it.

                  • #66395
                    John Zalesak
                    Participant

                      Thanks to all your help, I think I have a good handle on this.

                      In my case, Proc X only calls Proc Y in “run” MODE.   So….. Proc Y would not get called in startup mode.

                      This is exactly what I was hoping for.

                      Santa came early  ðŸ˜€

                      Thanks again

                    • #66396
                      Jim Kosloskey
                      Participant

                        John,

                        Given your theoretical, there are 2 ways that Proc Y could get invoked at thread startup (actually I think there are more than 2 but here are the most common 2).

                        Either Proc X (which is specified in the Inbound Tps) can invoke Proc Y

                        Or

                        You can stack proc Y after Proc X in the Inbound Tps (it is a stack after all).

                        There are some caveats when adding to the Tps but as long as those are followed the second should work fine.

                        Which is it you are using?

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

                      • #66397
                        John Zalesak
                        Participant

                          Actually, I am in the other Camp

                          I do not want it to get executed at startup.

                          Thanks!

                        • #66398
                          John Zalesak
                          Participant

                            Proc X only calls Proc Y in “run” MODE.  So if I follow correctly, Proc Y will not get called at startup which is what I want.

                          • #66399
                            Jim Kosloskey
                            Participant

                              John,

                              That is correct.

                              If your invocation of Proc Y from Proc X only happens in the ‘run’ mode, then Proc Y should not execute at either ‘startup’ or ‘shutdown’.

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

                            • #66400
                              John Zalesak
                              Participant

                                Got it – Thats what I wanted.

                                Thanks for everyone for their help and comments.

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