Timer - based occasion triggers
I am presently working with a task with details needs. A quick review of these are as adheres to:
- Data is fetched from exterior webservices
- Data is saved in SQL 2005
- Data is adjusted using an internet GUI
- The home windows service that connects with the web services has no combining with our inner internet UI, other than using the data source.
- Interaction with the web services requires to be both time - based, and also caused using customer treatment on the internet UI.
The existing (pre - pre - manufacturing) version for internet service interaction triggering is using a data source table that shops cause demands created from the hand-operated treatment. I do not actually intend to have numerous trigger devices, yet would love to have the ability to inhabit the data source table with triggers based upon the moment of the call. As I see it there are 2 means to complete this.
1) Adapt the trigger table to store 2 added parameters. One being "Is this moment - based or by hand included?" and also a nullable area to store the timing information (specific layout to be established). If it is a manaully developed trigger, mark it as refined when the trigger has actually been discharged, yet not if it is a timed trigger.
2) Create a 2nd home windows service that develops the triggers on - the - fly at timed periods.
The 2nd alternative feels like a fudge to me, yet the monitoring of alternative 1 can conveniently develop into a shows problem (just how do you recognize if the last survey of the table returned the occasion that requires to fire, and also just how do you after that stop it re - triggering on the next survey)
I would certainly value it if any person can save a couple of mins to aid me determine which course (among these 2, or perhaps a 3rd, unpublished one) to take.
Why not make use of a SQL Job as opposed to the Windows Service? You can envelop every one of you db "trigger" code in Stored Procedures. After that your UI and also SQL Job can call the very same Stored Procedures and also create the triggers similarly whether it is by hand or at once period.
The means I see it is this.
You have a Windows Service, which is playing the duty of a scheduler and also in it there are some courses which merely call the webservices and also placed the information in your data sources.
So, you can make use of these courses straight from the WebUI too and also import the information based upon the WebUI trigger.
I do not such as the suggestion of saving a customer created activity as a flag (trigger) in the data source where some service will certainly question it (at a period which is not under the customer's control) to execute that activity.
You can also transform the entire code right into an exe which you can after that set up making use of the Windows Scheduler. And also call the very same exe whenever the customer triggers the activity from the Web UI.
Unfortunately, the physical style of the remedy will certainly not permit any kind of straight communication in between the parts, apart from Web UI to Database, and also data source to service (which can after that call out to the web services). I do, nonetheless, concur that re - use the communication courses would certainly be the perfect below - I simply can not do it within the boundaries of our organisation *
*Isn't it constantly the manner in which a practically "far better" remedy is put on hold by exterior variables?