[rules-users] Some Problem with drools-persistence-jpa Library

tangrui.cn at gmail.com tangrui.cn at gmail.com
Sun Nov 7 04:51:12 EST 2010


Hi list,

The attachment is a very simple test case to demonstrate an application
using Drools Persistence JPA (5.1.1).

Usage:

1. set up a mysql database called framework
2. set the user/password are root/root (or change the
bitronix-datasources.properties file)
3. run maven test

The core lines are as following:

StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase, conf, env);
ProcessInstance pi = ksession.startProcess("com.zyeeda.system.TestFlow");
pi.signalEvent("signal", "goon");

When executing the 3rd line, an exception occurred

java.lang.NullPointerException
    at
org.drools.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)
    at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:185)
    at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:346)
    at com.zyeeda.test.AppTest.testProcessPersistence(AppTest.java:84)

I've headed into the code and find that some working memory related to the
ProcessInstanceImpl is null.
(drools-core/src/main/java/org/drools/process/instance/impl/ProcessInstanceImpl.java)

But I cannot get why this does happen. Please give me some tips.

I tried to google some solutions, but find only this one (
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-Not-Working-td1453738.html),
but it seems that he solved this problem by using a custom command.

Thank you!

-- 
唐睿
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101107/92d5de93/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-drools-persistence-0.0.1-SNAPSHOT.zip
Type: application/zip
Size: 10375 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20101107/92d5de93/attachment.zip 


More information about the rules-users mailing list