It's all about the answers!

Ask a question

calculateCategoryAsString


Álvaro Alonso (35127) | asked Jan 03 '19, 8:28 a.m.

 I have installed the command line of the work items, and the following code gives me an error in the methods "getWorkItemCommon" and "getMonitor".


private String calculateCategoryAsString(Object value)
            throws TeamRepositoryException {
        if (value != null) {
            if (value instanceof ICategoryHandle) {
                return getWorkItemCommon().resolveHierarchicalName(
                    (ICategoryHandle) value, getMonitor());
            }
            throw new WorkItemCommandLineException(
                    "Convert Category - Incompatible Type Exception: "
                            + value.toString());
        }
        return CONSTANT_NO_VALUE;
    }

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Jan 03 '19, 10:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

getWorkItemCommon() is implemented in an  abstract class and returns the client library IWorkItemCommon usign getClientLibrary(). getMonitor() is implemented similar and returns an IProgressMonitor. For a monitor you can pass null as well. The link I provided has several other links talking about the basics of the plain java clienent libraries/rtc java API, especially in the section about getting started. You want to read those as well.

 IWorkItemCommon.resolveHierarchicalName(
                    (ICategoryHandle) value, null);
    





    


Your answer


Register or to post 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.