Ok, the OldState should say 'InProgress',
and NewState should say 'Closed'
my advisor checks for workitems transitioning to 'Resolved' state..
String ResolvedState="resolved";
if (data instanceof ISaveParameter) {
// get the affected objects planned new state (cause this is a SAVE operation)
IAuditable auditable = ((ISaveParameter) data).getNewState();
// if this is a workitem
if (auditable instanceof IWorkItem)
{
// get the worker objects
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
WorkflowManager wfm = new WorkflowManager(iac);
// reference the right object type (cast)
IWorkItem workItem = (IWorkItem) auditable;
// get the workflow this workitem is in, so we can get the labels of the states
IWorkflowInfo x =wfm.getWorkflowInfo(workItem, monitor);
if(Debug) System.out.println("the workitem state is "+ workItem.getState2().getStringIdentifier()+ "=" +x.getStateName(workItem.getState2()) );
// if this workitem is going into resolved state (we accessed 'proposed new' state above
if(x.getStateName(workItem.getState2()).equalsIgnoreCase(ResolvedState))