1 Reply Latest reply on Mar 29, 2009 5:24 PM by Brad Davis

    jPDL: global event handlers

    Thomas Kriechbaum Newbie

      Is it possible to register event handlers that are included to all deployed process definitions? I would like to notify some external system about some specific jBPM events for all processes.

      What's the recommend solution for avoiding the definition of the event handlers within each process definition? One solution might be to extend the process definitions before they get deployed to jBPM (e.g. some kind of XSL-transformation). Or can I register the global event handlers within the jBPM configuration?

      Thanks,
      Thomas

        • 1. Re: jPDL: global event handlers
          Brad Davis Novice

          I am not sure of an official global event handler. I dont believe there is a way to do that, but here is one possible solution otherwise.

          One option would be to write a log handler that executes on the different logs to send events. Most of the event types are logged, so you could get at the same data.

           <!-- A : org.jbpm.graph.log.ActionLog -->
           <!-- B : org.jbpm.context.log.ByteArrayUpdateLog -->
           <!-- C : org.jbpm.logging.log.CompositeLog -->
           <!-- D : org.jbpm.context.log.VariableDeleteLog -->
           <!-- E : org.jbpm.context.log.DateUpdateLog -->
           <!-- F : org.jbpm.context.log.HibernateStringUpdateLog -->
           <!-- G : org.jbpm.context.log.LongUpdateLog -->
           <!-- H : org.jbpm.context.log.HibernateLongUpdateLog -->
           <!-- I : org.jbpm.graph.log.ProcessInstanceCreateLog -->
           <!-- L : org.jbpm.context.log.DoubleUpdateLog -->
           <!-- M : org.jbpm.logging.log.MessageLog -->
           <!-- N : org.jbpm.graph.log.NodeLog -->
           <!-- O : org.jbpm.graph.log.TokenCreateLog -->
           <!-- P : org.jbpm.logging.log.ProcessLog -->
           <!-- R : org.jbpm.context.log.VariableCreateLog -->
           <!-- S : org.jbpm.graph.log.SignalLog -->
           <!-- T : org.jbpm.graph.log.TransitionLog -->
           <!-- U : org.jbpm.context.log.StringUpdateLog -->
           <!-- V : org.jbpm.context.log.VariableLog -->
           <!-- W : org.jbpm.context.log.VariableUpdateLog -->
           <!-- X : org.jbpm.graph.log.ProcessInstanceEndLog -->
           <!-- Y : org.jbpm.graph.log.TokenEndLog -->
           <!-- Z : org.jbpm.graph.log.ProcessStateLog -->
           <!-- 0 : org.jbpm.taskmgmt.log.TaskLog -->
           <!-- 1 : org.jbpm.taskmgmt.log.TaskCreateLog -->
           <!-- 2 : org.jbpm.taskmgmt.log.TaskAssignLog -->
           <!-- 3 : org.jbpm.taskmgmt.log.TaskEndLog -->
           <!-- 4 : org.jbpm.taskmgmt.log.SwimlaneLog -->
           <!-- 5 : org.jbpm.taskmgmt.log.SwimlaneCreateLog -->
           <!-- 6 : org.jbpm.taskmgmt.log.SwimlaneAssignLog -->
          


          In the jbpm configuration, then just configure in your logger.

          
           <service name="logging">
           <factory>
           <bean class="you.logger.Class"></bean>
           </factory>
           </service>