It's all about the answers!

Ask a question

A Tip on Saving work item and the IDetailedStatus result


1
1
Kevin Ramer (4.5k6173191) | asked Jun 28 '13, 1:29 p.m.
edited Jul 09 '13, 3:03 p.m.
This isn't a question or issue, just a nugget of "bitten by" wisdom.   Situation:  I have a Java RTC Client application that is a go-between that will create / update RTC work items in response records created in another system.  Users of this special client were finding that RTC work items were being created, but the necessary back-link to the other system were not being set, so new work items were getting created ....

Turns out the idiom that one will find by searching jazz.net for 'IDetailedStatus' is this:

            IDetailedStatus s = wc.save(null);
                      
            if (!s.isOK()) {
           // failure something bad happened
                throw new TeamRepositoryException(s.getException());
            }
Stepping through the Java source with a debugger and looking at the "contents" of that IDetailedStatus showed this message:

CRRTC0298W: The value of the attribute 'Stack Voters' was sent incorrectly. The attribute has been set to it's default value
I did some research on the IDetailedStatus (DetailedStatus and the eclipse Status) javadocs.   For this application any  result "higher" than WARNING should trigger the failure.  Thus I changed the if statement to this:

if (!s.isOK() && ! s.matches(DetailedStatus.INFO | DetailedStatus.Warning ) ) {
....
}

Works like a champ.



One answer



permanent link
Ralph Schoon (61.6k33643) | answered Jul 08 '13, 5:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Thanks for sharing.

Your answer


Register or to post your answer.