It's all about the answers!

Ask a question

How to solve incompatible issue with com.ibm.team.workitem.common.model.IWorkItem


Aditya Shankar (718) | asked May 08 '19, 8:29 a.m.

 Exception running followup action. An unhandled exception occurred during "Demo Prearticipant".

com.ibm.team.workitem.common.internal.SaveParameter incompatible with com.ibm.team.workitem.common.model.IWorkItem.

java.lang.ClassCastException: com.ibm.team.workitem.common.internal.SaveParameter incompatible with com.ibm.team.workitem.common.model.IWorkItem

One answer



permanent link
Ralph Schoon (63.1k33645) | answered May 08 '19, 8:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Check instanceof before cast and return if not. Also read How should I ask a question in the Forum if I want to receive useful answers? and follow in the future.


Comments
Aditya Shankar commented May 08 '19, 9:35 a.m.
here is my code where it need to be change ..please suggest 

SaveParameter save = (SaveParameter) obj;

IAuditable audi = save.getNewState();
if((save.getAdditionalSaveParameters() == null ) || (save.getAdditionalSaveParameters() != null) && (!save.getAdditionalSaveParameters().contains(this.Recursion)))
{
if(audi instanceof IWorkItem)
{
IWorkItem work = (IWorkItem) obj;
IWorkItemServer serverWI = getService(com.ibm.team.workitem.service.IWorkItemServer.class);
}

}


Ralph Schoon commented May 08 '19, 10:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I am not going to do your coding. I think I updated the latest RTC Extensions Workshop so that it is more reliable. Consider checking that code. 

Your answer


Register or 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.