Introduction #
A detailed description of Message Control can be found in the Agent Library by choosing Cross-Application Components
-
Message Determination: the conditions under which a message is to be found are stored in condition tables. These tables are read in an access sequence.
-
The condition tables also contain the key fields for the application, that is to say, the fields which the Agent uses to access the condition records (for example the “purchasing organization” and “vendor” application fields in Purchasing).
-
The condition tables are assigned to an output type. The output types are combined in Procedures, which are assigned to the Agent.
-
This organizational structure allows message determination to run in a structured manner and under complex conditions. The output types and tables and the access sequences and procedures are already defined in Customizing for the relevant application.
[su_box title=”Note” box_color=”#2a8af0″ title_color=”#000000″]The output type is sometimes also referred to as the condition type.[/su_box]
-
Outbound messaging uses the notifications() call to send SOAP messages over HTTP(S) to a designated endpoint when triggered by a workflow rule.
- After you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. The message contains the fields specified when you created the outbound message. Once the endpoint URL receives the message, it can take the information from the message and process it. To do that, you need to examine the outbound messaging WSDL.
How to use it? #
It’s possible to create circular changes with outbound messaging. For example, if a user is performing integrations that trigger a workflow, and the workflow actions trigger account updates, those account updates trigger a new workflow, and so on. To prevent these circular changes, you can disable a user’s ability to send outbound messages.
- A change in a contact record triggers an outbound message from the specified user, with the sessionId to your outbound message listener.
- Your outbound message listener calls the Lightning Platform API and updates the same contact record which triggered the outbound message.
- The update triggers an outbound message.
- Your outbound message listener updates the record.
- The update triggers an outbound message.
- Your outbound message listener updates the record.
To enable outbound message notifications for a user, select Send Outbound Messages in the user’s profile.
The Outbound processing of Agent SOAP Adapter #
Example: In a Real business scenario, we want to make our data secure, so we need to use a local network zone to install Agent machine and Backend applications such as SAP or Oracle. We do like this because we don’t want any systems to access our System, and it is the technique to protect our data from being safe.
Handle API message without Response Interface.
– How to create a SOAP interface using the Agent SOAP Adapter?
So it is useful for users who want to keep data in the local System. To use Agent SOAP Adapter, we need to have an Agent application to store in the local machine meaning that Agent SOAP Adapter is like a bright to connection Salesforce to the Agent machine and the Agent machine connects to Backend applications
Message Monitor shows the result.
The Outbound processing of Agent REST Adapter #
Example: In a Real business scenario, we want to make our data secure, so we need to use a local network zone to install Agent machine and Backend applications such as SAP or Oracle. We do like this because we don’t want any systems to access our System, and it is the technique to protect our data from being safe.
Handle API message without Response Interface.
– How to create a REST interface using the Agent REST Adapter?
So it is useful for users who want to keep data in the local System. To use Agent REST Adapter, we need to have an Agent application to store in the local machine meaning that Agent REST Adapter is like a bright to connection Salesforce to the Agent machine and the Agent machine connects to Backend applications.
Message Monitor shows the result.
The Outbound (Producer) processing of Agent Pulsar Adapter #
Agent pulsar adapter for Producer means Outbound Pulsar Adapter. We need an Outbound Pulsar Adapter when we want to send data out from salesforce, here We need to create a topic first. From salesforce, we can send data messages to the API endpoint of our agent, and then we have a camel producer to publish into the topic invoice, which is on the Kafka side. This is the outbound process because we are sending data out here, It plays the role of Producer.
– How to use Agent Pulsar adapter for Producer?
Event-based Communication: #
- An event-driven architecture can help organizations achieve a flexible system that can adapt to changes and make decisions in real-time. Real-time situational awareness means that business decisions, whether manual or automated, can be made using all of the available data that reflects the current state of your systems.
- Events are captured as they occur from event sources such as Internet of Things (IoT) devices, applications, and networks, allowing event producers and event consumers to share status and response information in real-time.
- Organizations can add event-driven architecture to their systems and applications to improve the scalability and responsiveness of applications and access to the data and context needed for better business decisions.
- This is the modern way of communication between different applications. It has two components: Publish and subscribe. For example, Netflix, youtube.
- We can see the picture given below for reference. The SAP is a producer who pushing messages and Kafka or Pulsar works here as middleware, and maintain messages. All other applications like Twitter, HubSpot, salesforce is a consumer or subscriber here. So SAP just needed to publish it one time, they don’t need to send it to different applications individually.
Message Monitor shows the result.
The Outbound (Producer) processing of Agent Kafka Adapter #
We need Outbound Kafka Adapter when we want to send data out from salesforce, here We need to create a topic first. From salesforce, we can send data messages to our agent’s API endpoint, and then we have a camel producer to publish into the topic invoice, which is on the Kafka side. This is the outbound process because we are sending data out here, It plays the role of Producer.
– How to use the Agent Kafka Adapter for Producer?
Message Monitor shows the result.
How to use Agent File Adapter Producer #
We need an outbound Agent file adapter when we want to send data out from salesforce. To use the agent file for the Producer, we need to configure the Agent Control Board, and we need to create an Agent File adapter.
Event-driven mode #
The Agent file adapter will have a new mode e.g. event-driven mode to read files from the folder whenever new files arrive. The old File adapter support only the scheduling mode where we need to define the time and frequency when the file gets to pick up and process. With this new model, we add the real-time and event-driven feature to pick up immediately when they are there. We support this mode in addition to the existing scheduled mode. The consumer can be started only for the inbound interface.
– How to use Agent File Adapter for Producer?
We have 4 protocol of Agent File adapter in Agent:
- Local
- FTP
- FTPs
- SFTP
- CSV File:
Outbound Agent File Adapter for Excel format and Protocol: Local.
Excel file:
Outbound Agent File Adapter for CSV format and Protocol: FTP
CSV:
– How to use File Adapter (FileZilla Client & Server) with Agent Control Board for Producer?
Outbound Agent File Adapter for CSV format and Protocol: SFTP
CSV:
Agent File Adapter works for the Producer. Agent File adapter for producer uses for writing a file from salesforce to file. Agent file adapter for Producer means outbound Agent File Adapter. To use the Agent File adapter for Producer, we need to configure the Agent Control Board, and we need to create an Agent File Adapter. In this chapter, we will learn how to use the Agent File adapter for the producer, and we will know how to do outbound with CSV, Excel file type.
How to use Database Adapter Outbound #
- Conceptually of new Database Adapter on Agent v3 is the same as JDBC Adapter on the old Agent. It used as a connector to transfer data from Salesforce to Database and from Database to Salesforce. Any Connect or Agent V3 currently supports many types of Databases such as Oracle, SQL Server, MySQL, and PostgreSQL.
- Any Connect uses a protocol-specific adapter to connect to an external system and access its data. When you define an external data source in your organization, you specify the adapter in the Type field.
Built-in Caching #
Any Connect can implement a client-side data cache for improved performance. For maximum flexibility, the driver caches data on a per-table basis, as opposed to results from specific queries. Caching data on a table-level allows the caches to be queried, filtered, and sorted in other queries. Once a cache is created, its use is transparent to the application.
Performance Tuning #
Any Connect Progress DataDirect management of packet-based network communication provides unsurpassed packet transport, network round trips, and data buffering optimization. (socket management). Includes performance methodology for throughput and resource utilization (CPU/memory)
– How to do insert operation using Synchronous and Asynchronous outbound interface?
We use the same Interface as we have practiced for the Synchronous scenario, just change the processing mode to Asynchronous on Interface then Callout v3.
- Request Interface
Insert operation and Transactional mode #
Normally, when we creating a new Interface the field “isTransactional” is unchecked it means that Non-Transactional Mode. If that field is checked then it is Transactional mode.
– How to do update operation using Synchronous and Asynchronous outbound interface?
This will guide you on how to send data in multiple objects from Salesforce to the multi-table in the database synchronously and asynchronously through Agent V3 or Any Connect. We will know about Transactional and Non-Transaction mode during processing, Using mapping in WHERE condition. MYSQL Database is used for example to modify the existing records in the database and it located on EC2 instance.
We explain here how to do UPDATE operation using a Synchronous and Asynchronous outbound interface. We have understood about Message Type in WHERE-Clause, knowing about putting value in WHERE-Clause on mapping tool, and callout V3 to Agent. And we also have known about Transactional Mode.
-How to do delete operation using an Asynchronous / Synchronous outbound interface?
We use the same Database Adapter in the previous section as it used for INSERT operation. Now we use that Adapter with DELETE operation.
We explain here how to do UPDATE operation using a Synchronous and Asynchronous outbound interface. We have understood about message type in WHERE-Clause, knowing about putting value in WHERE-Clause on mapping tool, and callout V3 to Agent. And we also have known about Transactional Mode.
-How to do Select operation using an Asynchronous / Synchronous outbound interface?
Users can use the same Database Adapter in the previous section as it used for INSERT operation. Now we use that Adapter for QUERY operation.
We explain here how to do select operation QUERY using Synchronous and Asynchronous outbound interface. We have understood about Message Type in WHERE-Clause, knowing about putting value in WHERE condition in mapping tool, Database Query’s field, and callout V3 to Agent.
Streaming API with PushTopic #
In this case, we have to set the flag ‘Streaming, CDC, and Platform Event’ to indicate that the interface operates as an event interface. To distinguish this type from the CDC and Platform Event we have to check the field ‘Source/Target’ that contains the sObject. If it is a sObject and the flag is checked then we know that this interface operates in the mode ‘Streaming API with ‘PushTopic’. In the message type, we define the external message type structure for example the database structure when we want to send data triggered by the event to the database. We can do the mapping from the sObject (source) to the message type (target) side. This mapping is needed to build the transformation logic on the Agent to the external message type structure for example to send to the database.
We have a table in the Agent where we store the interface-id, status, and some other event-related data. This table is created or updated when the user clicks on the button ‘Subscribe’ of the interface on the Agent Control Board. This table is used for internal logic processing inside the agent for the event-driven interface processing. Based on this table we can find the interface and related mapping when an event occurred and the cometD client in the Agent catch this event. With the cometD capability in the Agent, it can subscribe to the event from Salesforce.
When the event gets received we need to find the interface and its related mapping. Knowing this we can transform the data that we received as an event to the external message type structure and send it to the database. A mapping is mandatory in order to do this transformation from the event data to the external data structure based on the message type. In the Agent we have to check and if there is no mapping we have to raise an error in the log.
When we receive the event data we create a message of type ‘Event Message’ in our message table. Doing this way we can provide a kind of event monitoring in Salesforce pushing out to the Agent. We can also do a reprocessing if needed. In this case, we will republish the event again based on the event data in the message. Note that this function is only available for the event type ‘Platform Event’ and not for ‘PushTopic’ and ‘CDC’ event.
Streaming API is a feature used in Agents for real-time data change scenarios. When there is a new record inserted or a record updated on the Salesforce side, it automatically changes the data on the client-side. Use Streaming API to receive notifications for changes to Salesforce data that match a SOQL query you define.
Notification For Operation:
- Create → Uncheck this parameter if you want to change the default behavior. The default behavior is set to true which means that you will get a notification in case the record is created.
- Delete → Uncheck this parameter if you want to change the default behavior. The default behavior is set to true which means that you will get a notification in case the record is deleted.
- Undelete → Uncheck this parameter if you want to change the default behavior. The default behavior is set to true which means that you will get a notification in case the record is undeleted.
- Update → Uncheck this parameter if you want to change the default behavior. The default behavior is set to true which means that you will get a notification in case the record is updated.
- Soft Deleted → Just deletes sObject from the salesforce database but Agent is not deleted record from the local database.
- Hard Deleted → Just deletes sObject from the salesforce database and the Agent will delete records from the local database too.
Replay Option: This option indicates how the client, subscribed to the PushTopic, read the missing data in case it is online again after a failure.
For detailed information:
– Salesforce Basic Streaming API Modules
Change a Salesforce record and you will see the record is pushed to your external system. You can check the message monitoring to see the result.
In your external system, you get a file.
CDC Event #
In this case, we don’t have a SQL to select which data is needed to be sent. All changed data will be automatically sent as events to the Agent. For the CDC event, we just need to set the flag, select the xxxChangeEvent object in the interface on the field ‘Source/Target’ field, for example, AccountChangeEvent, or LeadChangeEvent, OpportunityChangeEvent, etc. In the message type again we put the external message type. Then we can do the mapping from the sObject field to the external message type. The flow is the same that when the user change, insert, delete, or undelete data an event is created and the Agent will receive all the field that has been changed. In Agent, we are checking the mapping and transform the event data to the external structure based on the mapping. This means that when there is no mapping we need to raise an error and write it into the log.
We don’t need to select the operation ‘Insert’, ‘Update’, ‘Delete’ and ‘Undelete’. This operation is pre-selected by default setting when the CDC event is used. Therefore there is no need to configure this operation as we do for the CDC Event trigger with apex. Like case (1) we also create a message for the monitoring. Also, this kind of message cannot be reprocessed by the reprocessing job.
– How to use Streaming API with CDC events?
Change a Salesforce record and you will see the record is pushed to your external system. You can check the message monitoring to see the result.
Test.csv file is generated in your system.