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
If the action definition is requested in the context of a scoped object (e.g. a conversation or a user, etc), this object is made available within the payload when using the template engine and can be accessed using 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 Details

  • Method Details

    • getMessage

      String getMessage(String templateKey, String tenantId, String code, String language, ActionDefinitionModel actionDefinitionModel, Object scopedObject)
      Get the message for the given templateKey. The code and language are used as variants for the template engine and the actionDefinitionModel and scopedObject are used as the payload.
      Parameters:
      templateKey - the key for the template
      tenantId - the tenant id that should be used when resolving the message
      code - 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 service
      scopedObject - 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