web stats
Monitoring progress of message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2017, 07:33 AM
BCMirthUser BCMirthUser is offline
OBX.2 Kenobi
 
Join Date: May 2015
Posts: 93
BCMirthUser is on a distinguished road
Default Monitoring progress of message

This question is not specific to Mirth, but I am wondering if we can use Mirth to accomplish it. We have a situation where we can receive a message and it goes through several steps. Some of those steps can run concurrently and some cannot. What we are wondering is is there a way that Mirth can monitor the progress and know when to trigger the next step or steps.

Ex:

A message goes through 7 processes. Process 1 runs before 2-6 and then 7 runs. 7 can only run after all steps 2-6 are finished and 2-6 can only run after 1 finished. Steps 2-6 can run concurrently.

We can break the entire chain into 3 separate segments and monitor that fairly easily. The trouble comes in the 2-6 steps (call it segment 2) and tracking how to tell if they have all finished before moving on to the 3rd segment.

Again I understand this is not a specific to Mirth issue, just wondering if anyone out in the community has solved a similar problem. Thanks in advance.
Reply With Quote
  #2  
Old 03-22-2017, 09:26 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 835
siddharth is on a distinguished road
Default

I think you can achieve it by adding Boolean flags in segment 2 you can monitor it. Something like

if(flag2&&flag3&&flag4&&flag5&&flag6) {
//segment3
}
Reply With Quote
  #3  
Old 03-22-2017, 11:27 AM
BCMirthUser BCMirthUser is offline
OBX.2 Kenobi
 
Join Date: May 2015
Posts: 93
BCMirthUser is on a distinguished road
Default

Thanks siddharth. We thought about that but it would only work if the number of steps is static. We were trying to think of more of a row based approach so that that the code base could be generalized and not be bound to a static number concurrent processing steps. This way we could use mirth to monitor a table and make decisions based on if it thinks the set of processes are finished. However, this is proving to be trickier than we initially thought. Thank you though!
Reply With Quote
  #4  
Old 03-22-2017, 01:13 PM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

One way I've dealt with this situation before is to use a file reader.

Step one: runs it's process and upon completion writes a file named "step1done.txt" out to a folder.

Step two: A file reader waits for "step1done.txt" to appear. Once it's there it runs its functions and writes a file named "step2done.txt". It also deletes "step1done.txt" so it doesn't run when it shouldn't.

A separate file named something like "steplog.txt" can be written to by each step/channel so you know where things left off when the entire process doesn't complete. There's a lot that can be done by this method. Might be clunky but it works.

Just spitballing here but in your case you could have Steps 2-6 write out to a file and append their steps into it. So file "2through6.txt" would contain
'2,3,4,5,6" or however you want to deal with it. It could look like "4,3,2,6,5" as long as all the steps have written to it. Then step 7 would read in the file and look for ALL the steps. It will keep reading the file each time it is written to until all steps are there. Then it can run and delete the "2through6.txt" file.

You could also use this technique with a database but then you'll have to deal with databases. Might not need to if you can just deal with it in simple folders and files. But there are options.

Last edited by appsbyaaron; 03-22-2017 at 01:16 PM.
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 09:10 PM.


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