Open harjsing opened 4 years ago
@jangalinski Thoughts?
Time is the issue .. :-)
I get the problem ... so we should have a default constructor that internally creates a new instance of the bus and delegates to the current constructor. Easy.
But then you have to make sure, that your consumers use the same bus. So you must not create a new CamundaEventBus in your app but instead get the instance from the process engine configuration. That would work.
Would you like to provide a PR?
Thanks @jangalinski
I got an instance of the CamundaEventBus like so:
CamundaEventBus eventBus = CamundaReactor.eventBus(processEngineShim.getProcessEngine()); //ProcessEngine (default)
TaskListener listener = new CustomTaskListener(eventBus);
and a simple TaksListener as follows
@CamundaSelector(type = "userTask", event = TaskListener.EVENTNAME_CREATE)
public class CustomTaskListener implements TaskListener {
public CustomTaskListener(CamundaEventBus bus) {
bus.register(this);
}
public void notify(DelegateTask delegateTask) {
}
}
I can successfully see the notify
being called :-)
I'll submit a PR soon!
Hi, I am unable to register the ReactorProcessEnginePlugin due to a missing default constructor.
It was added at some point in this commit and later removed (probably because of migration to using source eventbus)? #45
Error:
Using version: 2.1.2
Thanks!