Bug 1022414 - improving error message if process cannot be found
Summary: improving error message if process cannot be found
Keywords:
Status: NEW
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM 5
Version: BRMS 5.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Kris Verlaenen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-23 08:52 UTC by Toshiya Kobayashi
Modified: 2023-05-31 22:25 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Toshiya Kobayashi 2013-10-23 08:52:35 UTC
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 "...


Note You need to log in before you can comment on or make changes to this bug.