Facing Issue in calling the follow-up action plugin
Hi All,
I have created a simple follow-up action using operation participant extension in "Web Services can be called for the Request Web Services can be called for the Request" like this. So please someone help me to resolve this issue asap. My Code: package wicreation; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import com.ibm.team.process.common.IProcessConfigurationElement; import com.ibm.team.process.common.IProjectAreaHandle; import com.ibm.team.process.common.advice.AdvisableOperation; import com.ibm.team.process.common.advice.IReportInfo; import com.ibm.team.process.common.advice.runtime.IOperationParticipant; import com.ibm.team.process.common.advice.runtime.IParticipantInfoCollector; import com.ibm.team.repository.common.IAuditable; import com.ibm.team.repository.common.TeamRepositoryException; import com.ibm.team.repository.service.AbstractService; import com.ibm.team.workitem.common.ISaveParameter; import com.ibm.team.workitem.common.IWorkItemCommon; import com.ibm.team.workitem.common.model.IAttribute; import com.ibm.team.workitem.common.model.IWorkItem; import com.ibm.team.workitem.common.model.IState; import com.ibm.team.workitem.common.model.IWorkItemReferences; import com.ibm.team.workitem.common.model.IWorkItemType; import com.ibm.team.workitem.common.model.Identifier; import com.ibm.team.workitem.common.model.WorkItemEndPoints; import com.ibm.team.workitem.common.model.WorkItemLinkTypes; import com.ibm.team.workitem.common.workflow.IWorkflowInfo; import com.ibm.team.workitem.service.IWorkItemServer; public class WIChildStory extends AbstractService implements IOperationParticipant { public void run(AdvisableOperation operation, IProcessConfigurationElement participantConfig, IParticipantInfoCollector collector, IProgressMonitor monitor) throws TeamRepositoryException { // TODO Auto-generated method stub //To get Operation data Object data = operation.getOperationData(); //To check whether it is save operation if (data instanceof ISaveParameter) { ISaveParameter param = (ISaveParameter) data; IAuditable auditable = param.getNewState(); //To check whether save operation is performed in WorkItem if (auditable instanceof IWorkItem) { IWorkItem sourceworkItem = (IWorkItem) auditable; //IWorkItemServer workItemServer = this.getService(IWorkItemServer.class); //To get WI type, previous and current state of source workitem String currentWItype = sourceworkItem.getWorkItemType(); String targetWItype = "enhancementrequest"; if(currentWItype.equalsIgnoreCase(targetWItype)){ System.out.println("Web Services can be called for the Request"); } } } } } Thanks in Advance!! |
2 answers
is it the same workitem? same state?
Sam |
I am facing a similar problem. My plugin is executing twice every time the save operation is performed.
Comments
Francisco Rodriguez
commented Jun 12 '14, 3:09 p.m.
My code is basically the same as the one from Karthikeyan. what rtc version are u using?
Francisco Rodriguez
commented Jun 12 '14, 3:46 p.m.
Sam, you saved my day. It was as simple as having the participant installed twice. |
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.