Class DeskMessageUtil
java.lang.Object
com.flowable.engage.engine.impl.desk.DeskMessageUtil
public class DeskMessageUtil
extends java.lang.Object
This utility helps creating template based messages used within desk and ticket conversations.
You can then use
createMessage(String, Map)
or createMessage(String, String, String, Map)
to render a message based on your template.
You can use a message code in combination with a language and optional channel to even make messages channel specific (e.g. a message internally might be
rendered in a different way as for WhatsApp or WeChat, etc). Use DEFAULT_CHANNEL
as the default.- Author:
- Micha Kiener
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_CHANNEL
static java.lang.String
DEFAULT_LANGUAGE
static java.lang.String
DESK_AND_TICKET_MESSAGES_TEMPLATE_KEY
The template definition key used for standard messages.static java.lang.String
VARIANT_KEY_CHANNEL
static java.lang.String
VARIANT_KEY_LANGUAGE
static java.lang.String
VARIANT_KEY_MESSAGE_CODE
-
Method Summary
Modifier and Type Method Description static java.lang.String
createMessage(java.lang.String messageCode, java.lang.String language, java.lang.String channel, java.util.Map<java.lang.String,java.lang.Object> payload)
Creates a standard message based on the provided message code and payload.static java.lang.String
createMessage(java.lang.String messageCode, java.util.Map<java.lang.String,java.lang.Object> payload)
Creates a standard message based on the provided message code and payload.
-
Field Details
-
DESK_AND_TICKET_MESSAGES_TEMPLATE_KEY
public static final java.lang.String DESK_AND_TICKET_MESSAGES_TEMPLATE_KEYThe template definition key used for standard messages.- See Also:
- Constant Field Values
-
VARIANT_KEY_MESSAGE_CODE
public static final java.lang.String VARIANT_KEY_MESSAGE_CODE- See Also:
- Constant Field Values
-
VARIANT_KEY_LANGUAGE
public static final java.lang.String VARIANT_KEY_LANGUAGE- See Also:
- Constant Field Values
-
VARIANT_KEY_CHANNEL
public static final java.lang.String VARIANT_KEY_CHANNEL- See Also:
- Constant Field Values
-
DEFAULT_LANGUAGE
public static final java.lang.String DEFAULT_LANGUAGE- See Also:
- Constant Field Values
-
DEFAULT_CHANNEL
public static final java.lang.String DEFAULT_CHANNEL- See Also:
- Constant Field Values
-
-
Method Details
-
createMessage
public static java.lang.String createMessage(java.lang.String messageCode, java.util.Map<java.lang.String,java.lang.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 theTemplateVariationModel
. This one uses the default language and channel.- Parameters:
messageCode
- the message code to choose the template variation forpayload
- the optional payload containing the necessary parameters (if any needed by the template)- Returns:
- the rendered standard message
-
createMessage
public static java.lang.String createMessage(java.lang.String messageCode, java.lang.String language, java.lang.String channel, java.util.Map<java.lang.String,java.lang.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 theTemplateVariationModel
.- Parameters:
messageCode
- the message code to choose the template variation forlanguage
- the language (e.g. "en") for which the message should be renderedchannel
- the channel (e.g. "WhatsApp") for which the message should be renderedpayload
- the optional payload containing the necessary parameters (if any needed by the template)- Returns:
- the rendered standard message
-