pinaki
pinaki

Reputation: 331

Jbpm Script task running before afterProcessStarted of DefaultProcessEventListner

I have a jbpm process, where I have a startNode -> scriptTask -> timer -> scriptTask -> endNode Within the script tasks I have a simple java method call.

Before starting the jbpm process, registered an event listner

EventListner listner = new EventListner();
ksession.addEventListener(listner);

ksession.startProcess(processName);

There is a custom EventListner class

@Override
public class EventListner extends DefaultProcessEventListener {
    public void afterProcessStarted(ProcessStartedEvent startEvent) {
    //Some code here
    }
}

While running the jbpm process,what I see, the afterProcessStarted API is called after the Java method call within the first script task

Unable to figure it out.Need Help.Thanks in advance

Upvotes: 0

Views: 445

Answers (1)

Kris Verlaenen
Kris Verlaenen

Reputation: 2918

This is as expected, the after process started event is only triggered when everything that was the result of starting the process was completed. It behaves as a stack. See http://docs.jboss.org/jbpm/v6.2/userguide/ch05.html#d0e1828

Upvotes: 1

Related Questions