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
Fields Modifier and Type Field Description static java.lang.String
PAYLOAD_PARAM_NAME_ACTION
static java.lang.String
PAYLOAD_PARAM_NAME_SCOPED_OBJECT
static java.lang.String
VARIANT_KEY_CODE
static java.lang.String
VARIANT_KEY_LANGUAGE
-
Method Summary
Modifier and Type Method Description java.lang.String
getMessage(java.lang.String templateKey, java.lang.String tenantId, java.lang.String code, java.lang.String language, ActionDefinitionModel actionDefinitionModel, java.lang.Object scopedObject)
Get the message for the giventemplateKey
.
-
Field Details
-
VARIANT_KEY_CODE
static final java.lang.String VARIANT_KEY_CODE- See Also:
- Constant Field Values
-
VARIANT_KEY_LANGUAGE
static final java.lang.String VARIANT_KEY_LANGUAGE- See Also:
- Constant Field Values
-
PAYLOAD_PARAM_NAME_SCOPED_OBJECT
static final java.lang.String PAYLOAD_PARAM_NAME_SCOPED_OBJECT- See Also:
- Constant Field Values
-
PAYLOAD_PARAM_NAME_ACTION
static final java.lang.String PAYLOAD_PARAM_NAME_ACTION- See Also:
- Constant Field Values
-
-
Method Details
-
getMessage
java.lang.String getMessage(java.lang.String templateKey, java.lang.String tenantId, java.lang.String code, java.lang.String language, ActionDefinitionModel actionDefinitionModel, java.lang.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
-