Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Trigger an operation after build complete in RTC server

 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 ?

0 votes


Accepted answer

Permanent link
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

2 votes

Comments

Good catch, Michele. 

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

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>

1 vote

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

 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?

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.

2 votes

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
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. 

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Dec 04 '15, 3:24 a.m.

Question was seen: 2,818 times

Last updated: Dec 08 '15, 10:41 p.m.

Confirmation Cancel Confirm