How to get Current State of WorkItem in RTC
2 answers
Hello Monali,
you could use
IWorkItem newState = (IWorkItem) saveParameter.getNewState();
Identifier<IState> newStateId = newState.getState2();
String state = newStateId.getStringIdentifier();
or determine state group. It allows to work with different work item workflows:
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
WorkflowManager wfm = new WorkflowManager(iac);
IWorkflowInfo wi =wfm.getWorkflowInfo(newState, monitor);
//Check status group
if (wi.stateGroupContains(IWorkflowInfo.CLOSED_STATES, newStateId))
{
//do smth.
}
you could use
IWorkItem newState = (IWorkItem) saveParameter.getNewState();
Identifier<IState> newStateId = newState.getState2();
String state = newStateId.getStringIdentifier();
or determine state group. It allows to work with different work item workflows:
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
WorkflowManager wfm = new WorkflowManager(iac);
IWorkflowInfo wi =wfm.getWorkflowInfo(newState, monitor);
//Check status group
if (wi.stateGroupContains(IWorkflowInfo.CLOSED_STATES, newStateId))
{
//do smth.
}