It's all about the answers!

Ask a question

RTC 4.0.5 extension in a Deliver action


Fran Burgos (1231948) | asked Nov 07 '14, 3:28 a.m.
edited Nov 07 '14, 3:30 a.m.
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?

Accepted answer


permanent link
sam detweiler (12.4k6180201) | answered Nov 07 '14, 7:09 a.m.
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

One other answer



permanent link
Ralph Schoon (58.0k23642) | answered Nov 07 '14, 4:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

Your answer


Register or to post your answer.