It's all about the answers!

Ask a question

How to get Current State of WorkItem in RTC


Monali Jambhulkar (841430) | asked Oct 24 '12, 5:54 a.m.

Hello ,

I am trying to find out the Current state of WorkItem using RTC Java API.

i tried to use getState2 method for getting current state of workItem but getting null.

If you know more API  on the State then Pleas elte me know.

Thanks

Monali

2 answers



permanent link
Michele Pegoraro (1.8k12114103) | answered Oct 24 '12, 6:27 a.m.
Hi,
getState2 is correct in order to obtain an Identifier<IState> object. How do you have obtained the IWorkItem object? Which profile do you have used?

Michele.

permanent link
Timur Markunin (6495162145) | answered Oct 24 '12, 6:34 a.m.
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.
                     }


Your answer


Register or to post your answer.