1 Reply Latest reply on Apr 19, 2013 7:12 PM by Shobhit Tyagi

    Not able to get the Node Name

    Balaji Subramaniam Newbie

      I have simple Human Task Process,  Using JBPM API, I am trying to get the Node Name and I am getting Null Pointer Exception.  But I am able to get the Node Id.

       

      long nodeId = ((org.jbpm.workflow.instance.WorkflowProcessInstance)processInst).getNodeInstances().iterator().next().getId();

              LOG.info("Node Id : "+nodeId);

      nodeName = ((org.jbpm.workflow.instance.WorkflowProcessInstance)processInst).getNodeInstances().iterator().next().getNodeName();

       

      HumanTask.jpg

       

      Exception Message:

       

      Exception in getNodeName Method

      java.lang.NullPointerException

          at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:68)

          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:181)

          at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.getNodeContainer(WorkflowProcessInstanceImpl.java:69)

          at org.jbpm.workflow.instance.impl.NodeInstanceImpl.getNode(NodeInstanceImpl.java:103)

          at org.jbpm.workflow.instance.node.WorkItemNodeInstance.getNodeName(WorkItemNodeInstance.java:314)

          at com.jpmorgan.jbpm.process.SpringProcessManagement.getNodeName(SpringProcessManagement.java:206)

          at com.jpmorgan.jbpm.controllers.StartProcess.actionOnTask(StartProcess.java:106)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)

          at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)

          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)

          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)

          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)

          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)

          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)

          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)

          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)

          at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)

          at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)

          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

       

      Could you please help me to resolve this issue?

       

      Balaji