In the previous blog we have seen how to define Lookups in OIC. In this blog we will use that defined lookups in an Integration.
STEP 1 : create a App Driven Orchestration
Enter Below details and click Create :
*what do you want to call your Integration : Country code to
Country Name (you can give any meaningful name)
- Advertisement -
STEP 2 : Search for the connection name RESTConnection and click on it.
(you can access this blog to configure this REST connection)
Enter the below details and click NEXT (as shown in below image )
Save the below schema as Input.xsd to your desktop
<?xml version = '1.0' encoding = 'UTF-8'?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="IntegrationRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="Input" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="CountryCode" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
choose the above schema file at Schema Location and click NEXT
Similarly save the below schema as Output.xsd
<?xml version = '1.0' encoding = 'UTF-8'?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="IntegrationResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Output" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="CountryName" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
choose the above schema file at Schema Location and click NEXT
Click Done
- Advertisement -
STEP 3 : Now add one Assign Activity (as shown in below image )
Enter below details and click Create
*Name : TempVariable
Click on "+" icon to add variable
Enter Variable Name as "vCountryCode" and click EDIT
(as shown in below image )
Drag and Drop the Lookup Value function in Expression window
Select your Lookup (CountryLookup) which was created in previous blog
click Select Source Column and then select Country code
- Advertisement -
similarly Select Target Column and click Country Name
Click NEXT
Enter some default value and click Next
Click Done
image )
Click Save and click Close.
STEP 4 : Now Open the mapper
Map the $vCountryCode (at source side ) to CountryName (at target
side ). Validate the mapper & then close.
Save the integration and then click Close development window.
Integration development is completed
Please see the Next blog for its testing...
Why we have used PUT operation here for Lookup while developing Integration. Can GET be used for this scenario?
ReplyDeletebecause we are triggering the integration with the input payload, that's why used HTTPS 'PUT' method
DeleteThe GET Method
GET is used to request data from a specified resource
The PUT Method
PUT is used to send data to a server to create/update a resource.