<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Charles,<div><br></div><div>just pushed the fix and test case for that issue. Now it should work smoothly to register listeners via spring xml.</div><div><br></div><div>Maciej<br><div><div>On 20 maj 2014, at 16:16, Charles Moulliard &lt;<a href="mailto:ch007m@gmail.com">ch007m@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi,<div><br></div><div><p class="">I have enable AuditLogger using AuditLoggerFactory method (newJPAInstance(Environment env) for a project running on karaf.&nbsp;</p><p class="">&nbsp; &nbsp; &lt;kie:kmodule id="kModule"&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:kbase name="kPersistence"&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:ksession name="kSession"&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:processEventListener ref="log-listener"/&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:processEventListener ref="mock-process-listener"/&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:configuration&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:jpa-persistence&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:transaction-manager ref="txManager"/&gt;</p><p class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:entity-manager-factory ref="myEmf"/&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/kie:jpa-persistence&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/kie:configuration&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/kie:ksession&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/kie:kbase&gt;</p><p class="">&nbsp; &nbsp; &lt;/kie:kmodule&gt;</p><p class=""><br></p><p class="">&nbsp; &nbsp; &lt;kie:environment id="env"&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:entity-manager-factory ref="myEmf"/&gt;</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; &lt;kie:transaction-manager ref="txManager"/&gt;</p><p class="">&nbsp; &nbsp; &lt;/kie:environment&gt;</p><p class="">&nbsp; &nbsp; &lt;bean id="mock-process-listener" class="org.jbpm.osgi.example.MockProcessEventListener"/&gt;</p><p class="">&nbsp; &nbsp; &lt;bean id="log-listener" class="org.jbpm.process.audit.AuditLoggerFactory" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;factory-method="newJPAInstance"&gt;<br></p><p class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;constructor-arg ref="env"/&gt;</p><p class="">&nbsp; &nbsp; &lt;/bean&gt;</p><p class=""><br></p><p class="">The method of AuditLoggerFactory is well called (debug mode)&nbsp;</p><p class="">public static AbstractAuditLogger newJPAInstance(Environment env) {</p><p class="">
&nbsp; &nbsp; &nbsp; &nbsp; return new JPAWorkingMemoryDbLogger(env);</p><p class="">&nbsp; &nbsp; }</p><p class=""><br></p><p class="">but the DB (H2) and this table sessionInfo contains a record when the process is started and finished.&nbsp;</p><p class="">
No nodes info recorded and the method beforeNodeTriggered and afterNodeLeft are not called in the class JPAWorkingMemoryDbLogger (debugging) like also in a Mock class implementing the listener</p><p class="">public static AbstractAuditLogger newJPAInstance(Environment env) {</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; return new JPAWorkingMemoryDbLogger(env);</p><p class="">&nbsp; &nbsp; }</p><p class=""><br></p><p class="">public class MockProcessEventListener implements ProcessEventListener {</p><p class="">&nbsp; &nbsp; public void beforeProcessStarted(ProcessStartedEvent processStartedEvent) {</p><p class="">&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("MockProcessEventListener :: beforeProcessStarted");</p><p class="">&nbsp; &nbsp; }</p><p class=""><br></p><p class="">Where can I investigate to verify that listener is working ?</p><p class="">Regards,</p><div>-- <br><div dir="ltr"><div>Charles Moulliard</div><div>Apache Committer / Architect @RedHat</div><div>Twitter : @cmoulliard |&nbsp;Blog :&nbsp;<a href="http://cmoulliard.github.io/" target="_blank"> http://cmoulliard.github.io</a></div>
<div><br></div></div>
</div></div></div>
_______________________________________________<br>jbpm-dev mailing list<br><a href="mailto:jbpm-dev@lists.jboss.org">jbpm-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/jbpm-dev</blockquote></div><br></div></body></html>