1 Reply Latest reply on Mar 25, 2014 1:06 PM by Eduard Rameder

    Event node exit would remove Event defintion from Knowledge Base

    Eduard Rameder Newbie



      We are a little surprise about the following behavior:

      We have a KnowledgeBase Instance implemented as Singleton. Every new Process would use the same reference to the Knowledgebase and run in its own StatefulKnowledgeSession.

      When one of the processes is run and exits a task (in our case a HumanTask) with attached EventNode (catching node), it would change the Knowledgebase so the Event would never be catched again. Not from this process (after returning to the Task with attached EventNode) nor any other Process. Not as long as we do not reinitialize the Knowledgebase.

      This seams be because of a DroolsConsequenceAction added and implemented in the org.jbpm.bpmn2.xml.ProcessHandler which clears the EventFilters:


                              DroolsConsequenceAction actionAttachedTo =  new DroolsConsequenceAction("java", "" + "org.drools.definition.process.Node node = context.getNodeInstance().getNode().getNodeContainer().getNode(" +id+ ");" + "if (node instanceof org.jbpm.workflow.core.node.EventNode) {" + " ((org.jbpm.workflow.core.node.EventNode)node).getEventFilters().clear();" + "((org.jbpm.workflow.core.node.EventNode)node).addEventFilter(new org.jbpm.process.core.event.EventFilter () " + "{public boolean acceptsEvent(String type, Object event) { return false;}});" + "}"); 


      How comes this is necessary?

      Any ideas how to avoid this?


      UPDATE: seams to be addressed with: [JBPM-4015] Signal Boundary Event does not work at second time - JBoss Issue Tracker

      I removed the ConsequenceAction in version 5.4 and it seams to work now but I did not change any of the other classes mentioned in 4015.


      Any ideas of other impacts?

      Is there a patch for 5.4 ("It will be fixed on 6.x code base but should be rather easy to patch 5.4 code base to.")