connecting to a table updating constantly

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf connecting to a table updating constantly

  • Creator
    Topic
  • #48645
    Mason Miller
    Participant

      I want to write a xlate that looks a table that updates every minute so I can compare MR# in this table an send only the transactions that the MR# matches what is in the table. anybody have any idea how to do this.

      It would be best if this table was not on the cloverleaf server but on a database server.

      Thanks

    Viewing 5 reply threads
    • Author
      Replies
      • #59269
        Jim Kosloskey
        Participant

          Mason,

          From your description it sounds like you need to reference an external DB maintained by a system other than Cloverleaf(R).

          In order to do that I think you will need to utilize Tcl and either ODBC or JDBC.

          On the other hand if you were thinking of using the built in lookup table, then some things to consider:

          How will the Table get updated (I think you said every minute)? There is only the GUI Table configurator tool provided by Cloverleaf(R)and that requires a human at the other end. How will you control access and if you expect to maintain the table yourself (or another integration engineer) and the table is fairly dynamic – will you have the time?

          You need to refresh the Table in memory for Cloverleaf(R) to get the latest copy (purge caches will do the trick).

          As far as I know the Table has to reside on the Cloverleaf(R) server.

          Jim Kosloskey

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

        • #59270
          Richard Hart
          Participant

            Mason.

            Jim has identified the issues you face.

            As an alternative to Cloverleaf tables, we use TCL functions with arrays to load tables.

            While we have not used this (we have used a similar approach for other issues) it is possible for a thread to detect the existence of a file and then perform an action.

            The table code could be in a TCL translation and every time a test file exists, the table is loaded from a flat file (rather than a DB) and the test file is then removed.

            A separate thread/process can create the table data and then create the test file when the table file is complete.

          • #59271
            Mason Miller
            Participant

              I would like to look a external database for this table but I am not sure how this is done using ODBC.  Do you know where I could get information on this?

              Thanks

              Mason

            • #59272
              James Cobane
              Participant

                Mason,

                Don’t forget about the GNU database functionality available within the Cloverleaf engine (refer to the GDBM extensions).  This is a very simple, yet robust component that can fulfill these types of needs.

                Jim Cobane

                Henry Ford Health

              • #59273
                Mason Miller
                Participant

                  I would like to write a tcl that says if PID-3 does not = a list of values in a external database that is contantly updating then supress. I have a ODBC connection setup I just need an example on how to get cloverleaf to look for data in this database.  I do not use tcl often most everything I need to do I can do with xlate.   If thier is a way for xlate to look at an external database for table or a list of MR#’s that I need that would be great but I don’t think it is possible to use xlate for this issue.  I have not used GNU If that is an easier or better way to do this with GNU I would be willing to try it if I had an example of how it works.

                  Thanks

                  Mason

                • #59274
                  Jim Kosloskey
                  Participant

                    Mason,

                    You can use Xlate, but you will need Tcl to reference the Table (unless it is a Cloverleaf(R) Table) within the Xlate.

                    The Tcl could be invoked as part of a CALL Action or any other Action which supports Tcl callout.

                    I do not have an example to share as we do not allow dynamic tables to be referenced within Cloverleaf(R) here at this time.

                    Jim Kosloskey

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

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