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
Ralph Schoon (63.3k●3●36●46)
| answered Nov 22 '21, 8:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 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.
Marcelo Bilezker selected this answer as the correct answer
Comments
Marcelo Bilezker
commented Nov 22 '21, 6:28 p.m.
I resolved it looking at:
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.
Marcelo Bilezker
commented Nov 23 '21, 9:22 a.m.
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. |
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.