item from handle,,,again, and still difficult
![]()
I am working on a server side OperationAdvisor, and need to get the state of the workitem at the far end of a link.
I've got the IWorkItemHandle. this brings up a constant problem.. how do you get from handle to object? I've found samples thru the forums, but in every case some data item is missing from the context I'm in, with no clear way to find it. why is this so hard? I've looked up and down the object and method tree, but don't find anything that seems reasonable. ---- Additionally, there is the abstraction between values and the UI representation of same.. like workitem state.. I don't see a clear way to get the label of the numeric value.. I don't care about the numeric.. makes no sense in a useful application.. you would think there would be a decent method from the item itself back thru whatever to get the label. I don't KNOW the workflow process this workitem is in, and don't CARE.. I just want to determine if this workitem new state is transitioning to 'Resolve'.. all ideas welcomed.. cause I'm completely lost.. about 10 hours of digging thru objects and methods hasn't produced a single usable option. I NEED this done today.. Identifier<IState> is = workItem.getState2(); Sam |
4 answers
|
![]()
Hi Sam,
I'm a developer who's new-ish to the Jazz Foundation Process team, so this isn't quite my area of expertise. Regarding your first question, about getting an object from an IWorkItemHandle, you might find the following page useful: https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation In the 'Plain-Java Client' section is a complete sample that gets an IWorkItem from an IWorkItemHandle: IAuditableClient auditableClient= (IAuditableClient) teamRepository.getClientLibrary(IAuditableClient.class); ... IWorkItem workItem= auditableClient.resolveAuditable(handle, IWorkItem.FULL_PROFILE, monitor); The second part of your post is specific to the RTC Work Items component. I've sent an email to alert them to this post if they haven't seen it already. Take care. |
![]()
thanks..
two things.. 1. I believe this code, installed on the server, is running in server context, so a clientlibrary seems the wrong approach.. 2. I don't have a repository reference.. this is one of the places where if I NEED that, the reference should be supplied as part of the execution context I am in, not ME having to go FIND the right approach to get the context.. sorry, my OO background is railing against some of the hard to follow model here. also, I am not running in a workitem client.. I am in an OperationAdvisor precondition 'exit' running in the server. I have a workitem client in another solution, my development of that also suffered from this same abstraction problem. this really isn't a lot of code, and shouldn't be this hard.. this is our local implementation of enhancement https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/182769 to support blocking for Depends On links, which isn't supported today so, when THIS workitem is transitioning to Resolve(d) state, I need to check for closure of the depended on links. so I need to find the depends on links (got that) then I need to look at the status of the workitem on the other end of the link. stuck at the ********
as an example of the complexity I/we face, the verb and Noun names are obtuse and mixed up all over the place, IAuditable auditable = ((ISaveParameter) data).getNewState(); why should I expect a 'State' to turn into an complete object? and when should I expect it to be a discrete value for the same Noun and verb? Identifier<IState> is = workItem.getState2(); |
![]()
Ok, I got it..
the data passed to the OperationAdvisor, during a save operation (ISaveParameter) has a two object removed class IAuditableCommon
which can be used to locate the other classes required. or get (resolveAuditable) the object from the handle retrieved (resolve) from the link object reference (wir)
|
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.