It's all about the answers!

Ask a question

EventHandler questions


Sky Matthews (3632) | asked Sep 25 '09, 2:29 p.m.
Looking for advice/examples for creating an EventHandler plugin to send a notification to an external app when a work item is closed.

2 Questions:

1. Looking at the other process articles, such as: https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample
it isn't clear to me whether my plugin should have an Activator created or not. The instructions in the example article say to check the Singleton and "auto-activate" check boxes. The plugin wizard must have changed in 3.5 because there's no Singleton check box. I am assuming that Activator==auto-activate (but it could be the reverse). Anyone know the answer?

2. Are there any examples floating around of an EventHandler plugin? I'd like see one and haven't been able to find any.

-Sky

5 answers



permanent link
Jared Burns (4.5k29) | answered Sep 28 '09, 8:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Fri, 25 Sep 2009 18:37:59 +0000, sky wrote:

Looking for advice/examples for creating an EventHandler plugin to send
a notification to an external app when a work item is closed.

2 Questions:

1. Looking at the other process articles, such as:
https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample
it isn't clear to me whether my plugin should have an Activator created
or not. The instructions in the example article say to check the
Singleton and "auto-activate" check boxes. The plugin wizard must have
changed in 3.5 because there's no Singleton check box. I am assuming
that Activator==auto-activate (but it could be the reverse). Anyone know
the answer?

2. Are there any examples floating around of an EventHandler plugin? I'd
like see one and haven't been able to find any.

-Sky

Have you also checked for this option in the manifest (Manifest.mf/
plugin.xml) editor? I'm on Eclipse 3.4, but for me there are two options
on the Overview tab: "Activate this plug-in when one of its classes is
loaded" and "This plug-in is a singleton". Both of those should be
checked.

--
Jared Burns
Jazz Process Team

permanent link
Rafik Jaouani (5.0k16) | answered Sep 29 '09, 7:12 p.m.
JAZZ DEVELOPER
I think there is away to register a listener using an extension point declared in com.ibm.team.repository.client which would cause your plugin to be loaded and your listener to handle the events of when someone connects/disconnects, logs in/logs out from a repository. I don't have access to the source code currently. I will reply tomorrow with an example.

permanent link
Rafik Jaouani (5.0k16) | answered Sep 30 '09, 9:35 a.m.
JAZZ DEVELOPER
Here is an example:

<extension>
<listener>
</listener>
</extension>

The listener class must extend com.ibm.team.repository.client.util.IListener

In the above example the listener will notified about repository connections being added and removed. Hope this helps.

permanent link
Rafik Jaouani (5.0k16) | answered Sep 30 '09, 10:42 a.m.
JAZZ DEVELOPER
<extension
point="com.ibm.team.repository.client.eventListener">
<listener
eventCategory="state"
listenerClass="com.ibm.team.repository.client.tests.events.DeclarativeListenerTest$Listener">
</listener>
</extension>

permanent link
Rafik Jaouani (5.0k16) | answered Sep 30 '09, 10:44 a.m.
JAZZ DEVELOPER
For listening to repository connection additions and removals use:
eventCategory="repositories"

Your answer


Register or to post 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.