[jboss-user] [jBPM] - JBPM4.3 Variable History

Khaled Talaat do-not-reply at jboss.com
Tue Apr 6 09:37:21 EDT 2010


Khaled Talaat [http://community.jboss.org/people/egycator] replied to the discussion

"JBPM4.3 Variable History"

To view the discussion, visit: http://community.jboss.org/message/535798#535798

--------------------------------------------------------------
Hi Huisheng
When I used your proposed solution  as following :
ProcessInstance processInstance = executionService.startProcessInstanceByKey("Normal");
 
EnvironmentImpl environment =  ((EnvironmentFactory)processEngine).openEnvironment();
((ExecutionImpl)processInstance).createVariable("test", "valuetest","string",true);
Session session = environment.get(Session.class);
Transaction tx  = session.beginTransaction();
session.update(processInstance);
tx.commit();
environment.close();


it throws a NullPointerException 
15:27:28,703 SEV | [BaseJbpmTestCase] TEST THROWS EXCEPTION: null
java.lang.NullPointerException
     at org.jbpm.pvm.internal.history.events.VariableUpdate.process(VariableUpdate.java:48)
     at org.jbpm.pvm.internal.history.HistorySessionImpl.process(HistorySessionImpl.java:31)
     at org.jbpm.pvm.internal.history.HistoryEvent.fire(HistoryEvent.java:62)
     at org.jbpm.pvm.internal.history.HistoryEvent.fire(HistoryEvent.java:52)
     at org.jbpm.pvm.internal.type.Variable.setValue(Variable.java:97)
     at org.jbpm.pvm.internal.model.ScopeInstanceImpl.createVariableObject(ScopeInstanceImpl.java:140)
     at org.jbpm.pvm.internal.model.ScopeInstanceImpl.createVariable(ScopeInstanceImpl.java:90)
     at com.asset.jupiter.jbpm.processes.Normal.NormalTest.testCreateProcessInstance(NormalTest.java:33)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at junit.framework.TestCase.runTest(TestCase.java:164)
     at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:80)
     at junit.framework.TestCase.runBare(TestCase.java:130)
     at junit.framework.TestResult$1.protect(TestResult.java:106)
     at junit.framework.TestResult.runProtected(TestResult.java:124)
     at junit.framework.TestResult.run(TestResult.java:109)
     at junit.framework.TestCase.run(TestCase.java:120)
     at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
     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)
 

but when I use it with "isHistoryEnabled" , the variable is persisted.

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

Reply to this message by going to Community
[http://community.jboss.org/message/535798#535798]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100406/e44ca4bd/attachment.html 


More information about the jboss-user mailing list