RTC Extension - Participant
Hi Jazz Team,
I am creating RTC extension which will change some attr values after save but even when I am creating sample example I received error after save. Maybe somebody will have some ideas
Error: Problem An error occurred during "Save Work Item". java.lang.StackOverflowError
import org.eclipse.core.runtime.IProgressMonitor; plugin.xml |
Accepted answer
// setup
private static final String Recursion = "Approvalsbypass"; // can be anything u want must be unique private static Set<String> bypass = new HashSet<String>(new ArrayList<String>(Arrays.asList(Recursion))); // in handler Object data = operation.getOperationData(); ISaveParameter saveParameter = null; if (data instanceof ISaveParameter) { saveParameter = (ISaveParameter) data; // check to see if we are being called again from our save // if not, process, otherwise skip the work // if no parms, or the parm is not ours, process request. if ( (saveParameter.getAdditionalSaveParameters() == null) || ((saveParameter.getAdditionalSaveParameters() != null) && (!saveParameter.getAdditionalSaveParameters().contains(Recursion))) ) { // do all your normal processing here ... // if u need to update the workitem you are processing for // this will cause this plugin to be called again saveStatus = fWorkItemServer.saveWorkItem3(workingCopy, null, null, bypass); } } Bartosz Chrabski selected this answer as the correct answer
Comments
Susan Hanson
commented Jun 24 '14, 7:30 p.m.
SWEET!!!! You have just made my day!
Bartosz Chrabski
commented Jun 25 '14, 5:43 a.m.
Thanks a lot |
One other answer
Normally this means that you are recursing through this until you run out of memory.
Remember that when you do the Save, it will invoke this same participant again (because you saved the work item). So basically, first time, you go in, save html summary. This calls the same one, it sets the html summary and saves, which sets the HTML summary and saves, which calls it again and sets the html summary and saves ..... So you have to have something where you decide you do *not* need to set the HTML summary and you get out. Susan Comments
sam detweiler
commented Jun 24 '14, 6:33 p.m.
or you use saveworkitem3 and pass a parameter in the last parm that tells your code its you invoking the extension, and ignore it
Susan Hanson
commented Jun 24 '14, 6:42 p.m.
|
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.