Getting IAttributeHandle from IAttribute
I need to set a value to an enumeration field
I know the IAttribute of the field, and in:
it says that i must call function:
Identifier ident = getLiteralEqualsString (String s, IAttributeHandle ah)
to get the Identifier value.
How I do get the IAttributeHandle from the IAttribute ?
Accepted answer
In your development environment set up based on the RTC Extensions workshop, you use Navigate>Open Type
You enter com.ibm.team.workitem.common.model.IAttribute and open the type.
Check the interfaces that com.ibm.team.workitem.common.model.IAttribute extends and answer your question.
The getLiteralEqualsString is a utility that needs to be written. I think it is shown in the post.
Comments
I resolved it looking at:
https://github.com/jazz-community/rtc-command-line/blob/master/src/com/cli/ccm/WorkItemManager.java
What is confused is that function getLiteralEqualString as shown in the help link
receives as parameter IAttributeHandle, but when it is called, in WorkItemManager.java it is called with IAttribute.
So there is not need to convert IAttribute to IAttributeHandle. It works the same sending IAttribute as parameter, even when getLiteralEqualString receives as parameter IAttributeHandle
My coding is not flawless, so fix the code for getLiteralEqualString.
I just checked the WCL https://github.com/jazz-community/work-item-command-line and there I also use the IAttributeHandle, but I resolve the handle to the IAttribute every time. This simplifies it for me but is less effective.
Yes, I did that and works. I had seen this function before, but my problem was that parameter ,
Thanks for the orientation
The APIs in Jazz products/EWM are all about handles and you need to resolve the handle to get at the full object.