It's all about the answers!

Ask a question

How get a list of available states


Maria Velasco (4641) | asked Jan 28 '09, 6:08 p.m.
Hello,

I have the following lines of code

IWorkItemClient workItemClient = (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class);
IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(workItem, monitor);
Identifier<IState>[] states = workflowInfo.getAllStateIds();

Can someone please tell me what I'm doing wrong because the following line is failing?

IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(workItem, monitor);

Thanks in advance.

5 answers



permanent link
Maria Velasco (4641) | answered Jan 29 '09, 12:47 p.m.
I am now trying it this way

IWorkItemClient workItemClient = (IWorkItemClient) repo.getClientLibrary(IWorkItemClient.class);
WorkflowManager workflowManager = (WorkflowManager) workItemClient.getWorkflowManager();
ICombinedWorkflowInfos combWorkflowInfos = workflowManager.getCombinedWorkflowInfos(projectAreaHandle, monitor);

But in this scenario, there is a problem in the 3rd line also. Here is the stack trace that it returns

java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
at com.ibm.team.process.internal.common.util.AbstractProcess.computeConfigurationData(AbstractProcess.java:320)
at com.ibm.team.process.internal.common.util.AbstractProcess.getProjectConfigurationData(AbstractProcess.java:302)
at com.ibm.team.workitem.client.internal.AuditableClientProcess.findProcessConfiguration(AuditableClientProcess.java:64)
at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.updateCache(WorkflowManager.java:586)
at com.ibm.team.workitem.common.internal.util.CacheHelper.internalCheckCache(CacheHelper.java:90)
at com.ibm.team.workitem.common.internal.util.CacheHelper.checkCache(CacheHelper.java:53)
at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getProjectAreaRegistry(WorkflowManager.java:518)
at com.ibm.team.workitem.common.internal.workflow.WorkflowManager.getCombinedWorkflowInfos(WorkflowManager.java:469)
at com.telelogic.integration.rtcapi.RtcServiceWrapper.getStates(RtcServiceWrapper.java:300)
at com.telelogic.integration.rtcapi.RtcServiceWrapper.getWorkItemStates(RtcServiceWrapper.java:351)
at com.telelogic.integration.change.rqmadapter.ui.server.RqmAdapterServiceImpl.getAllAdapterStates(RqmAdapterServiceImpl.java:1310)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:528)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:253)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)

Please help.

Hello,

I have the following lines of code

IWorkItemClient workItemClient = (IWorkItemClient)repo.getClientLibrary(IWorkItemClient.class);
IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(workItem, monitor);
Identifier<IState>[] states = workflowInfo.getAllStateIds();

Can someone please tell me what I'm doing wrong because the following line is failing?

IWorkflowInfo workflowInfo = workItemClient.findWorkflowInfo(workItem, monitor);

Thanks in advance.

permanent link
Patrick Streule (4.9k21) | answered Feb 03 '09, 4:38 a.m.
JAZZ DEVELOPER
It looks like the process initialization failed for some reason. Are you
creating the project area programmatically, too?

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Maria Velasco (4641) | answered Feb 03 '09, 12:08 p.m.
It looks like the process initialization failed for some reason. Are you
creating the project area programmatically, too?

--
Regards,
Patrick
Jazz Work Item Team



I was able to debug further and the code seems to be throwing me a NullPointerException in the file ModelGenerator.java line 108

This is the actual line

parser.setProperty(SAX_PROPERTIES_SCHEMA_LOCATION,null);

I am not creating the project area programmatically. It has already been created and I simply just get all the available project areas and loop through to find the one I want.

permanent link
Patrick Streule (4.9k21) | answered Feb 03 '09, 4:31 p.m.
JAZZ DEVELOPER
I was able to debug further and the code seems to be throwing me a
NullPointerException in the file ModelGenerator.java line 108

This is the actual line

parser.setProperty(SAX_PROPERTIES_SCHEMA_LOCATION,null);

I am not creating the project area programmatically. It has already
been created and I simply just get all the available project areas
and loop through to find the one I want.

Some SAX parser implementations are stricter than others when it comes to
null arguments, so this could be a bug.
But someone from the Process team has probably more insight into this
problem.

--
Regards,
Patrick
Jazz Work Item Team

permanent link
Maria Velasco (4641) | answered Feb 05 '09, 11:51 a.m.
I was able to debug further and the code seems to be throwing me a
NullPointerException in the file ModelGenerator.java line 108

This is the actual line

parser.setProperty(SAX_PROPERTIES_SCHEMA_LOCATION,null);

I am not creating the project area programmatically. It has already
been created and I simply just get all the available project areas
and loop through to find the one I want.

Some SAX parser implementations are stricter than others when it comes to
null arguments, so this could be a bug.
But someone from the Process team has probably more insight into this
problem.

--
Regards,
Patrick
Jazz Work Item Team

Hi,

Thanks for your help, do you have someone specific in the Process Team that I can ask for more help from or another forum where I can post this question to get more information. I really need to get this working. I need to get a list of all the available states that a Work Item has.

Thanks again!

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.