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 boolean
alwaysSendSystemEvent
protected ConversationService
conversationService
static String
EVENT_KEY_EXTERNAL_MESSAGE_RECEIVED
protected EventRegistry
eventRegistry
protected ExternalSystemContentService
externalSystemContentService
protected InboundMessageEventPayloadExtractor
inboundMessageEventPayloadExtractor
protected MessageService
messageService
static String
SYSTEM_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)
String
findConversationForUserAccount(UserAccount userAccount)
Find the conversation id for the givenuserAccount
.protected Message
getReplyToMessage(String externalSystemId, String replyToExternalMessageId)
boolean
isAlwaysSendSystemEvent()
protected boolean
isDuplicateMessage(String externalId)
void
routeInboundMessage(InboundMessage inboundMessage, UserAccount userAccount)
Route the inbound message to a conversation for the giveuserAccount
void
setAlwaysSendSystemEvent(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:InboundMessageRoutingService
Route the inbound message to a conversation for the giveuserAccount
- Specified by:
routeInboundMessage
in 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:InboundMessageRoutingService
Find 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:
findConversationForUserAccount
in 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)
-
-