It's all about the answers!

Ask a question

Jazz Server blocked after programmatically workitem saving


Massimo Caprinali (1636) | asked Mar 09 '10, 6:59 a.m.
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)

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?

One answer



permanent link
Massimo Caprinali (1636) | answered Mar 11 '10, 8:50 a.m.
I've resolved this particular situation deleting state from process and recreating it.

Your answer


Register or to post your answer.