Listener does not work when attached to a process transition

Dear all,

when I attach a BpmSendNotificationExecutionListener (the forum wouldn’t let me write the proper listener class name in the title because it is too long) to a process transition like so:

image

the execution of the “rejected” path (where the BpmSendNotificationExecutionListener is attached to) runs into an NullPointerException which says this.bpmProperties is null in line 54 in BpmSendNotificationExecutionListener. This is on jmix 1.3.5.

This is 100% reproducible. It is also irrelevant whether the listener is at start or end.

I suspect that this is due to the BpmSendNotificationExecutionListener internally not being fetched properly from the Spring application context but rather being constructed manually somewhere upstream within the Flowable stuff. I haven’t been able to verify this suspicion though. What made me come to this suspicion is the fact that the class is a @Component - my intuition would have me had expected a prototype since the attributes of the class are unknown at compile time and there may very well be multiple instances with different parameters in play at the same time (?).

(I have tried to work around this by “manually” injecting the bpmProperties via modeler field but have not been able to figure out how to access the current Spring application context from a groovy expression.)

I have for now worked around this behavior by sending my notification in a downstream “no-op” service task instead of making use of the BpmSendNotificationExecutionListener.

Best regards,
Dominik

Hi,

The functionality related to integration of BPM and Notifications add-ons is experimental and will be most likely rewritten. I’ve created an issue to mark classes inside the package as deprecated: the issue.

Hi,
thank you.
Does that mean that the functionality as per Sending Notifications :: Jmix Documentation is also subject to change?