Hands On Activities Integration Architecture PDF
Hands On Activities Integration Architecture PDF
Hands On Activities Integration Architecture PDF
INTEGRATION ARCHITECTURE
FEBRUARY, 2018
Leverage the features and capabilities of the platform appropriately within the
solution.
USE CASE
A company, Universal Containers, uses several systems as part of their enterprise
system landscape, including Salesforce.com and an ERP system. Salesforce.com is
the master system for CRM data, such as Accounts and Opportunities. The ERP
system is the master system for customer orders and shipping and billing
information.
DETAILED REQUIREMENTS
As part of their business process flow, once a sales opportunity is successfully closed
(“Closed Won”) an order needs to be created with the details from the opportunity
for shipping and subsequent invoicing. The opportunity is maintained in
Salesforce.com, but the order needs to be created in the on premise ERP system, as
it is the order master. Once the order is created in the ERP system, the opportunity
status must be changed to indicate that the order was created.
ASSUMPTIONS
• Universal Containers has middleware that integrates with the on premise ERP
system.
• This middleware can host a SOAP endpoint using a WSDL from Salesforce.
• The user doesn’t need to be immediately notified of the order number after
the opportunity converts to an order.
• The solution must only use declarative features of Salesforce.com.
3. Open the monitor URL in a new tab. This helps to monitor all the messages
coming to this endpoint and provides an ability to play around with the
responses being sent.
CONSIDERATIONS
• What are the patterns that can be used?
• What is the integration frequency: real-time vs. batch?
• What are the Salesforce.com platform limits?
• How are errors handled both in Salesforce.com and on the third-party
platform?
• Can you send information from multiple related objects?
• Which web-services protocols can be used?
• How is security handled (2-way SSL, authentication)?
• Choose the object that has the information you want included in the
outbound message, in this case Opportunity, and click Next.
• Switch to the monitor URL and you should see messages being received
by endpoint.
Alert: Please have only one browser listener window open at any point
of time.
• Go back to the Monitor URL and toggle the response back to true.
• Now through automated retry, the messages are delivered again. It can also
be manually retried by clicking the Retry button.
USE CASE
Universal Containers uses Salesforce, but has a separate system that contains
customer order, billing, and shipping information. Salesforce.com is the master
data source for Accounts and Opportunities.
Universal Containers wants to display the order status and billing history for a
customer account without having to store that data in Salesforce because of NPI
data security concerns. They have an existing REST/Web Service that can return
order status and shipping information given an account number, but cannot
otherwise display this data in a browser.
CONSIDERATIONS
• Does the call to the remote system require Salesforce to wait for a response
before continuing processing? In other words, is the call to the remote
system a synchronous request-reply or an asynchronous request?
• If the call to the remote system is synchronous, does the response need to be
processed by Salesforce as part of the same transaction as the initial call?
• Is the message size relatively small or large?
• Is the integration based on the occurrence of a specific event, such as a
button click in the Salesforce user interface, or DML-based events?
In the Request-Reply pattern, Salesforce makes a call to the remote system to either
perform an operation or fetch data. It then waits for successful completion of that
call. To signify successful completion, the remote system synchronously replies with
the requested data or a success indicator code. The remote system exposes a web
service (REST or SOAP) that allows other systems, such as Salesforce, to integrate
with it.
• Create a Visualforce page and extension controller to call REST/ Web service
with required parameters.
• Create the custom controller that parses the returned values from the REST
callout or Web Service.
• The Visualforce page subsequently renders the order and billing details to the
user.
1. Create an Object.
Create an Object (iOrder) with following field and API names:
Note the use of field "External ID" to store reference to the OrderID in the external
system. Furthermore, you can create your own object and appropriate relationships.
If you have your own object model, use and carry the appropriate API names in
Apex and Visualforce pages.
7 public iOrderControllerExtension(ApexPages.StandardController
controller) {
8 //initialize the stanrdard controller
9 this.controller = controller;
10 this.myOrder = (iOrder__c)controller.getRecord();
11 }
12 public void refreshOrderShipInfo()
13 {
14 myOrderShipInfo = new OrderShipInfo();
15 theShipInfo =
myOrderShipInfo.getOrderShipInfo(this.myOrder.Order_External_ID__c);
16 myOrder.Order_Status__c = theShipInfo.status;
17 update myOrder;
18 }
19 public String getOrderStatus()
20 {
21 return theShipInfo.status;
22 }
23 public String getOrderComments()
24 {
25 return theShipInfo.comments;
26 }
27 public String getOrderOwner()
28 {
29 return theShipInfo.orderOwner;
30 }
31 }
1 <apex:page standardController="iOrder__c"
extensions="iOrderControllerExtension">
2 <apex:pageBlock >
3 <apex:pageBlockSection >
4 <apex:pageBlockSectionItem >
5 <apex:outputLabel value="Order Status" for="order_status"/>
6 <apex:outputText value="{!iOrder__c.Order_Status__c}" id="order_status"/>
7 </apex:pageBlockSectionItem>
8 <apex:pageBlockSectionItem >
9 <apex:outputLabel value="External System Order ID" for="external_id"/>
10 <apex:outputText value="{!iOrder__c.Order_External_ID__c}"
id="external_id"/>
11 </apex:pageBlockSectionItem>
12 <apex:pageBlockSectionItem >
13 <apex:outputLabel value="Shipping Number" for="shipping_number"/>
14 <apex:outputText value="{!iOrder__c.Shipping_Number__c}"
id="shipping_number"/>
15 </apex:pageBlockSectionItem>
16 </apex:pageBlockSection>
17 <apex:pageBlockButtons location="bottom">
18 <apex:form >
19 <apex:commandButton action="{!refreshOrderShipInfo}" value="Refresh Order
Status" id="theButton"/>
20 </apex:form>
21 </apex:pageBlockButtons>
22 </apex:pageBlock>
USE CASE
A company, Universal Containers, uses several systems as part of their enterprise
system landscape including Salesforce.com and an ERP system. Salesforce.com is
the master system for CRM data such as Accounts and Opportunities. The ERP
system is the master system for customer orders, shipping and billing information.
DETAILED REQUIREMENTS
As part of their business process flow, when an order in created in the ERP system, it
needs to be also created in Salesforce.com in real-time.
3. Log in to Salesforce.
• Before doing any operation through SOAP API, a login step is necessary. This
step gets the Session ID and Server URL from Salesforce, which must be
passed back to Salesforce on further operations in SOAP API.
• Replace the variables in the XML data in the text area under that webpage's
STEP #2 with your username and password.
TRAILHEAD SUPERBADGE
1. WORKFLOW
Build a Workflow to trigger an Outbound Message on update to an Account
record.
2. SOAP INTEGRATION
Using a simple SOAP integration tool (e.g., SOAPUI, Eclipse), import the SOAP
WSDL and perform each of the core operations (login, query, upsert, etc.) to
understand the message structure.
3. REST INTEGRATION
Using a simple REST integration tool (e.g., cURL, Postman), authenticate and
perform some basic GET and POST requests to the REST API to understand the
message structure.