I have a solution, I am still finalising it, but will post my solution when finished.
======
My problem\question:
Can’t go into too many details about app, but if a doc is entered into the system by user group A, user group B need to be aware within 30 secs so they are able to process. The document will have “breached” if not responded to in a given amount of time.
My thought process is to have a partial refresh on an element in the xPage if an ApplicationScope variable changes. I need the web client to check every 30 secs for a change in state on server.
I have successfully used the Prototype periodicalExecuter:
http://www.prototypejs.org/api/periodicalExecuter
…before to check (via ajax) data on the server from a web client, for a “session keep alive” function. I could use this client side and initiate a SSJS get() from my application scope var and then perform the partial refresh if required.
Does Dojo have a similar function? Am I on the right track? Or is there a way to “open” a connection to the server and have server push to clients.
Any comments or suggestions gladly welcomed.
Thanks,
Nick
Subject: Let me see if I understand the process correctly
You have one group of users (a) that enter documents into the database, and you need to make sure that a second group (b) are made aware of the new document as soon as possible?
Is there a reason you can’t simply use an agent triggered on “When documents are created or modified”? A scheduled agent can also be used to check documents periodically to see if they have “breached”.
Subject: I could but…
thanks for response…I’m rally waffling here…this is a pure web app, “On new doc” triggered agents can run, I think I have this right…within 1 minute, but they queue up behind any other agents. But since this is a a pure web app, I don’t know how this agent could alert them of any event, they need to be visualy alerted in the ui (they don’t use Domino for email)…user in group A enters a doc, a whole group B may have a view open, and may stay on that view for, maybe 5 mins, without doing anything in the ui to trigger a refresh from the server, but the users need to be alerted within seconds.
I’m using setInterval() in JS, ApplicationScope vars and SessionScope vars to poll the server for events, and refresh a panel which refreshes view etc.
I’ll post solution when completed.