How to invoke a IChangeEventHandler by server side programmatically
We would try to invoke an our IChangeEventHandler implementation by server side.
How could we create that IChangeEventHandler instance to be adviced by the change event manager (e.g., internal API)?
IChangeEvent event = IChangeEvent.FACTORY.newInstance(null);
Thanks in advance.
|
4 answers
Ralph Schoon (63.5k●3●36●46)
| answered Mar 22 '16, 3:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I can tell, you don't do that. You extend the event handler extension point and then your event handler is called, once you configure it for the project.
Comments 1
sam detweiler
commented Mar 22 '16, 8:29 a.m.
I think his question was, what causes the event to fire, that would invoke his handler.
|
Ralph Schoon (63.5k●3●36●46)
| answered Mar 23 '16, 11:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Mar 23 '16, 11:02 a.m.
You can configure event handler here:
There is a built in (hard to find) event for all of these. I don't know if you can cause events yourself. |
We already extended the event handler extension point "com.ibm.team.workitem.event.stateChanged" with our implementation and it works like a charm. Also, we created a REST command to be able to simulate the invocation of that implementation and it works like a charm, too. We are looking for the right way to generate the IChangeEvent instance to be used for that invocation: IChangeEvent event = IChangeEvent.FACTORY.newInstance(null); For instance, we do not know how to set a correct contextId... Thanks in advance. Cheers. |
I suppose you have extended com.ibm.team.process.service.eventHandlers and configured it with eventCategory="com.ibm.team.workitem.event.stateChanged" to intercept a workitem state transition.
In my opinion the contextId is the context UUID of the Workitem IWorkItem workitem .... or if you do not need it you can use for example: event.setContextId(IContext.PUBLIC) Comments
SEC Servizi
commented Jun 10 '16, 4:04 a.m.
We would be able to invoke our event handler implementation even without a real work-item state transition. So, in this case, we will not be able to retrieve the context UUID from the item...
We will now try to set the context UUID as 'IContext.PUBLIC'.
Thanks for the advice.
Cheers.
|
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.