Cast Iron のコネクター・インターフェース

Cast Iron コネクターは、オーケストレーションとして実装される 3 つの標準インターフェース (TestConnection、ListObjects、および DescribeObjects) を使用します。

TestConnection、ListObjects、および DescribeObjects の各インターフェースのオーケストレーション・テンプレートは、「アクティビティーの追加」フェーズでウィザードによって自動的に作成されます。 オーケストレーションは、個別のコネクター要件に基づいて完了させる必要があります。 このセクションでは、TestConnection、ListObjects、および DescribeObjects の各インターフェースの概要を説明します。コネクター・インターフェースのオーケストレーションの完了で、各オーケストレーションを完了させます。

TestConnection

TestConnection インターフェースは、「コネクター情報」ウィンドウに追加した値を反映しており、コネクターはこのインターフェースを使用してエンドポイントとの接続を確立します。 接続が確立されると、接続状況がブール演算子として返されます。

ListObjects

ListObjects インターフェースは、「アクティビティーの追加」ウィンドウに追加した値を反映しており、特定のコネクター・アクティビティーがサポートしているすべてのオブジェクトのリストを返します。 例えば、Salesforce の作成操作が、オブジェクトの中から、AccountCustomerContactOpportunity、および User などのオブジェクトをサポートするというような場合です。 返されるリストは、ListObjects の Reply アクティビティーのスキーマに対応します。 以下は、XML 形式の ListObjects の応答例です。
<ListObjectsResponse
xmlns="http://www.approuter.com/schemas/cdk/api/">
<objectType
label="Customer"
xmlns="http://www.approuter.com/schemas/cdk/api/">Account</objectType>
<objectType
label="Account Object"
xmlns="http://www.approuter.com/schemas/cdk/api/">Customer</objectType>
<objectType
label="Customer details"
xmlns="http://www.approuter.com/schemas/cdk/api/">Contact</objectType>
<objectType
label="Opportunity details"
xmlns="http://www.approuter.com/schemas/cdk/api/">Opportunity</objectType>
<objectType
label="User details"
xmlns="http://www.approuter.com/schemas/cdk/api/">User</objectType>
</ListObjectsResponse>

DescribeObjects

DescribeObjects インターフェースは、コネクター・アクティビティーを通じて公開されているオブジェクトをユーザーが正しく操作できるようにするための入出力を提供します。 例えば、Salesforce の作成操作を選択した場合、ListObjects から選択したオブジェクトに基づいて入力スキーマが動的に検出されます。 DescribeObjects から返される応答は以下のようになります。
<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 スキーマ検出機能を使用すると、実行時にスキーマを動的に検出できます。コネクター・アクティビティーがスキーマ・エレメントを入力または出力として使用する場合は、スキーマがオーケストレーションにインポートされます。以前にインポートされたスキーマを、complexType QName を使用して検出し、入力または出力アクティビティーとして動的に置換する必要がある場合は、以下のスキーマに示すように、DescribeObject 応答内で属性を設定します。
< xsd:schema   targetNamespace = " urn.sample.stock
 " xmlns:xsd = "http://www.w3.org/2001/XMLSchema" >
 < xsd:element   name = "TradePriceRequest" >
 < xsd:complexType >
 < xsd:all >
 < xsd:element   name = "tickerSymbol"   type = "xsd:string"   />
 </ xsd:all >
 </ xsd:complexType >
 </ xsd:element >
 < xsd:complexType   name = "ciObject" ></ xsd:complexType >
 < xsd:complexType   name = " tradingPartner " >
 < xsd:sequence >
 < xsd:element   name = "partnerName"   type = "xsd:string"   />
 </ xsd:sequence >
 </ xsd:complexType >  

例えば、上記のスキーマ内の complexType tradingPartner を置換するには、以下の例に示すように、スキーマを検出して動的に置換するための情報を設定します。

DescribeObject Response value to 
@name   -> tradingPartner [complexType name to be discovered]
@typeNS  ->  url.sample.stock [complexType namespace ]
@baseType -> http://www.approuter.com/schemas/cdk/api/    [CDK default]
@baseType -> cObject [CDK default]
DescribeObjects メニューの例