[jbpm-dev] How to check if eventListener is called - audit log

Maciej Swiderski mswiders at redhat.com
Tue May 20 14:10:26 EDT 2014


Charles,

just pushed the fix and test case for that issue. Now it should work smoothly to register listeners via spring xml.

Maciej
On 20 maj 2014, at 16:16, Charles Moulliard <ch007m at gmail.com> wrote:

> Hi,
> 
> I have enable AuditLogger using AuditLoggerFactory method (newJPAInstance(Environment env) for a project running on karaf. 
> 
>     <kie:kmodule id="kModule">
> 
>         <kie:kbase name="kPersistence">
> 
>             <kie:ksession name="kSession">
> 
>                 <kie:processEventListener ref="log-listener"/>
> 
>                 <kie:processEventListener ref="mock-process-listener"/>
> 
>                 <kie:configuration>
> 
>                     <kie:jpa-persistence>
> 
>                         <kie:transaction-manager ref="txManager"/>
> 
>                         <kie:entity-manager-factory ref="myEmf"/>
> 
>                     </kie:jpa-persistence>
> 
>                 </kie:configuration>
> 
>             </kie:ksession>
> 
>         </kie:kbase>
> 
>     </kie:kmodule>
> 
> 
> 
>     <kie:environment id="env">
> 
>         <kie:entity-manager-factory ref="myEmf"/>
> 
>         <kie:transaction-manager ref="txManager"/>
> 
>     </kie:environment>
> 
>     <bean id="mock-process-listener" class="org.jbpm.osgi.example.MockProcessEventListener"/>
> 
>     <bean id="log-listener" class="org.jbpm.process.audit.AuditLoggerFactory"          factory-method="newJPAInstance">
> 
>         <constructor-arg ref="env"/>
> 
>     </bean>
> 
> 
> 
> The method of AuditLoggerFactory is well called (debug mode) 
> 
> public static AbstractAuditLogger newJPAInstance(Environment env) {
> 
>         return new JPAWorkingMemoryDbLogger(env);
> 
>     }
> 
> 
> 
> but the DB (H2) and this table sessionInfo contains a record when the process is started and finished. 
> 
> 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
> 
> public static AbstractAuditLogger newJPAInstance(Environment env) {
> 
>         return new JPAWorkingMemoryDbLogger(env);
> 
>     }
> 
> 
> 
> public class MockProcessEventListener implements ProcessEventListener {
> 
>     public void beforeProcessStarted(ProcessStartedEvent processStartedEvent) {
> 
>         System.out.println("MockProcessEventListener :: beforeProcessStarted");
> 
>     }
> 
> 
> 
> Where can I investigate to verify that listener is working ?
> 
> Regards,
> 
> -- 
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
> 
> _______________________________________________
> jbpm-dev mailing list
> jbpm-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbpm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbpm-dev/attachments/20140520/7ae7a62b/attachment-0001.html 


More information about the jbpm-dev mailing list