Package io.jmix.bpm.notification.impl
Class BpmNotificationDispatcherImpl
java.lang.Object
io.jmix.bpm.notification.impl.BpmNotificationDispatcherImpl
- All Implemented Interfaces:
BpmNotificationDispatcher
@Component("bpm_BpmNotificationDispatcher")
public class BpmNotificationDispatcherImpl
extends Object
implements BpmNotificationDispatcher
Default
BpmNotificationDispatcher implementation. For each declared notification matching
the requested event, resolves its recipients and sends a separately rendered copy to each of them.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BpmNotificationExtractorprotected @Nullable BpmNotificationServiceprotected BpmNotificationRecipientResolverprotected BpmNotificationRendererprotected UserRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch(org.flowable.bpmn.model.FlowElement flowElement, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, @Nullable String event) Dispatches notifications declared on the given element.protected voiddispatchNotificationSafely(BpmNotificationService notificationService, NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, @Nullable org.springframework.security.core.userdetails.UserDetails assignee) Dispatches a single notification definition, isolating failures so that one broken definition (e.g.protected @Nullable org.springframework.security.core.userdetails.UserDetailsresolveAssignee(@Nullable org.flowable.task.service.delegate.DelegateTask task) protected voidsendNotificationSafely(BpmNotificationService notificationService, NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, @Nullable org.springframework.security.core.userdetails.UserDetails assignee, org.springframework.security.core.userdetails.UserDetails recipient) Renders and sends a notification to a single recipient, isolating failures so that one bad recipient (e.g.
-
Field Details
-
extractor
-
recipientResolver
-
renderer
-
userRepository
-
notificationService
-
-
Constructor Details
-
BpmNotificationDispatcherImpl
public BpmNotificationDispatcherImpl()
-
-
Method Details
-
dispatch
public void dispatch(org.flowable.bpmn.model.FlowElement flowElement, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, @Nullable String event) Description copied from interface:BpmNotificationDispatcherDispatches notifications declared on the given element.- Specified by:
dispatchin interfaceBpmNotificationDispatcher- Parameters:
flowElement- the BPMN element carrying<jmix:notification>declarationsscope- variable scope (execution or task)task- task in scope, ornullfor a service taskevent- lifecycle event name to filter by (user task), ornullto include all declared notifications (service task)
-
dispatchNotificationSafely
protected void dispatchNotificationSafely(BpmNotificationService notificationService, NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, @Nullable org.springframework.security.core.userdetails.UserDetails assignee) Dispatches a single notification definition, isolating failures so that one broken definition (e.g. a recipient resolution or rendering error) never propagates into the Flowable command and aborts the process. -
sendNotificationSafely
protected void sendNotificationSafely(BpmNotificationService notificationService, NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, @Nullable org.springframework.security.core.userdetails.UserDetails assignee, org.springframework.security.core.userdetails.UserDetails recipient) Renders and sends a notification to a single recipient, isolating failures so that one bad recipient (e.g. a rendering error specific to that recipient's data) never suppresses delivery to the rest. -
resolveAssignee
protected @Nullable org.springframework.security.core.userdetails.UserDetails resolveAssignee(@Nullable org.flowable.task.service.delegate.DelegateTask task)
-