2 Replies Latest reply on Jun 26, 2006 6:06 AM by Tom Baeyens

    Observer / Listener pattern on jBPM process execution?

    Scott McNab Newbie


      I am trying to implement a mechanism for real-time observing and monitoring the execution of jBPM processes. In particular, I need global notification of:

      * Every time a new process (or sub process) is created
      * Every time a process instance transitions to a new state
      * Every time a process ends (including end time)

      I notice there is support for adding RuntimeAction handlers dynamically in this post:


      However, it seems this mechanism would require me to hook every node and event type of every process instance explicitly.

      Furthermore, it appears that it is not possible to get notification of processes ending using the event handler mechanism - I can add a 'node-enter' handler to the end-state, however when this is called the process is still running, and hence the process instance end time field is still null!

      Is there a mechanism that I might have missed that can support what I am trying to do? Alternatively, does it make sense to support a node-leave handler on the end-state, that is only called once the process instance has been marked with an end time?

      It seems to me that the Logging system might be ideally positioned to implement such an observer mechanism. Is there an easy way of hooking a callback handler to receive log events on the fly?