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

Charles Moulliard ch007m at gmail.com
Tue May 20 10:16:54 EDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jbpm-dev/attachments/20140520/fcb17717/attachment.html 


More information about the jbpm-dev mailing list