It's all about the answers!

Ask a question

How can an operation advisor know which files are going to be delivered?

Michal Sipos (1113) | asked Nov 21 '16, 12:20 p.m.
edited Nov 23 '16, 1:40 p.m. by David Lafreniere (4.8k7)

I am trying to implement an operation advisor that is activated when DELIVER operation on server is attempted.

I have followed this blog that deals with the advisor that, when DELIVER operation is attempted,checks if workitems are of the desired type. If not, delivery is forbidden.

My task is to program a similar advisor, but mine should be able to find out which files are going to be delivered (are modified or new) and then, it should carry out specific checks on that files.

MY GOAL: Get the advisor find out which files are going to be delivered and therefore the advisor should perform specific check on them.

Thank you very much in advance!

Michal Sipos commented Nov 22 '16, 1:49 p.m.

I would like to have just a little advice on in which parts of the API I should look at.

I need to get information about which files were modified or added to the repository workspace and are included in a particular changeset and I need to go through all the files and do some operations on them...

One answer

permanent link
Ralph Schoon (63.2k33646) | answered Nov 22 '16, 2:49 p.m.
edited Nov 22 '16, 2:58 p.m.
Consider google for "deliver change set Team Concert Advisor" and the like. Limit using as selection criterion. also has API examples more in . A deliver advisor can iterate all items that are to be delivered. explains some of the API, I think.

Michal Sipos commented Nov 22 '16, 3:40 p.m.

Thank you Ralph, but I have already been google-ing for some days and I am still confused on where to start. I am a student and I am a novice in extending RTC, this is my school work, I would really appreciate just some guidance on which way to go I mean wether to look at or which another part of the API?

Ralph Schoon commented Nov 23 '16, 2:14 a.m. | edited Nov 23 '16, 2:14 a.m.
   From this  blog have you followed how to set up your environment for debugging and done the extensions workshop? If not, do that and then look at your code again.

Note: deliver delivers changes/change sets. the changes are to files at the end, but a change set does not necessarily impact only one file. , as mentioned above shows the API to use. Dependent on what operation you use you will have to use SCM API and setControl in above link shows you how to go from an IChangeSet to an IChange to an IVersionableHandle.  

Ralph Schoon commented Nov 23 '16, 3:00 a.m.

 This is code to get all the change sets in a delivery

IItemServiceIterator changeSetIterator = ItemServiceIteratorFactory.INSTANCE
.createFetchItemsIterator(fItemService, changeSetHandles
.toArray(new IItemHandle[changeSetHandles.size()]),
while (changeSetIterator.hasNext()) {
IChangeSet changeSet = (IChangeSet);

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.