Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2263

Multiple timers in node cause EventSource reset

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 3.2.9
    • jBPM 3.2.6.SP1
    • Runtime Engine
    • None
    • Medium

      When having multiple timers in a node, the 2nd timer and all after 'lose' the relationship between the timer->graphElement, thus,
      timers are being persisted without the relationship with the graphElement, that causes serious problems in job execution time,

      Here's a deep detail explaination (considering there are two timers in one task node)

      When entering a node, the 'EVENTTYPE_NODE_ENTER' event gets fired, which causes two 'create timer actions' to be created via CreateTimerAction, one per timer,

      In GraphElement->fireEvent() there's the following piece of code:
      ...
      fireAndPropagateEvent(eventType, executionContext);
      } finally

      { executionContext.setEventSource(null); }

      ...

      This part seems to clean up the eventSource, but that causes the 2nd timer and above to 'lose' the association to the graphElement(Node ID) the timer was created from,

      I assume its not taken into consideration that the create timer fires another 'inner' event that causes the eventSource to be reset:

      CreateTimerAction->createTimer(..) {
      graphElement.fireEvent(Event.EVENTTYPE_TIMER_CREATE, executionContext);
      }

      For now, we commented out the GraphElement->fireEvent->'executionContext.setEventSource(null);' line, but I don't really understand the impact of that,

      If that line is important, I think it's better to perform the cleanup only in case the fire event is not invoked in an 'inner' fire event call, or find another approach,

      Thanks.

            aguizar_jira Alejandro Guizar (Inactive)
            asafs Asaf Shakarchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: