It's all about the answers!

Ask a question

How to cancel a save operation?


Annie Ying (2063103) | asked Jul 17 '07, 5:09 p.m.
JAZZ DEVELOPER
Is there any way to cancel a save operation from a IWorkingCopyListener? I've added new fields to the workitem overview page using the custom attribute mechanism, along with some error checking on the few fields in my listener that implements IWorkingCopyListener. However, I have some problem in stopping the save operation when the error checking fails. I've attempted to throw an OperationCancelException (which is used when the error checking fails in the "Estimate" field), but this doesn't work in my case because the listener is running asynchronously with the UI thread.

One answer



permanent link
Christof Marti (681) | answered Sep 18 '07, 8:36 a.m.
Listeners cannot cancel the operation. You could register an IOperationAdvisor for the "com.ibm.team.workitem.operation.workItemSave" operation in your service plug-in and do the error checking there. This will additionally work for the Web UI.

Christof


aying wrote:
Is there any way to cancel a save operation from a
IWorkingCopyListener? I've added new fields to the workitem overview
page using the custom attribute mechanism, along with some error
checking on the few fields in my listener that implements
IWorkingCopyListener. However, I have some problem in stopping the
save operation when the error checking fails. I've attempted to
throw an OperationCancelException (which is used when the error
checking fails in the "Estimate" field), but this doesn't
work in my case because the listener is running asynchronously with
the UI thread.

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.