Thanks mate
It throws NullPointerException. Here is what I do. I start process and it
stops at an AND node waiting for event to complete. The process is backed
up by JPA and is stored in db. Then I modify my test class and instead of
creating session i load existing session. For example when i run my last
test first time, it created a new session in db with id 18 and new process
in db with id 24. So I use this code:
StatefulKnowledgeSession session =
JPAKnowledgeService.loadStatefulKnowledgeSession(18,knowledgeBase, null,
environment);
WorkItemManager manager = session.getWorkItemManager();
manager.registerWorkItemHandler("Human Task", new
MyWorkItemHandler(true));
ProcessInstance p = session.getProcessInstance(24);
System.out.println("Proc Found -> " + p.getClass());
if (p != null && p.getState()==ProcessInstance.STATE_ACTIVE)
{
p.signalEvent("TestEvent", null);
}
The debug statement above displays "Proc Found -> class
org.drools.ruleflow.instance.RuleFlowProcessInstance"
And I get exception:
15:41:29,528 ERROR [STDERR] java.lang.NullPointerException
15:41:29,528 ERROR [STDERR] at
org.drools.process.instance.impl.ProcessInstanceImpl.getProcess(ProcessInstanceImpl.java:67)
15:41:29,529 ERROR [STDERR] at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.getWorkflowProcess(WorkflowProcessInstanceImpl.java:185)
15:41:29,529 ERROR [STDERR] at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:346)
15:41:29,529 ERROR [STDERR] at
com.my.poc.PocFlowServiceImpl.processFlow(PocFlowServiceImpl.java:117)
15:41:29,529 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:41:29,529 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
15:41:29,529 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:41:29,529 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:597)
15:41:29,529 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
15:41:29,529 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
15:41:29,529 ERROR [STDERR] at
org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
15:41:29,529 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
15:41:29,529 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
15:41:29,531 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:41:29,531 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
15:41:29,531 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:41:29,531 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:597)
15:41:29,531 ERROR [STDERR] at
org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
15:41:29,531 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,531 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
15:41:29,532 ERROR [STDERR] at
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_30161834.invoke(InvocationContextInterceptor_z_fillMethod_30161834.java)
15:41:29,532 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,532 ERROR [STDERR] at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
15:41:29,532 ERROR [STDERR] at
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_30161834.invoke(InvocationContextInterceptor_z_setup_30161834.java)
15:41:29,532 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,532 ERROR [STDERR] at
org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
15:41:29,575 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,575 ERROR [STDERR] at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
15:41:29,575 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,576 ERROR [STDERR] at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
15:41:29,576 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,576 ERROR [STDERR] at
org.jboss.ejb3.tx.StatelessBMTInterceptor.handleInvocation(StatelessBMTInterceptor.java:106)
15:41:29,576 ERROR [STDERR] at
org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:55)
15:41:29,576 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,576 ERROR [STDERR] at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
15:41:29,576 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,576 ERROR [STDERR] at
org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
15:41:29,576 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,576 ERROR [STDERR] at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
15:41:29,576 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,576 ERROR [STDERR] at
org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
15:41:29,577 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,577 ERROR [STDERR] at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
15:41:29,577 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,577 ERROR [STDERR] at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
15:41:29,577 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,577 ERROR [STDERR] at
org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
15:41:29,577 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,577 ERROR [STDERR] at
org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
15:41:29,577 ERROR [STDERR] at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
15:41:29,577 ERROR [STDERR] at
org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)
15:41:29,577 ERROR [STDERR] at
org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
15:41:29,577 ERROR [STDERR] at
org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
15:41:29,579 ERROR [STDERR] at
org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
15:41:29,579 ERROR [STDERR] at
org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)
15:41:29,579 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)
15:41:29,579 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)
15:41:29,579 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)
15:41:29,579 ERROR [STDERR] at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-No...
Sent from the Drools - User mailing list archive at
Nabble.com.