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

How to print the literal value of state and type of workitem?

Hi Team,
I am new to RTC and i am trying to dump the values of workitem.
During this I am trying to print literal value the state and type of the workitem.
Ex. State - "Open" , "In Progress" , "Closed" .     
 Type - "Task" , Defect" ...
I had used the below code to retrieve and the output as follows,
Actual output is :
 **********************
workItem.getState2().getScopedIdentifier()     --- com.rtc.configuration.workflow.workflowdefinition.defect.state.s3  workItem.getWorkItemType()  --- com.rtc.configuration.workitemtype.type.defect

Expected output :
**********************
I want the output as state is --- "Closed"                                
type is --- "Defect" Please let me know how to achieve this.

Thanks in advance.

0 votes

Comments

This question is unreadable, open the question click on the rightmost icon in the bar to see the HTML source and remove the unnecessary markup.

Hi Raiph,
Thanks for your reply.
I have updated it.


Accepted answer

Permanent link
You can use workflowInfo.getStateName(stateId) to get the name of a state.

		Identifier<IState>[] states = workflowInfo.getAllStateIds();
		for (Identifier<IState> stateId : states) {
			if (workflowInfo.getStateName(stateId).equals(value)) {
				return stateId;
			}
		}
See A RTC WorkItem Command Line Version 2.2 for a good source of code that handles this kind of information.
ast java selected this answer as the correct answer

1 vote

Comments

For the work item type use:


workItemType.getDisplayName() to print its name.

Hi Ralph,
It's working. Thanks.

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
× 460

Question asked: May 19 '15, 4:07 a.m.

Question was seen: 4,028 times

Last updated: May 19 '15, 5:56 a.m.

Confirmation Cancel Confirm