RTC how to update programmatically workitems?
Hi
I need to update a workitem in a operationParticipant, i need to add a new subscriber.
i already retrieved the subscriber,and I got the subscription list of the workitem and added it to the list, but the change doesnt appear in the UI, i suppose that i need a way to do a commit or save the workitem.
I m doing this in the server side, in a follow up action
|
2 answers
You need to do the commit of the changes, and then you should refresh the UI, so you can see the changes. You can see some of the more common ways of doing these things in the RTC 4.0 Extensions Workshop (https://jazz.net/library/article/1000).
|
You will need to add the IWorkItemServer service as a dependency to your plugin if you have not already done so. Once you have added the dependency, you can save your work item using the IWorkItemServer#saveWorkItem2() method as shown below: IWorkItem workItem = ... IWorkItemServer workItemServer = getService(IWorkItemServer.class); Comments Hi Jared
The code that you posted works when the workitem its not created, but when I am gonna used it on a created workitem i got a exception on the saveWorkItem2 method, the message its: Stale data, but i havent change the workitem, there is a way to refresh the workitem before save it?
Nicolás Rodríguez
commented Jul 31 '12, 6:39 p.m.
I resolved the problem, first you need to retrive again the workItem: wiServer = getService(IWorkItemServer.class); IWorkItem wi = (IWorkItem)wiServer.getAuditableCommon().resolveAuditable(newState, IWorkItem.FULL_PROFILE, monitor).getWorkingCopy(); and them you can modify the work item. and them you save it, but then its goning to appear the a great problem, the propagation, the solution for that is in the next forum https://jazz.net/forum/questions/53983/avoid-participant-propagation |
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.