Class InboundMessageRoutingServiceImpl
- java.lang.Object
-
- com.flowable.engage.external.system.service.InboundMessageRoutingServiceImpl
-
- All Implemented Interfaces:
InboundMessageRoutingService
public class InboundMessageRoutingServiceImpl extends Object implements InboundMessageRoutingService
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanalwaysSendSystemEventprotected ConversationServiceconversationServicestatic StringEVENT_KEY_EXTERNAL_MESSAGE_RECEIVEDprotected EventRegistryeventRegistryprotected ExternalSystemContentServiceexternalSystemContentServiceprotected InboundMessageEventPayloadExtractorinboundMessageEventPayloadExtractorprotected MessageServicemessageServicestatic StringSYSTEM_TYPE
-
Constructor Summary
Constructors Constructor Description InboundMessageRoutingServiceImpl(MessageService messageService, ConversationService conversationService, ExternalSystemContentService externalSystemContentService, EventRegistry eventRegistry, InboundMessageEventPayloadExtractor inboundMessageEventPayloadExtractor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<EventPayloadInstance>extractEventPayload(InboundMessage inboundMessage, UserAccount userAccount, Message message)protected Map<String,String>extractHints(InboundMessage inboundMessage)StringfindConversationForUserAccount(UserAccount userAccount)Find the conversation id for the givenuserAccount.protected MessagegetReplyToMessage(String externalSystemId, String replyToExternalMessageId)booleanisAlwaysSendSystemEvent()protected booleanisDuplicateMessage(String externalId)voidrouteInboundMessage(InboundMessage inboundMessage, UserAccount userAccount)Route the inbound message to a conversation for the giveuserAccountvoidsetAlwaysSendSystemEvent(boolean alwaysSendSystemEvent)
-
-
-
Field Detail
-
EVENT_KEY_EXTERNAL_MESSAGE_RECEIVED
public static final String EVENT_KEY_EXTERNAL_MESSAGE_RECEIVED
- See Also:
- Constant Field Values
-
SYSTEM_TYPE
public static final String SYSTEM_TYPE
- See Also:
- Constant Field Values
-
messageService
protected final MessageService messageService
-
conversationService
protected final ConversationService conversationService
-
externalSystemContentService
protected final ExternalSystemContentService externalSystemContentService
-
eventRegistry
protected final EventRegistry eventRegistry
-
inboundMessageEventPayloadExtractor
protected final InboundMessageEventPayloadExtractor inboundMessageEventPayloadExtractor
-
alwaysSendSystemEvent
protected boolean alwaysSendSystemEvent
-
-
Constructor Detail
-
InboundMessageRoutingServiceImpl
public InboundMessageRoutingServiceImpl(MessageService messageService, ConversationService conversationService, ExternalSystemContentService externalSystemContentService, EventRegistry eventRegistry, InboundMessageEventPayloadExtractor inboundMessageEventPayloadExtractor)
-
-
Method Detail
-
routeInboundMessage
public void routeInboundMessage(InboundMessage inboundMessage, UserAccount userAccount)
Description copied from interface:InboundMessageRoutingServiceRoute the inbound message to a conversation for the giveuserAccount- Specified by:
routeInboundMessagein interfaceInboundMessageRoutingService- Parameters:
inboundMessage- the received message from the external systemuserAccount- the user account that the message belongs to
-
extractEventPayload
protected Collection<EventPayloadInstance> extractEventPayload(InboundMessage inboundMessage, UserAccount userAccount, Message message)
-
extractHints
protected Map<String,String> extractHints(InboundMessage inboundMessage)
-
findConversationForUserAccount
public String findConversationForUserAccount(UserAccount userAccount)
Description copied from interface:InboundMessageRoutingServiceFind the conversation id for the givenuserAccount. The conversation id is the if of the conversation that can be used to route messages into.- Specified by:
findConversationForUserAccountin interfaceInboundMessageRoutingService- Parameters:
userAccount- the user account- Returns:
- the id of the conversation, never
null
-
isDuplicateMessage
protected boolean isDuplicateMessage(String externalId)
-
getReplyToMessage
protected Message getReplyToMessage(String externalSystemId, String replyToExternalMessageId)
-
isAlwaysSendSystemEvent
public boolean isAlwaysSendSystemEvent()
-
setAlwaysSendSystemEvent
public void setAlwaysSendSystemEvent(boolean alwaysSendSystemEvent)
-
-