Bug 1022414 - improving error message if process cannot be found
improving error message if process cannot be found
Status: NEW
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM 5 (Show other bugs)
BRMS 5.3.1
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Kris Verlaenen
Radovan Synek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 04:52 EDT by Toshiya Kobayashi
Modified: 2015-07-08 13:30 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Toshiya Kobayashi 2013-10-23 04:52:35 EDT
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.