I have a handful of datasources that I write to from a collection of grids/forms using queuing. On the same layout, I have another grid showing a collection of related documents, also retrieved from a datasource, and a Flashlet presenting a Flash view of the selected document.
When everything is saved, I need to add or replace a document with one I generate server-side using the new data.
I have a bunch of that wired up now, using an RPCQueueCallback to fire the document generation bit, which I guess is fine - though I can see a case where I might want to rollback the transaction if the document generation fails. It's not clear to me how I'd do that this way.
For now, the thing that's bothering me is this:
At least some of the datasources in that queue will be used from other places. I need to refire the document generation and all that whenever any of them is updated. You could of course use the same callback mechanism everywhere, but I'd prefer to manage this in one place, preferably server side.
It feels like what I really want to do is generate the document via some DMI. I'd register the same DMI on each datasource in question, but I assume that when I queue up e.g., updates to records in 4 datasources, the DMI is going to fire 4 times. Yes? Unless there were a way in the DMI itself to see whether it was already going to be called in the context of the current transaction.
So is there a good way to leverage the server framework to deal with this kind of thing out of the box?
(here's hoping this makes some small amount of sense)
When everything is saved, I need to add or replace a document with one I generate server-side using the new data.
I have a bunch of that wired up now, using an RPCQueueCallback to fire the document generation bit, which I guess is fine - though I can see a case where I might want to rollback the transaction if the document generation fails. It's not clear to me how I'd do that this way.
For now, the thing that's bothering me is this:
At least some of the datasources in that queue will be used from other places. I need to refire the document generation and all that whenever any of them is updated. You could of course use the same callback mechanism everywhere, but I'd prefer to manage this in one place, preferably server side.
It feels like what I really want to do is generate the document via some DMI. I'd register the same DMI on each datasource in question, but I assume that when I queue up e.g., updates to records in 4 datasources, the DMI is going to fire 4 times. Yes? Unless there were a way in the DMI itself to see whether it was already going to be called in the context of the current transaction.
So is there a good way to leverage the server framework to deal with this kind of thing out of the box?
(here's hoping this makes some small amount of sense)
Comment