Class BpmNotificationRendererImpl

java.lang.Object
io.jmix.bpm.notification.impl.BpmNotificationRendererImpl
All Implemented Interfaces:
BpmNotificationRenderer

@Component("bpm_BpmNotificationRenderer") public class BpmNotificationRendererImpl extends Object implements BpmNotificationRenderer
Default BpmNotificationRenderer implementation. Evaluates the subject and body as inline Flowable expressions, exposing a transient context variable for the duration of rendering; falls back to the message templates add-on when a template code is set on the definition.
  • Field Details

    • CONTEXT_VARIABLE

      protected static final String CONTEXT_VARIABLE
      See Also:
    • messageTemplateRenderer

      @Autowired(required=false) protected @Nullable BpmMessageTemplateRenderer messageTemplateRenderer
    • repositoryService

      @Autowired protected org.flowable.engine.RepositoryService repositoryService
  • Constructor Details

    • BpmNotificationRendererImpl

      public BpmNotificationRendererImpl()
  • Method Details

    • render

      public RenderedNotification render(NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, org.springframework.security.core.userdetails.UserDetails recipient, @Nullable org.springframework.security.core.userdetails.UserDetails assignee)
      Description copied from interface: BpmNotificationRenderer
      Renders subject and body.
      Specified by:
      render in interface BpmNotificationRenderer
      Parameters:
      definition - notification definition
      scope - variable scope used for expression evaluation
      task - task in scope, or null for a service task
      recipient - the recipient this rendering is for (exposed as context.recipientUser)
      assignee - the task assignee, or null
      Returns:
      rendered subject and body
    • resolveContentType

      protected @Nullable String resolveContentType(NotificationDefinition definition)
      Resolves the effective content type: for a templated notification it comes from the template's own type (falling back to the definition's when the template can't be resolved); otherwise it is the content type set on the definition.
      Parameters:
      definition - the notification definition
      Returns:
      the effective content type, or null to let the service default it
    • renderBody

      protected @Nullable String renderBody(NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, BpmNotificationContext context)
    • buildParams

      protected Map<String,Object> buildParams(org.flowable.variable.api.delegate.VariableScope scope, BpmNotificationContext context)
    • renderExpression

      protected @Nullable String renderExpression(@Nullable String template, org.flowable.variable.api.delegate.VariableScope scope)
    • buildContext

      protected BpmNotificationContext buildContext(org.flowable.variable.api.delegate.VariableScope scope, @Nullable org.flowable.task.service.delegate.DelegateTask task, org.springframework.security.core.userdetails.UserDetails recipient, @Nullable org.springframework.security.core.userdetails.UserDetails assignee)
    • resolveProcessDefinitionName

      protected @Nullable String resolveProcessDefinitionName(@Nullable String processDefinitionId)
    • getExpressionManager

      protected org.flowable.common.engine.impl.el.ExpressionManager getExpressionManager()