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:
}
How could I get the change sets included in the delivery?
or
What javadoc or steps do you follow for getting this information?
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
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))
// get the deliver data
scmChange = (IScmDeltaSource) operation.getOperationData();
// loop thru the changes
for (IChangeHistoryAddOperandDelta delta : scmChange.getDeltas(IChangeHistoryAddOperandDelta.class))
One other answer
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.
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.