How to get the state Identifier by state name by program?

One answer

Jia,
you can either look it up in the process XML, or you can look it up while debugging or you could write a small tool to look at the data. Based on the ProgrammaticWorkItemCreation wiki page example:
int id = new Integer(idString).intValue();
IWorkItem workItem = workItemClient.findWorkItemById(id,
IWorkItem.FULL_PROFILE, null);
Identifier<IState> state=workItem.getState2();
String stateID = state.getStringIdentifier();
System.out.println("State: " + stateID + ".");
you can either look it up in the process XML, or you can look it up while debugging or you could write a small tool to look at the data. Based on the ProgrammaticWorkItemCreation wiki page example:
int id = new Integer(idString).intValue();
IWorkItem workItem = workItemClient.findWorkItemById(id,
IWorkItem.FULL_PROFILE, null);
Identifier<IState> state=workItem.getState2();
String stateID = state.getStringIdentifier();
System.out.println("State: " + stateID + ".");