Description of problem: Backport the following commit to BRMS 5.3.x. https://github.com/droolsjbpm/jbpm/commit/69851706a1bdad306a077ffa9cf24bf294859da4 Current implementation causes NullPointerException in processInstance.setProcess() if process == null. processInstance.setProcessId( processId ); Process process = ruleBase.getProcess( processId ); if ( ruleBase != null ) { processInstance.setProcess( process ); } Steps to Reproduce: 1. Start a process instance which has a safe point so the process instance is persisted. 2. Create a new kbase which doesn't have the process definition of the process instance. 3. Create a new ksession from the kbase 4. ksession.getProcessInstance(pid) Actual results: Exception in thread "main" java.lang.NullPointerException at org.jbpm.process.instance.impl.ProcessInstanceImpl.setProcess(ProcessInstanceImpl.java:61) at org.jbpm.marshalling.impl.AbstractProtobufProcessInstanceMarshaller.readProcessInstance(AbstractProtobufProcessInstanceMarshaller.java:375) at org.jbpm.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:142) at org.jbpm.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:83) at org.jbpm.process.instance.ProcessRuntimeImpl.getProcessInstance(ProcessRuntimeImpl.java:205) at org.drools.common.AbstractWorkingMemory.getProcessInstance(AbstractWorkingMemory.java:1100) at org.drools.impl.StatefulKnowledgeSessionImpl.getProcessInstance(StatefulKnowledgeSessionImpl.java:295) at org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:48) at org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:25) at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36) at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:360) at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getProcessInstance(CommandBasedStatefulKnowledgeSession.java:125) at com.sample.ProcessMainJPA.main(ProcessMainJPA.java:86) Expected results: Throws a RuntimeException("Could not find process "...