Jazz Server blocked after programmatically workitem saving
![](http://jazz.net/_images/myphoto/d9e58fb712309098b33a2ea9667e5628.jpg)
Hi, I have a problem with a server follow-up action (IOperationParticipant ).
I'm trying to save a WI change during a state transition (Verified -> Approved)
The problem is, when I'm calling saveWorkItem2 method, server appear to be blocked (not responding). This sounded strange because if I perform same operation in a different transition, all works fine.
This drives me crazy. Please... can you help me?
I'm trying to save a WI change during a state transition (Verified -> Approved)
if (StateChecker.isTransitioning(auditableCommon, saveParameter, CW.getStateId(CW.VERSION_VERIFIED_STATE), CW.getStateId(CW.VERSION_APPROVED_STATE), monitor)) {
IWorkItem workItemFreshCopy = getFreshCopy(workItem, monitor);
IWorkItem workingCopy = (IWorkItem) workItemFreshCopy.getWorkingCopy();
IAttribute versionRevision = getWorkItemCommon().findAttribute(workItemFreshCopy.getProjectArea(), WorkItemAttributes.VERSION_REVISION.getStringIdentifier(), monitor);
Pattern pattern = Pattern.compile("([A-Z]+) draft");
Matcher matcher = pattern.matcher((String)workItemFreshCopy.getValue(versionRevision));
if(matcher.find()) {
if(matcher.groupCount() > 0) {
String actualVersion = null;
actualVersion = matcher.group(1);
workingCopy.setValue(versionRevision, new String(actualVersion));
IStatus s = getWorkItemService().saveWorkItem2(workingCopy, null, null);
if (!s.isOK())
throw new TeamRepositoryException("Errore nel salvataggio. " + s.getMessage());
}
}
private IWorkItem getFreshCopy(IWorkItem workItem, IProgressMonitor monitor) throws TeamRepositoryException {
return getWorkItemService().findWorkItemById(workItem.getId(), IWorkItem.FULL_PROFILE, monitor);
}
The problem is, when I'm calling saveWorkItem2 method, server appear to be blocked (not responding). This sounded strange because if I perform same operation in a different transition, all works fine.
This drives me crazy. Please... can you help me?