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]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to