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 Details

  • 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: BpmNotificationDispatcher
      Dispatches notifications declared on the given element.
      Specified by:
      dispatch in interface BpmNotificationDispatcher
      Parameters:
      flowElement - the BPMN element carrying <jmix:notification> declarations
      scope - variable scope (execution or task)
      task - task in scope, or null for a service task
      event - lifecycle event name to filter by (user task), or null to 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)