web stats
Can mirth write to configurationMap problematically? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2019, 09:02 AM
clarksss clarksss is offline
OBX.2 Kenobi
 
Join Date: Jul 2013
Posts: 76
clarksss is on a distinguished road
Wink 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 at 09:09 AM.
Reply With Quote
  #2  
Old 10-11-2019, 09:03 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 589
kirbykn2 is on a distinguished road
Default

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
Reply With Quote
  #3  
Old 10-11-2019, 09:08 AM
clarksss clarksss is offline
OBX.2 Kenobi
 
Join Date: Jul 2013
Posts: 76
clarksss is on a distinguished road
Default

Quote:
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
Reply With Quote
  #4  
Old 10-11-2019, 09:13 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 589
kirbykn2 is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 10-11-2019, 09:17 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 589
kirbykn2 is on a distinguished road
Default

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
Reply With Quote
  #6  
Old 10-11-2019, 09:20 AM
clarksss clarksss is offline
OBX.2 Kenobi
 
Join Date: Jul 2013
Posts: 76
clarksss is on a distinguished road
Thumbs up

Quote:
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?
Reply With Quote
  #7  
Old 10-12-2019, 05:29 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,036
agermano is on a distinguished road
Default

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.)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation