by sbutler » Thu Oct 24, 2013 10:27 pm
If the WebClient triggered the Headless Client to open and run a method using the HeadlessClient plugin, then you will automatically get a callback in the queueMethod function.
If the processes are running in a CRON (so not triggered through headlessClient plugin) then you'll have to build something more fancy. So you have a few options...
1. You could implement some client side polling to a RESTful webservice you build that checks if the process is done. You could also do this server side via the schedule plugin. So you somehow check if its done, if so, then run what you need to run.
2. Use servoy's built-in data broadcasting! So, in your application, I assume you have a user record. Add a column in there for user_alerts. Show the user_alert column for the logged in user somewhere on your app in the header or footer where they could always see it. Make it an HTML_AREA. Then in your server side CRON process, when it finishes a job for a user, write to the user_alerts column for the users record, like <html><b>Your Job finished.</b> <a href="javascript:global.method...">Click Here for more info</a></html>
So, the user would just visually see the alert. Then clear it out after they click on it to acknowledge the alert.
I'd go with #2.