IChangeEventHandler::handleEvent called repeatedly...
I have created an event/event handler pair (IChangeEvent / IChangeEventHandler).
I create the IChangeEvent and save it (once). My registered event handler (handleEvent on IChangeEventHandler) gets called repeatedly for this event every time the change event task kicks in. Question: is this intended? I would only like to be called once per instance of an event. Is there a way I can force this behavior by doing something in either the event creation or response to the event? Thanks, John |
Accepted answer
I think I may have found the answer to my question:
IChangeEventService::delete(event) If this is not the correct approach then please advise. I have created an event/event handler pair (IChangeEvent / IChangeEventHandler). John Nason selected this answer as the correct answer
Comments
scott herzinger
commented May 06 '13, 11:25 a.m.
John,
Hi Scott,
In our scenario we were using the change event for a cross component communication mechanism, and we knew once we consumed the event there would be no other interested parties. We did end up deleting the event per my answer above.
Otherwise, the change event will ultimately expire and be scrubbed, but if you know you don't need it any longer I'd delete it.
If we're talking about com.ibm.team.process.service.IChangeEventHandler, the behavior described here sounds like a bug. You shouldn't have to delete your change events. Your handler should only be called for each event once.
|
One other answer
Thanks for the info. Do you have any advice (or pointers thereto) on the API for deleting a change event? My expertise with RTC extension development begins and ends with the RTC Extensions Workshop, which is kind of light on the concepts (it's much better on the logistics and scaffolding of RTC plugin development). It's far from obvious (to me) how RTC concepts of Items, Handles, ManagedItems, SimpleItems, Events, and so on all fit together into a coherent model.
One idea I had was to let RTC handle scrubbing the event, by setting the ChangeEvent's expiration time to "now". However, that led to an ImmutablePropertyException (and indeed, event.isImmutable() returns true for the IChangeEvents I see when a snapshot is added to a stream). Some browsing on jazz.net suggests that I may need a "working copy". But again, I'm not finding the information I need to make sense out of these concepts of immutability, nor how to use working copies of various flavors. Any suggestions or links would be highly appreciated. And thanks again for your earlier response, Scott |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.