Notifications
Posted: Fri Aug 07, 2009 2:27 pm
by Craig Shearer >> Mon, 26 Jun 2000 23:00:52 GMT
Hello All
I would be interested in feedback on the following. In my app I cause user notifications and I generally have a method on some class to cause the event, eg:
notifyOfferStatusChange(offer: Offer);
begin
causeEvent(Notify_OfferStatusChange, false, offer);
end;
However, notice that the second parameter is false, meaning that the notification will be delivered at the end of the transaction. This is what I want, however I can't guarantee that the method will be called while in transaction state (unless I write all the code that calls this method). The result is that if the method is called outside of transaction state, then the notification won't be delivered until the end of the NEXT transaction. (At least, this is what the documentation says)
Perhaps a better way to code this might be:
causeEvent(Notify_OfferStatusChange, not process.isInTransactionState, offer);
which would mean that if the process is in transaction state then the notification will be delivered at the end of the transaction. If not, then it will be delivered immediately.
Comments?
Craig.
Hello All
I would be interested in feedback on the following. In my app I cause user notifications and I generally have a method on some class to cause the event, eg:
notifyOfferStatusChange(offer: Offer);
begin
causeEvent(Notify_OfferStatusChange, false, offer);
end;
However, notice that the second parameter is false, meaning that the notification will be delivered at the end of the transaction. This is what I want, however I can't guarantee that the method will be called while in transaction state (unless I write all the code that calls this method). The result is that if the method is called outside of transaction state, then the notification won't be delivered until the end of the NEXT transaction. (At least, this is what the documentation says)
Perhaps a better way to code this might be:
causeEvent(Notify_OfferStatusChange, not process.isInTransactionState, offer);
which would mean that if the process is in transaction state then the notification will be delivered at the end of the transaction. If not, then it will be delivered immediately.
Comments?
Craig.