How to fetch component and stream name from a changeset associated to a workitem
5 answers
If this is a SCM delivery participant, you can probably get at the data. Start 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/
It is an advisor, but except that it implements the advisor, all the other code is relevant. That at least gives you the right entry point into the SCM API. I don't have more example code. You can find some other code using the SCM API on https://rsjazz.wordpress.com/ and there is also some code on http://thescmlounge.blogspot.de/ but probably not exactly what you are looking for.
It is an advisor, but except that it implements the advisor, all the other code is relevant. That at least gives you the right entry point into the SCM API. I don't have more example code. You can find some other code using the SCM API on https://rsjazz.wordpress.com/ and there is also some code on http://thescmlounge.blogspot.de/ but probably not exactly what you are looking for.
Comments
Object data1 = operation.getOperationData();
DeliverOperationData deliverydata = (DeliverOperationData) data1;
I have used the above given code snippet, but facing the below given exception. Please suggest.
java.lang.ClassCastException: com.ibm.team.workitem.common.internal.SaveParameter incompatible with com.ibm.team.scm.common.process.DeliverOperationData
DeliverOperationData deliverydata = (DeliverOperationData) data1;
I have used the above given code snippet, but facing the below given exception. Please suggest.
java.lang.ClassCastException: com.ibm.team.workitem.common.internal.SaveParameter incompatible with com.ibm.team.scm.common.process.DeliverOperationData
Comments
currently, we have the below given existing method which accepts IParticipantInfoCollector as one of the arguments.
public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
System.out.println("Welcome to DXA ALM Server side Plugin");
Object data = operation.getOperationData();
ISaveParameter saveParameter = null;
}
but for the DeliverOperationData, one of the argument is mismatching - which is IAdvisorInfoCollector how can we make both the methods compatible? please suggest.
public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
Object operationData = operation.getOperationData();
DeliverOperationData data = (DeliverOperationData) operationData;
}
public void run(AdvisableOperation operation,
IProcessConfigurationElement participantConfig,
IParticipantInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
System.out.println("Welcome to DXA ALM Server side Plugin");
Object data = operation.getOperationData();
ISaveParameter saveParameter = null;
}
but for the DeliverOperationData, one of the argument is mismatching - which is IAdvisorInfoCollector how can we make both the methods compatible? please suggest.
public void run(AdvisableOperation operation,
IProcessConfigurationElement advisorConfiguration,
IAdvisorInfoCollector collector, IProgressMonitor monitor)
throws TeamRepositoryException {
Object operationData = operation.getOperationData();
DeliverOperationData data = (DeliverOperationData) operationData;
}
Comments
How to fetch DeliverOperationData reference inside AbstractService class. Can you please tell me if is there any way to fetch this DeliverOperationData in my user defined class.
Comments
The ClassCastException thrown to indicate that your code has attempted to cast an object to a subclass of which it is not an instance. Casting only works when the casted object follows an is a relationship to the type you are trying to cast to.
When will be ClassCastException is thrown:
- When you try to cast an object of Parent class to its Child class type, this exception will be thrown.
- When you try to cast an object of one class into another class type that has not extended the other class or they don't have any relationship between them.