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

RTC 4.0.5 extension in a Deliver action

I am programming an extension for analyzing files in an deliver changesets to a stream.
It is an Advisor because if the analyze fails then you can't deliver anything.

In addition I have read the articles:

https://jazz.net/library/article/1000
https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/
https://jazz.net/wiki/bin/view/Main/CustomPreconditionsTable

But I have some doubts yet.
I have created a plugin project with extension point ID: com.ibm.team.scm.server.deliver and a java class, but I don't know how to get the path of the files included in the deliver for analyzing them:

import org.eclipse.core.runtime.IProgressMonitor;
import com.ibm.team.process.common.IProcessConfigurationElement;
import com.ibm.team.process.common.advice.AdvisableOperation;
import com.ibm.team.process.common.advice.IAdvisorInfoCollector;
import com.ibm.team.process.common.advice.runtime.IOperationAdvisor;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.repository.service.AbstractService;
public class CheckBadCharacterAdvisor extends AbstractService implements IOperationAdvisor{
    @Override
    public void run(AdvisableOperation operation,
            IProcessConfigurationElement advisorConfiguration,
            IAdvisorInfoCollector collector, IProgressMonitor monitor)
            throws TeamRepositoryException {
        
        Object data = operation.getOperationData();
        // what else here?
   }
}

How could I get the change sets included in the delivery?
or
What javadoc or steps do you follow for getting this information?

1 vote


Accepted answer

Permanent link
I use this in my deliver participant

                    // get the deliver data
                    scmChange = (IScmDeltaSource) operation.getOperationData();                   
                    // loop thru the changes
                    for (IChangeHistoryAddOperandDelta delta : scmChange.getDeltas(IChangeHistoryAddOperandDelta.class))
Fran Burgos selected this answer as the correct answer

1 vote


One other answer

Permanent link
Here is some code that might help:

https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/

This also shows the API to get the path information from such items:

https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/

I know this has been discussed here in the forums and you could try to search for more information here.

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
× 7,495

Question asked: Nov 07 '14, 3:28 a.m.

Question was seen: 4,454 times

Last updated: Nov 07 '14, 7:09 a.m.

Confirmation Cancel Confirm