JBoss Community

Unable to mark a task completed when running the task in a separate thread

created by Connie Yang in jBPM Development - View the full discussion

Hi,

 

I have a WorkItemHandler that can run the service task either in the main thread or in a separate thread.  This is my way of handling for-each parallel (aka fanout).  When the service task is run in a separate thread, I have been experiencing a NullPointerException with the following stack trace upon marking the task completed (via NodeInstanceImpl.triggerCompleted).  What am I missing?

 

  1. java.lang.NullPointerException

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

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

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

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

      at org.jbpm.workflow.instance.node.ActionNodeInstance.getActionNode(ActionNodeInstance.java:35)

      at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:43)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:122)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:185)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:150)

      at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:47)

      at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:162)

      at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:143)

      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:239)

      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301)

      at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277)

      at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:333)

      at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:117)

      at com.ebay.cloud.orchest.jbpm.LcmPojoWorkItemHandler$1.run(LcmPojoWorkItemHandler.java:95)

      at com.ebay.kernel.executor.TaskExecutor$Adapter.call(TaskExecutor.java:587)

 

Thanks in advance!

Connie

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community