Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to get Current State of WorkItem in RTC

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

0 votes



2 answers

Permanent link
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.

0 votes


Permanent link
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.
                     }


0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926

Question asked: Oct 24 '12, 5:54 a.m.

Question was seen: 6,332 times

Last updated: Oct 24 '12, 6:34 a.m.

Confirmation Cancel Confirm