Interface ActionTemplateService
- All Known Implementing Classes:
ActionTemplateServiceImpl
public interface ActionTemplateService
The action template service supports the handling of message generation in the scope of the Action engine. It is for configured within
ActionDefinitionModel
by using the template engine if to render the content.
For example it can be used to to generate a confirmation or title message from the ActionDefinitionModel.getConfirmationMessageCode()
and ActionDefinitionModel.getConfirmationTitleCode()
If you want to create your own confirmation message or title template:
- add message template as a JSON resource in `com/flowable/template/default/` with name `confirmationMessage-{yourMessageCode}_en.tplvariation`
- add message template as a JSON resource in `com/flowable/template/default/` with name `confirmationTitle-{yourMessageCode}_en.tplvariation`
- optionally add message template as a JSON resource in `com/flowable/template/default/` with name `confirmationMessage-{yourMessageCode}_{languageCode}.tplvariation` for any further languages you want to support
- optionally add message template as a JSON resource in `com/flowable/template/default/` with name `confirmationTitle-{yourMessageCode}_{languageCode}.tplvariation` for any further languages you want to support
scope
(e.g. '${scope.name}'
). The action model is exposed as well, so for
instance you can use '${action.name}'
to render the name of the selected action.- Author:
- Micha Kiener, Filip Hrisafov
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMessage
(String templateKey, String tenantId, String code, String language, ActionDefinitionModel actionDefinitionModel, Object scopedObject) Get the message for the giventemplateKey
.
-
Field Details
-
VARIANT_KEY_CODE
- See Also:
-
VARIANT_KEY_LANGUAGE
- See Also:
-
PAYLOAD_PARAM_NAME_SCOPED_OBJECT
- See Also:
-
PAYLOAD_PARAM_NAME_ACTION
- See Also:
-
-
Method Details
-
getMessage
String getMessage(String templateKey, String tenantId, String code, String language, ActionDefinitionModel actionDefinitionModel, Object scopedObject) Get the message for the giventemplateKey
. Thecode
andlanguage
are used as variants for the template engine and theactionDefinitionModel
andscopedObject
are used as the payload.- Parameters:
templateKey
- the key for the templatetenantId
- the tenant id that should be used when resolving the messagecode
- the optional code (defaults to "default" if not provided)language
- the optional language (defaults to "en" if not provided)actionDefinitionModel
- the action definition model that is passed as part of the payload for the template servicescopedObject
- the optional object under scoped if the message should be created with a scoped object (it is passed to the template service as part of the payload)- Returns:
- the generated message
-