Pre-proc arguments from NetConfig

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Pre-proc arguments from NetConfig

  • Creator
    Topic
  • #51823
    Mike Campbell
    Participant

      I have a ‘routing’ tcl preproc that will be used to route files based on a location value.

    Viewing 3 reply threads
    • Author
      Replies
      • #71867
        James Cobane
        Participant

          Mike,

          You would want to enter the argument as a keyed list element with its associated values so that you can easily extract it from ARGS in your proc.

        • #71868
          Jim Kosloskey
          Participant

            Mike,

            Like Jim Cobane, I like to use Keyed Lists for NetConfig Arguments.

            However you could just put the list in the NetConfig Arguments as you suggest.

            Another way to do something like this is to build a lookup table with each valid location on one side and something like Y on the other side with a default of N.

            Inside your proc do a table lookup using the field from the message you would compare to the list and check to see if the value returned is a ‘Y’. If it is then it is a valid location.

            The benefits associated with this method are:

            No need to update the NetConfig to modify the list (and perhaps mess up the curly braces).

            A simple purge caches will refresh the table into memory effectively changing the list without stopping any threads or processes.

            You can leave old locations in place and simply make their right side an ‘N’ or the date deactivated so that they can indicate once valid locations but not be valid now.

            If you have multiple place the list needs to be referenced (multiple threads in one site or multiple sites) the table is referencable by all.

            The drawbacks are it is not obvious this table is in use unless one looks at the code (unless the table name is an argument in the NetConfig – this is a usable option and doesn not obviate the benefits) and the table has to be moved when migrating from devl/test to production.

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

          • #71869
            James Cobane
            Participant

              Mike,

              Now that I’ve looked at your code, here’s a couple of additional things.

            • #71870
              Mike Campbell
              Participant

                Running the pre-proc through the ‘route’ testing tool it seems that it is executing 2 times.

                Starting FNB-CSV pre-proc

                Argument list was obtained from NetConfig

                Content of argument list: >Madison {New Haven Office} {Cottage Grove Road} {Simsbury} {West Avon Rd.} {South Street} <. Location found is:

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