[jboss-user] [jBPM] - calling the setVariable on reloaded ProcessInstance leads to NullPointerException

Oleg Bondarenko do-not-reply at jboss.com
Mon Mar 4 06:01:36 EST 2013


Oleg Bondarenko [https://community.jboss.org/people/obon] created the discussion

"calling the setVariable on reloaded ProcessInstance leads to NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/800555#800555

--------------------------------------------------------------
Hi,

at some point in my application I reload my session:

 JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, config, env);

then my process instance:

 WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);

and then try to set a process variable: 

 processInstance.setVariable(name, value)

which fails :
java.lang.NullPointerException
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:68)
    at org.jbpm.process.instance.impl.ProcessInstanceImpl.getContextInstance(ProcessInstanceImpl.java:133)
    at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.setVariable(WorkflowProcessInstanceImpl.java:238)
    ...

The reason is: the variable InternalKnowledgeRuntime kruntime in ProcessInstanceImpl is null. 

Is it a bug or is there another way to load the process instance?

Regards,
Oleg
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/800555#800555]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130304/f28179f8/attachment.html 


More information about the jboss-user mailing list