Modifying Work item through An RTC advisor on Deliver operation
Hi All,
Accepted answer
For almost all objects in RTC it is required to get a working copy that then allows the modification. See https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ for how that works for a work item in the server API. You might want to search that blog for more information related to Java APIs and how to use it.
The relevant code is shown below.
// Get the full state of the parent work item so we can edit it IWorkItem workingCopy = (IWorkItem) fWorkItemServer.getAuditableCommon() .resolveAuditable(workItem, IWorkItem.FULL_PROFILE, monitor) .getWorkingCopy();
Comments
Note that you are NOT supposed to do something like this in an Advisor.
Billion Thanks Ralph . It is Worked for me.
To follow up on Ralph's response. Another reason why it doesn't make sense to do this in an advisor is that in theory multiple advisors may be triggered on the operation. So you may end up writing data in your advisor (ex: update a work item), only to have some other advisor run afterwards which invalidates/cancels the operation, leaving your system in an inconsistent state (assuming your 'write' operation is depending on the trigger operation completing successfully).
1 vote