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

Facing Issue in calling the follow-up action plugin

Hi All,
I have created a simple follow-up action using operation participant extension in RTC 2.0.0.2.
Function of follow-up action:When save operation is performed in my custom workitem(here Enhancement request), the plugin will be triggered and prints "Web Services can be called for the Request".
Issue: My code is called twice whenever save operation is performed in custom workitem(Enhancement request) and prints
"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!!

0 votes



2 answers

Permanent link
is it the same workitem? same state?

Sam

0 votes


Permanent link
 I am facing a similar problem. My plugin is executing twice every time the save operation is performed. 

0 votes

Comments

My code is basically the same as the one from  Karthikeyan.

what rtc version are u using? 

I don't see this in any of my participants.
can u check the process config source xml and search for the participant.(followup-action) to see if it might be installed twice?

<followup-actions>
somewhere after the followup-actions element
                    <followup-action xmlns="http://com.ibm.team.process/setUpProject" description="Initializes a project area with the pieces necessary to start work on a project." id="com.ibm.team.process.server.setUpProject" name="Setup Project"

 Sam, you saved my day. It was as simple as having the participant installed twice. 

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,943

Question asked: Jan 25 '12, 9:23 a.m.

Question was seen: 4,790 times

Last updated: Jun 12 '14, 3:46 p.m.

Confirmation Cancel Confirm