Alejandro Guizar [
http://community.jboss.org/people/alex.guizar%40jboss.com] created the
discussion
"Re: Creating an audit trail"
To view the discussion, visit:
http://community.jboss.org/message/565312#565312
--------------------------------------------------------------
I'm trying to construct an audit mechanism for my JBPM
processes. When I first saw the event section in the user guide, I thought it would be
perfect, but, after looking at the example, it seems that events are almost completely
worthless. The reason for this is that you a) have to explicitly scatter events in your
processes (a real nightmare if you have a lot of them) and b) have to explicitly tell it
which class is a listener. I thought the whole point of events was that you didn't
need to know what or how many listeners were listening. You could just generate an event
and every listener who had registered would know about it. Am I missing something here?
In the
http://www.research.ibm.com/designpatterns/example.htm observer pattern, it
is the event source or observable subject the one who is unaware of the observers.
However, observers still have to register themselves, otherwise the source cannot possibly
know about them! In this case jBPM will notify as many listeners as you want to put in
place, but you still have to declare them.
In any case, here's what I would like to do. I would like have
an audit class which is notified on every step of a process. The audit class may choose
to record these steps and some of the variables which would allow reconstruction of the
"flow" of a specific execution of a process. I welcome any ideas about how to
best implement this since it doesn't seem to be provided by default.
If notified
+on every step+ means each time an activity +ends+ then you can leverage
http://docs.jboss.com/jbpm/v4/userguide/html_single/#d0e4640 event propagation and, with a
single event tag, receive a notification each time an activity ends.
<process name='Insurance claim' key='ICL'>
<on event='end'>
<event-listener propagation='enabled'
class='org.example.EventListener' />
</on>
<start>
<transition to='a' />
</start>
<state name='a'>
<transition to='b' />
</state>
<end name='b' />
</process>
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/565312#565312]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]