完成 DescribeObjects 編排
若要完成 DescribeObjects 編排,您可以將輸出對映至輸入資料,並將物件 meta 資料轉換成 XML 格式,以符合 ci-connector-api.xsd 檔,然後測試編排。
程序
- 在 Studio「專案」工具箱標籤中,按一下 DescribeObjects 編排。 編排會顯示在 Studio 工作區中。
- 在編排中,按一下提供服務活動。 這時會顯示「對映輸出」畫面。
- 在「對映輸出」畫面中,按一下主體。 這時會出現顯示輸入資料的節點類型視窗。
- 根據 object 和 operation_name 將邏輯新增至編排(如圖 1 所示),來取得物件 meta 資料。 圖 1. DescribeObjects
- 將物件 meta 資料轉換成 XML 格式,以符合Cast Iron CDK 綱目檔中說明的 ci-connector-api.xsd 檔。將 meta 資料轉換成 XML 之後,您的綱目看起來如下:
< DescribeObjectResponse baseType = "sObject" baseTypeNS = "urn:sobject.partner.soap.sforce.com" name = "create" typeNS = "http://example.com/stockquote" xmlns = "http://www.approuter.com/schemas/cdk/api/" xmlns:con = "http://www.approuter.com/schemas/cdk/config/" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" > < object label = "createInput" maxCount = "1" minCount = "1" name = "createInput" used = "true" > < con:field configurable = "true" label = "ObjectName" maxCount = "1" minCount = "1" name = "ObjectName" used = "true" > < con:type > string </ con:type > </ con:field > < con:field configurable = "true" label = "FirstName" maxCount = "1" minCount = "1" name = "FirstName" used = "true" > < con:type > string </ con:type > </ con:field > < con:field configurable = "true" label = "LastName" maxCount = "1" minCount = "1" name = "LastName" used = "true" > < con:type > string </ con:type > </ con:field > < con:field configurable = "true" label = "Phone" maxCount = "1" minCount = "1" name = "Phone" used = "true" > < con:type > string </ con:type > </ con:field > </ object > < responseObject label = "createOutput" maxCount = "1" minCount = "1" name = "createOutput" used = "true" > < con:field configurable = "true" label = "Id" maxCount = "1" minCount = "1" name = "Id" used = "true" > < con:type > string </ con:type > </ con:field > < con:field configurable = "true" label = "ObjectName" maxCount = "1" minCount = "1" name = "ObjectName" used = "true" > < con:type > string </ con:type > </ con:field > < con:field configurable = "true" label = "Status" maxCount = "1" minCount = "1" name = "Status" used = "true" > < con:type > string </ con:type > </ con:field > </ responseObject > </ DescribeObjectResponse >
- 在 DescribeObjects 編排中,選取傳送回覆活動。 這時會顯示「對映輸入」畫面。
- 在「對映輸入」畫面中,將產生的 XML 對映到「目標活動」畫面中的 DescribeObjectResponse 參數。 您現在已準備好測試編排。
- 在編排中,於提供服務活動上按一下滑鼠右鍵。 這時會顯示「驗證活動」功能表。
- 在「驗證活動」功能表中,選取呼叫服務。 這時會顯示「呼叫服務」視窗。
- 在「呼叫服務」視窗中,輸入標頭和主體資料,然後按一下執行來啟動測試。如果要檢視測試活動,請按一下顯示回應按鈕。
結果
下一步
上層主題: 完成連接器介面編排