It's all about the answers!

Ask a question

Trigger an operation after build complete in RTC server


han huynh (197) | asked Dec 04 '15, 3:24 a.m.
edited Dec 06 '15, 9:56 p.m.
 I `m developing a RTC extension for trigger an custom operation after a build request is success.The question is which the operationId shoud i use ?

Accepted answer


permanent link
Michele Pegoraro (1.8k1210295) | answered Dec 04 '15, 8:23 a.m.
It is possible. You have to create an event handler extension, instead of an advisor or follow-up. The event category you can use is com.ibm.team.build.category.BuildResultChanged. As Ralph says it is an asynchronous operation, so it will begins some seconds after the build is completed and if it fails or throws an exception no message will be displayed to the user.
Every operation you try to perform with this extension will be performed by "admin" user so they should be permitted to everyone unless you implement an ImpersonationRunnable operation, and trigger it using the IImpersonationService. In this case you can set the user you want to perform the operation.
han huynh selected this answer as the correct answer

Comments
Ralph Schoon commented Dec 04 '15, 8:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Good catch, Michele. 


han huynh commented Dec 06 '15, 10:54 p.m.

 I can not find this com.ibm.team.build.category in RTC SDK 5. Is there any example how to use this event category?


1
Michele Pegoraro commented Dec 07 '15, 4:07 a.m.

You can't find it in the SDK: it's the value that you have to use in your plugin.xml (it is like operationId for advisors).

You have to create a new extension using the extension point of type com.ibm.team.process.service.eventHandlers and then in the plugin.xml editor you will see where to set the eventCategory I wrote.

e.g. :
   <extension
         point="com.ibm.team.process.service.eventHandlers">
      <eventHandler
            class="yourClass"
            eventCategory="com.ibm.team.build.category.BuildResultChanged"
            id="yourExtensionId"
            name="yourExtensionName"
            />
   </extension>


han huynh commented Dec 08 '15, 3:29 a.m.

 Hi Ralph SchoonMichele Pegoraro, i did it. Thanks you!


han huynh commented Dec 08 '15, 4:50 a.m.

 BTW, Can you show me what is the eventCategory for Project area, Build definition changing(rename, delete)?
I can not find any document about RTC server API, where did you find it?


2
Michele Pegoraro commented Dec 08 '15, 4:59 a.m.

In a very empirical way :-)
I've used the auto-completion of the process configuration source in the eclipse client. Go to behaviour tag and add a change-event. Then you can select the category id from a dropdown list. So you'll have any id that can be used for your extensions.


han huynh commented Dec 08 '15, 10:39 p.m. | edited Dec 08 '15, 10:41 p.m.

I tried com.ibm.team.workitem.event.stateChanged, but it does not work. Do you have any idea for Project area, Build definition changing(rename, delete) event?  Thank you!

showing 5 of 7 show 2 more comments

One other answer



permanent link
Ralph Schoon (53.2k13541) | answered Dec 04 '15, 3:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This is the list of extension points: https://jazz.net/wiki/bin/view/Main/CustomPreconditionsTable#operations

However, there is no extension point that does what you want. The reason is, that the build runs asynchronously and all the server knows about the build is sent to it from the build engine.

If you want to do additional automation during or at the end of the build, I would suggest to use the client API and perform that operation as a build step. 

Your answer


Register or to post your answer.