Package io.jmix.bpm.notification.impl
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected @Nullable BpmMessageTemplateRendererprotected org.flowable.engine.RepositoryService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BpmNotificationContextbuildContext(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) buildParams(org.flowable.variable.api.delegate.VariableScope scope, BpmNotificationContext context) protected org.flowable.common.engine.impl.el.ExpressionManagerrender(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) Renders subject and body.protected @Nullable StringrenderBody(NotificationDefinition definition, org.flowable.variable.api.delegate.VariableScope scope, BpmNotificationContext context) protected @Nullable StringrenderExpression(@Nullable String template, org.flowable.variable.api.delegate.VariableScope scope) protected @Nullable StringresolveContentType(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.protected @Nullable StringresolveProcessDefinitionName(@Nullable String processDefinitionId)
-
Field Details
-
CONTEXT_VARIABLE
- See Also:
-
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:BpmNotificationRendererRenders subject and body.- Specified by:
renderin interfaceBpmNotificationRenderer- Parameters:
definition- notification definitionscope- variable scope used for expression evaluationtask- task in scope, ornullfor a service taskrecipient- the recipient this rendering is for (exposed ascontext.recipientUser)assignee- the task assignee, ornull- Returns:
- rendered subject and body
-
resolveContentType
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
nullto 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
-
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
-
getExpressionManager
protected org.flowable.common.engine.impl.el.ExpressionManager getExpressionManager()
-