Segregation of Facebook DM and Social media at the time of channel session creation
Objective
The objective of this task is to implement a mechanism to segregate Facebook Direct Messages (DM) from other Social Media (SM) interactions during channel session creation. This differentiation will aid in customizing handling processes across different components based on the message type.
Description
In the current setup, we need to pass additional data within the Header
of the CimMessage
object. Specifically, the additionalAttributes
should be populated under channelData
in the MessageHeader
to indicate the type of message. This enhancement will enable us to identify whether a message is a Facebook DM or an SM message right from the point of session creation.
Data Requirements
Message Types:
DM: Indicates that the message is a Facebook Direct Message.
SM: Indicates that the message is a Social Media interaction other than DM.
Attribute Details:
KEY:
MESSAGE_TYPE
VALUE: Either
DM
(Direct Message) orSM
(Social Media)TYPE:
String100
- a data type that supports up to 100 characters.
Based on the MESSAGE_TYPE
attribute in additionalAttributes
, we will differentiate the message type on various components and apply the required processes accordingly.
Implementation Steps
Update MessageHeader:
Modify theMessageHeader
ofCimMessage
to include theadditionalAttributes
key, containing the specifiedKEY
,VALUE
, andTYPE
details.Populate Additional Attributes:
Ensure that theadditionalAttributes
field underchannelData
is correctly populated with either "DM" or "SM" based on the message source. This classification should occur before the session creation process.Component Configuration:
Adjust configurations across components to recognize and handle theadditionalAttributes
values. This may involve routing, filtering, or specific handling procedures for DMs versus SM messages.Testing and Validation:
Create test cases to verify that messages with "DM" and "SM" values are correctly identified and processed.
Validate that the segregation works across all relevant components, ensuring that each message type is handled as expected.
Expected Outcome
With the implementation of this segregation mechanism, components will be able to distinguish between Facebook DMs and other social media messages. This will streamline message processing workflows, allowing for more tailored responses and actions based on the message type.