Marco Rietveld [
https://community.jboss.org/people/marco.rietveld] created the discussion
"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"
To view the discussion, visit:
https://community.jboss.org/message/806565#806565
--------------------------------------------------------------
h4. What's probably happening is that the code you're calling is happening outside
of a transaction.
You've posted the code above, so you can see that the NPE is probably happening
because the ProcessInstanceImpl.kruntime field is null.
The kruntime field in the ProcessInstanceImpl is set to null as soon as the transaction is
closed. This has to do with making sure that jBPM doesn't cache old copies of
processinstances.
So, in this case, when you call
wpi.getNodeInstances()
the transaction has already ended (it ended within the ksession.getProcessInstance()
method).
May I ask why you want a list of NodeInstances? There may be other ways to get the
information that you're looking for. Also, at the moment that you're looking for
the node instances, there shouldn't be any or otherwise you're betting on a race
condition.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/806565#806565]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]