TeamOperationCanceledExeption in Participant when a Java Script Conditions executes
Is there a way to catch the TeamOperationCanceledException and trigger a retry of the WorkItemSave3 operation? Details of where the exception is coming from is as follows: I am running RTC 6.0.3 server in a project that only utilizes the web interface. There are java scripts in this environment along with a Save Advisor and a Save Participant extension. The Participant code is extending AbstractService, implements IOperationParticipant and retrieves information from another work item and populates fields in the current work item that are read-only on the display so the user can't update these fields but the user has privileges to update said fields. The save operation extension point is defined in the plugin project. There are two fields that are not touched by the Participant, one is an enumeration field with possible values of "YES", "NO", and "UNASSIGNED". The second is a Large HTML field. There is a Conditions Java Script in the Attribute Customization that Flags the HTML field as required when the enumeration field has a value of "YES". This script works as expected if this is the only updated to the current work item. The problem occurs when a new work item is created and the participant code is executed in the same Save transaction as the Enumeration field in question is updated to "YES".
The error message at the top of the Web interface says:
In the ccm.log file:
I have isolated the line that is triggering the error:
The reference to the currentWorkItem is a WorkingCopy. I have the saveWorkItem3 command wrapped in a try/catch and am catching the TeamOperaitonCanceledException and rethrow a TeamRepositoryException to pass it back out to the run method of the participant
|
2 answers
Ralph Schoon (63.6k●3●36●46)
| answered Nov 07 '18, 2:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER For all I know, the error you see is thrown because another participant prevents the save due to a required attribute. There is no way you can fix this. The only way to avoid the error is by providing the value(s) required attribute(s). |
This seems like errant behavior. The work-around that I settled on was moving the conditions java script out of the New state. Once the participant was able to complete execution for a new work item, the Conditions script was not trying to execute while the work item was in the initialize state. |
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.