Class ProcessMessageUtil

java.lang.Object
com.flowable.engage.engine.impl.util.ProcessMessageUtil

public class ProcessMessageUtil extends Object
This utility helps creating template based messages used within processes. If you want to create your own process message:
  • add message template as a JSON resource in `com/flowable/template/default/` with name `process-{yourMessageCode}_en.tplvariation`
  • optionally add message template as a JSON resource in `com/flowable/template/default/` with name `process-{yourMessageCode}_{languageCode}.tplvariation` for any further languages you want to support
You can then use createMessage(String, Map) or createMessage(String, String, Map) to render a message based on your template.
Author:
Micha Kiener
  • Field Details

  • Method Details

    • createMessage

      public static String createMessage(String messageCode, Map<String,Object> payload)
      Creates a standard message based on the provided message code and payload. The payload must at least contain the necessary parameters as being defined within the TemplateVariationModel. This one uses english as the default language.
      Parameters:
      messageCode - the message code to choose the template variation for
      payload - the optional payload containing the necessary parameters (if any needed by the template)
      Returns:
      the rendered standard message
    • createMessage

      public static String createMessage(String messageCode, String language, Map<String,Object> payload)
      Creates a standard message based on the provided message code and payload. The payload must at least contain the necessary parameters as being defined within the TemplateVariationModel.
      Parameters:
      messageCode - the message code to choose the template variation for
      language - the language (e.g. "en") for which the message should be rendered
      payload - the optional payload containing the necessary parameters (if any needed by the template)
      Returns:
      the rendered standard message