How do I fire an action every time a JBPM Node enters?

JBoss recipe of the day

Simply put the event at the same level as process definition !

<process-definition
  xmlns=”urn:jbpm.org:jpdl-3.2″
  name=”Gap”>
 
   <event type=”node-enter”>
           <action   class=”com.sample.action.TransitionHandler” />
   </event>

  ……
</process-definition>

This way the action class TransitionHandler will be recalled each time a Node enters in your Process.