Using a call activity with activiti: in extension for variable passing results in null pointer when history level set to "full"

Description

I am using a call activity to run a subprocess.
with xml similar to that shown below

<callActivity id="callActivity1" name="Subprocess Call" calledElement="mySubProcess">
<extensionElements>
<activiti:in source="variableIn" target="variableIn" />
<activiti:out source="variableOut" target="variableOut" />
</extensionElements>
</callActivity>

I have a unit test around this which checks the variable value as its passed out of the sub-process.
In order to allow queries on the variables I have had to set the history level on the engine to "full"

This results in a NullPointerException from HistoryParseListener.fullHistoryEnabled()

This seems to be becuse a call to getActivity() in ExecutionEntity.initializeActivityInstanceId() for the subprocess is returning null (which in turn is due to the fact that activityId on the subprocess is null at this point in ensureActivityInitialized()

When I change the hitory level to "audit" from "full" I no longer get the null pointer, but am unable to detail the variable change history.

--------------------------------------------------------------------------------------------------------

Full stack trace:
SEVERE: Error while closing command context
java.lang.NullPointerException
at org.activiti.engine.impl.history.handler.HistoryParseListener.determineHistoryLevel(HistoryParseListener.java:147)
at org.activiti.engine.impl.history.handler.HistoryParseListener.fullHistoryEnabled(HistoryParseListener.java:135)
at org.activiti.engine.impl.runtime.ExecutionEntity.initializeActivityInstanceId(ExecutionEntity.java:837)
at org.activiti.engine.impl.runtime.VariableScopeImpl.setVariableInstanceValue(VariableScopeImpl.java:193)
at org.activiti.engine.impl.runtime.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:219)
at org.activiti.engine.impl.runtime.VariableScopeImpl.setVariable(VariableScopeImpl.java:165)
at org.activiti.engine.impl.bpmn.CallActivityBehaviour.execute(CallActivityBehaviour.java:63)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.runtime.ExecutionEntity.take(ExecutionEntity.java:342)
at org.activiti.engine.impl.bpmn.ExclusiveGatewayActivityBehavior.leave(ExclusiveGatewayActivityBehavior.java:73)
at org.activiti.engine.impl.bpmn.AbstractBpmnActivity.execute(AbstractBpmnActivity.java:36)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.runtime.ExecutionEntity.take(ExecutionEntity.java:342)
at org.activiti.engine.impl.bpmn.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:91)
at org.activiti.engine.impl.bpmn.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:48)
at org.activiti.engine.impl.bpmn.AbstractBpmnActivity.leave(AbstractBpmnActivity.java:44)
at org.activiti.engine.impl.bpmn.ServiceTaskExpressionActivityBehavior.execute(ServiceTaskExpressionActivityBehavior.java:45)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.runtime.ExecutionEntity.take(ExecutionEntity.java:342)
at org.activiti.engine.impl.bpmn.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:91)
at org.activiti.engine.impl.bpmn.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:48)
at org.activiti.engine.impl.bpmn.AbstractBpmnActivity.leave(AbstractBpmnActivity.java:44)
at org.activiti.engine.impl.bpmn.AbstractBpmnActivity.execute(AbstractBpmnActivity.java:36)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:44)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:44)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:62)
at org.activiti.engine.impl.runtime.ExecutionEntity.performOperation(ExecutionEntity.java:483)
at org.activiti.engine.impl.runtime.ExecutionEntity.start(ExecutionEntity.java:291)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:66)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:49)
at com.jpmorgan.rubi.workflow.bpm.process.PrimaryTradeProcessTest.testHappyPath(PrimaryTradeProcessTest.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Environment

None

Assignee

Unassigned

Reporter

Andrew Welsh

Labels

None

Components

Fix versions

Priority

Major
Configure