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.
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.
Accepted answer
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.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 19 '15, 4:33 a.m.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.
ast java
May 19 '15, 4:46 a.m.Hi Raiph,
Thanks for your reply.
I have updated it.