天天看點

Salesforce Integration 概覽(七) Data Virtualization資料可視化

本篇參考:https://resources.docs.salesforce.com/sfdc/pdf/integration_patterns_and_practices.pdf

Salesforce實時通路外部資料。這樣就不需要在Salesforce中儲存資料,然後在Salesforce和外部系統之間協調資料。

一.上下文

您可以使用Salesforce跟蹤銷售線索、管理銷售管道、建立銷售機會,并捕獲将銷售線索轉換為客戶的訂單詳細資訊。然而,Salesforce不是包含或處理訂單的系統。訂單由外部(遠端)系統管理。但是銷售代表希望在Salesforce中檢視和更新實時訂單資訊,而不必學習和使用外部系統。

二. 問題和考慮因素

 問題: 在Salesforce中,如何檢視、搜尋和修改存儲在Salesforce外部的資料,而不将資料從外部系統移動到Salesforce中?

考慮因素:當基于這種模式應用解決方案時,需要考慮各種各樣的因素:

•是否要在Salesforce中建構聲明式/點選式出站內建或UI mashup?

•是否有大量資料并且不想複制到Salesforce組織中?

•是否需要同時通路少量遠端系統資料?

•是否需要實時通路最新資料?

•是否将資料存儲在雲端或背景系統中,但希望在Salesforce組織中顯示或處理這些資料?

•在Salesforce中存儲某些類型的資料時,您是否有資料駐留問題?

三. 解決方案

解決方案 适配程度 介紹
Salesforce Connect Best

使用Salesforce Connect通路來自外部源的資料以及Salesforce資料。實時從傳統系統(如SAP、Microsoft和Oracle)中提取資料,而無需在Salesforce中複制資料。Salesforce Connect将外部系統中的資料表映射到組織中的外部對象。外部對象與自定義對象類似,隻是它們映射到Salesforce組織外部的資料。Salesforce Connect使用到外部資料的實時連接配接來始終保持外部對象的最新狀态。

通路外部對象從外部系統實時擷取資料。Salesforce Connect允許您:

•查詢外部系統中的資料。

•在外部系統中建立、更新和删除資料。

•通過清單視圖、詳細資訊頁、記錄提要、自定義頁籤和頁面布局通路外部對象。

•定義外部對象與标準或自定義對象之間的關系,以內建不同來源的資料。

•在外部對象頁面上啟用Chatter提要以進行協作。

•對外部資料運作報告(有限)。

•檢視Salesforce移動應用程式上的資料。

要使用Salesforce Connect通路存儲在外部系統上的資料,可以使用以下擴充卡之一:

•OData 2.0擴充卡或OData 4.0擴充卡-連接配接到任何OData 2.0或4.0生産商公開的資料。

•跨組織擴充卡-連接配接到存儲在另一個Salesforce組織中的資料。跨組織擴充卡使用标準的Lightning Platform REST API。與OData不同,跨組織擴充卡直接連接配接到另一個組織,而不需要中間web服務。

•通過Apex建立的自定義擴充卡-如果OData和跨組織擴充卡不适合您的需要,請使用Apex連接配接器架構開發您自己的擴充卡。

也可以參考:

salesforce零基礎學習(九十八)Salesforce Connect & External Object

Request and Reply Suboptimal

使用Salesforce web服務API發出特殊資料請求以通路和更新外部系統資料。此解決方案包括以下方法:

使用Salesforce SOAP API。自定義Visualforce頁面或按鈕以同步方式啟動Apex SOAP調用。在Salesforce中,您可以使用WSDL并生成最終的代理Apex類。此類提供調用遠端服務所需的邏輯。Visualforce頁上使用者啟動的操作然後調用Apex控制器操作,該操作執行此代理Apex類以執行遠端調用。Visualforce頁面需要定制Salesforce應用程式。

使用Salesforce REST API。自定義Visualforce頁面或按鈕以同步方式啟動Apex HTTP調用(REST服務)。在Salesforce中,可以使用标準的GET、POST、PUT和DELETE方法調用HTTP服務。可以使用幾個HTTP類與RESTful服務內建。Visualforce頁上使用者啟動的操作然後調用Apex控制器操作,該操作執行這些代理Apex類以執行遠端調用。Visualforce頁面需要定制Salesforce應用程式。

這種操作适用于特殊場景,需要過濾或者需要做資料的格式轉換等操作,之是以次優因為需要有溝通、開發以及聯調的工作,耗時長,穩定性取決于代碼品質等等。

四. 流程草圖

Salesforce Integration 概覽(七) Data Virtualization資料可視化

在這種情況下:

1.浏覽器執行一個AJAX調用,該調用依次對相應的外部對象擴充卡執行一個操作。

 2.擴充卡将操作轉換為OData請求,并通過內建層和服務層向遠端系統發出HTTP GET請求。

 3.遠端系統通過內建層和服務層向Salesforce傳回JSON響應。

 4.将響應從OData轉換為外部對象并呈現回浏覽器。

五. 其他關鍵點

調用機制 描述
External Objects Salesforce Connect将Salesforce外部對象映射到外部系統中的資料表。Salesforce Connect不是将資料複制到組織中,而是按需實時通路資料。即使資料存儲在組織外部,Salesforce Connect也能與Lightning平台無縫內建。Salesforce工具可以使用外部對象,例如全局搜尋、查找關系、記錄源和Salesforce移動應用程式。外部對象也可用于Apex、SOSL、SOQL查詢、salesforceapi,以及通過中繼資料API、變更集和包進行部署。

Lighting Components or

Visualforce Pages

當遠端程序作為涉及使用者界面的端到端程序的一部分觸發時使用,并且結果必須在Salesforce記錄中顯示或更新。例如,向外部支付網關送出信用卡支付并立即傳回顯示給使用者的支付結果的過程。由使用者界面事件觸發的內建通常需要建立自定義Lightning元件或Visualforce頁面。

六. 常見考題

 Given the diagram below, a Salesforce org, middleware, and Historical data store (with 20milIion records and growing) exists with connectivity between them.

Salesforce Integration 概覽(七) Data Virtualization資料可視化

 Historical records are archived from Salesforce and moved to Historical Data store (which houses 20M records and growing; fine tuned to be performant with search queries). Call center agents use Salesforce, when reviewing occasional special cases, have requested access to view the related historical case items that relate to submitted cases. Which mechanism and patterns are recommended to maximize declarative configuration?

Use ESB tool with Data Virtualization pattern, expose OData endpoint, and then use Salesforce Connect to consume and display the External Object along side with the Case object.

Universal Containers (UC) wants to connect their on-premise ERP system to view Order data in Salesforce. UC is considering a solution to integrate the on-premise system using Salesforce Connect via OData. Which three considerations should an Architect keep in mind when recommending use of Salesforce Connect?  Salesforce Connect的優點

Customer wants the ability to query external data using Global Search and reports.

Customer needs to query small amounts of data at any time and display using a related list.

Customer has a large amount of data that they do not want to load into Salesforce.

 Customer does not want real-time access to the ERP data and is willing to wait for hourly refreshes.

Customer wants to create a master-detail relationship between Opportunity and the external object.

總結:此種場景針對大資料不能落在SF并且滿足需要檢視等的需求,還是很好的解決方案。至此所有的內建模式都已經描述完。篇中有錯誤歡迎指出,有不懂歡迎留言。

作者:zero

部落格位址:http://www.cnblogs.com/zero-zyq/

本文歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接配接

個人下載下傳了一些相關學習的PDF檔案,如果需要下載下傳請通路百度雲 點選此處通路 密碼:jhuy

如果文章的内容對你有幫助,歡迎點贊~

為友善手機端檢視部落格,現正在将部落格遷移至微信公衆号:Salesforce零基礎學習,歡迎各位關注。

繼續閱讀