Errors when saving work items by code (follow up - participant)
Hi guys,
I will try to explain this situation. I have a participant which is activated when I save a work item (child). This participant gets some attribute values from it's parent and sets them to the child (the work item which is saving). At the end of the code I have this:
fWorkItemServer.saveWorkItem2(workItem_workingCopy, null, null);
But it's showing this error (I could not upload the image because of a forum policy):
Error running operation 'Saving Work Item'
java.lang.StackOverflowError
java.lang.StackOverflowError
I tried with saveWorkItem2 and saveWorkItem3 but it's the same. And when I remove this line of code it doesn't show any error but the work item doesn't save the new values on it's fields.
I know this could be because when I save the work item the code saves it over and over again because it's always calling the participant but I need to know how to avoid this loop and keep the values that should be saved.
Could you please help me how to solve it?
Thank you!
Accepted answer
See https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ for how to use additional save parameter to avoid recursion.