Page 1 of 1
Multiple file watchers?

Posted:
Tue Jun 16, 2015 10:58 am
by neil.interactit
Hi guys,
A question on best practice and possibility ...
I have a client with a growing number of file watch folders and processes. Having started with your demo watcher ... and stripped it down to the initial few needed ... I am now progressively adding back in extra watcher code as needed. I am following the multiple watchers within the single plugin paradigm per the demo. Is this best?
I have both implementation and robustness concerns ... asynchronously needing to implement new watchers ... and trouble when new code breaks existing functionality.
Can I divide and conquer ... a plugin per watcher ... will this be cool within Jiwa and handled OK by the service? And if so, is this best practice?
Cheers,
Neil.
Re: Multiple file watchers? 

Posted:
Wed Jun 17, 2015 8:39 pm
by Mike.Sheen
Hi Neil,
Either approach - either watching multiple folders in the one plugin, or having several plugins - is perfectly acceptable and supported.
Choosing which approach comes down to a management choice - is it likely at some point one of the watchers will need to be disabled (temporarily or permanently)? If so, then it might be best to have multiple plugins, as the customer can easily disable the plugin in question and not need to worry about modifying the code to disable a watcher.
I personally like to use separate plugins for discrete pieces of functionality. If the purpose of the watchers are isolated and not co-dependant, then having separate plugins makes sense. If the functions are related, then it probably makes more sense to have one plugin.
Mike
Re: Multiple file watchers?

Posted:
Thu Jun 18, 2015 11:00 am
by neil.interactit
Thanks Mike ... will go that way.
Re: Multiple file watchers?

Posted:
Tue Jul 07, 2015 6:24 pm
by neil.interactit
Hi again, a quick follow up question ...
I have a Helper class in my file watcher plugin ... allowing me to FileWatcherManager.WriteLog(), FileWatcherManager.GetWatchFolder(), FileWatcherManager.SendEmail(), etc.
With multiple plugins for multiple file watchers, it would be nice (and ease maintenance) not to need to duplication the FileWatcherManager in each plugin. Can I add it to its own plugin and then add a reference (to its subsequent compiled DLL) somehow?
Cheers,
Neil.
Re: Multiple file watchers?

Posted:
Tue Jul 07, 2015 9:34 pm
by Mike.Sheen
neil.interactit wrote:Hi again, a quick follow up question ...
I have a Helper class in my file watcher plugin ... allowing me to FileWatcherManager.WriteLog(), FileWatcherManager.GetWatchFolder(), FileWatcherManager.SendEmail(), etc.
With multiple plugins for multiple file watchers, it would be nice (and ease maintenance) not to need to duplication the FileWatcherManager in each plugin. Can I add it to its own plugin and then add a reference (to its subsequent compiled DLL) somehow?
Cheers,
Neil.
I was wondering when someone would ask this.
I tested this a while back, and the short answer is yes you can reference another plugin. The trick is to make sure the execution order is set so that the plugin you want to reference is compiled before any others referencing it, and then you can add a reference to the plugin dll in the ProgramData\Jiwa Financials folder.
Re: Multiple file watchers?

Posted:
Tue Jul 07, 2015 10:18 pm
by neil.interactit
Thanks Mike, I will give it a spin!