Announcement

Collapse
No announcement yet.

Can mirth write to configurationMap problematically?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can mirth write to configurationMap problematically?

    I just want to confirm...

    can we SET a value in the configuration map from within Mirth code? (Mirth Version 3.4.1)

    I was hoping to set a value. Something like this:
    configurationMap.put("ProfileLastTimePolledDateTim e", "2017-01-02");

    please let know if this is possible.. i am guessing that the functionality does not exist.

    (i could also just parse the file, as an alternative???)

    thanks, in advance.
    Last edited by clarksss; 10-11-2019, 08:09 AM.

  • #2
    What problem are you trying to solve? Can you provide some more details? Do is make sense to use a GlobalChannelMap?
    Best,

    Kirby

    Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

    Appliance Version 3.11.4
    Mirth Connect Version 3.8.0
    Java Version 1.6.0_45-b06
    Java (64 bit) Version 1.6.0_45-b06
    Java 7 (64 bit) Version 1.7.0_151-b15
    Java 8 (64 bit) Version 1.8.0_181-b13
    PostgreSQL Version 9.6.8

    Comment


    • #3
      Originally posted by kirbykn2 View Post
      What problem are you trying to solve? Can you provide some more details?
      Basically want to hold the state. i need a date/time stamp of the last time i polled the database for records, so that i don't grab records that have already been selected and passed to my other system.

      I thought rather than write the date/time stamp to a file or database table i could just write it to the configuration map file.

      however i know now that later versions of mirth write the configuration map values to a table in mirth... (what version did that start in??) I have version 3.4.1

      Comment


      • #4
        I am quite certain that feature is not 3.4. You can check the release notes but I think that was added in 3.7 or 3.8.
        Best,

        Kirby

        Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

        Appliance Version 3.11.4
        Mirth Connect Version 3.8.0
        Java Version 1.6.0_45-b06
        Java (64 bit) Version 1.6.0_45-b06
        Java 7 (64 bit) Version 1.7.0_151-b15
        Java 8 (64 bit) Version 1.8.0_181-b13
        PostgreSQL Version 9.6.8

        Comment


        • #5
          http://www.mirthcorp.com/community/w...What's+New


          Looks like it was added in 3.6
          Best,

          Kirby

          Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

          Appliance Version 3.11.4
          Mirth Connect Version 3.8.0
          Java Version 1.6.0_45-b06
          Java (64 bit) Version 1.6.0_45-b06
          Java 7 (64 bit) Version 1.7.0_151-b15
          Java 8 (64 bit) Version 1.8.0_181-b13
          PostgreSQL Version 9.6.8

          Comment


          • #6
            Originally posted by kirbykn2 View Post


            that is cool thanks... so i guess in the mean time, there is no current functionality to write to the configuration map through code?

            Comment


            • #7
              In 3.6+ there is an option to store the map in the db instead of the file system, but it doesn't store the individual values separately. It serializes the entire configMap object to xml and stores it in a single row.

              The configurationMap can only be updated through the Client API (in the same manner as when you change and save it in the Administrator.) The configurationMap is presented as read-only to the channels.

              If you were to edit the properties file (or the object in the db if using that option) mirth still won't see the changes until you tell it to refresh the config map that is held in memory.

              I've never done this before, but you might be able to use the saveProperty and getProperty methods on the ConfigurationController. This is how most of the values you can change in the Settings area of the Administrator are saved. Plugins also save their configurations this way. The Controllers are internal mirth classes and not part of an API, so they are subject to change without notice (though these methods are unlikely to change as long as you are on a 3.x version.)

              Comment

              Working...
              X