You are on page 1of 41

1

Informatica Cloud API and


Application Integration
API Implementation and Management workshop
2

Table of Contents
GOAL ............................................................................................................................................................ 3

SYNOPSIS .................................................................................................................................................... 3

CREATE YOUR FIRST API: HELLO WORLD..................................................................................................... 3


CREATE COMPOSITE API: INITIATE ORDER ................................................................................................... 3

ACCESSING INFORMATICA INTELLIGENT CLOUD SERVICES............................................................. 4

CREATE YOUR FIRST API: HELLO WORLD ............................................................................................ 6

CREATE COMPOSITE API: INITIATE ORDER ........................................................................................ 10

STEP 1: IMPORT ASSETS............................................................................................................................ 11


STEP 2: CREATE THE INITIATE ORDER PROCESS ........................................................................................ 15
TRIVIA: INTRODUCTION TO CLOUD APPLICATION INTEGRATION SERVICE CONNECTORS ................................. 18
STEP 3: GET ITEM DETAILS FROM INVENTORY............................................................................................. 19
STEP 4: SET INITIATE ORDER PROCESS OUTPUT ........................................................................................ 20
STEP 5: EXECUTE THE INITIATE ORDER PROCESS....................................................................................... 21
STEP 6: CALCULATE MARGIN AND SALES COMMISSION FOR THE ORDER ...................................................... 23
STEP 7: SEND EMAIL TO CONSUMER AND SERVICE PROVIDER WITH ORDER DETAILS ................................... 26
STEP 8: CREATE A PROCESS TO SEND EMAIL ............................................................................................. 28
STEP 9: ADD EMAIL CAPABILITY TO THE INITIATE ORDER PROCESS ............................................................. 30
STEP 10: EXECUTE THE PROCESS ............................................................................................................. 32
STEP 11: FAULT HANDLING ........................................................................................................................ 33
STEP 13: EXECUTE THE PROCESS AFTER FAULT HANDLING ........................................................................ 36
STEP 14: PUTTING API UNDER MANAGEMENT ............................................................................................. 37
API Manager ....................................................................................................................................... 37
API Portal ............................................................................................................................................ 38
Applying rate limits .............................................................................................................................. 40
Performing Analytics on API invocation .............................................................................................. 40
API Versioning..................................................................................................................................... 40
Caching ............................................................................................................................................... 40

APPENDIX .................................................................................................................................................. 41

LEARN MORE ............................................................................................................................................ 41


3

Goal
In this session, you will learn how to use API and Application Integration capabilities which are
available as part of Informatica Intelligent Cloud Services Platform to:

• Create business, composite and data services


• Expose APIs to internal and external partners
• Make APIs discoverable
• Monitor business services
• Manage and control API usage

Synopsis
Create your first API: Hello World
Learn the basics of creating Processes using Cloud Application Integration and exposing them
as APIs.

Create Composite API: Initiate Order


Cathy, a consumer, wants to order an item online from a retail clothing company’s website.

The retail clothing company also has distributors who can place bulk orders by using the APIs
that the company provides.

John is a developer for the retail clothing company. John creates business workflows and
implements each flow in Informatica Cloud Application Integration. Then, he exposes the flow
as an API. Since the API is not secured, it is vulnerable to misuse.

Mia is an IT Administrator for the company. Mia decides to use Informatica Cloud API Manager
to manage the API that John created. She applies policies to the API to secure it also provide
visibility so that other users can find the API on Informatica Cloud API Portal.

Then, Cathy can use the API behind the scenes when she places an order on the company’s
website. The company’s distributors can also use the API since they can access it now in
Informatica Cloud API Portal.

The company can also monitor and track the API’s use in Informatica Cloud API Manager.
4

Accessing Informatica Intelligent Cloud Services


Steps Screenshot
Go to Informatica Intelligent Cloud Services login
Screen and Select “Don’t have an account?”

You have reached service-specific trials webpage.


Please choose “API CREATION AND
MANAGEMENT” Trial. Click on “Select Trial”

Note: You can also use “REAL TIME DATA


INTEGRATION” and “BUSINESS PROCESS
AUTOMATION” Trials for this lab.
5

You will be directed to the 30-day Free Cloud Trial


Sign up page. Fill in the details and click “START
YOUR FREE TRIAL”

You should see this for a successful registration.

Look for an “Informatica Intelligent Cloud Services


Account” email from
admin@informaticacloud.com. If you do not
receive it within a few minutes, please check your
Junk or Spam folder.

Confirm your account using the “Confirm Account”


link in the email.
6

Create your first API: Hello World


Goal: Create “Hello World” Process and expose as an API
Duration: 10 minutes

Steps Screenshot
Login to Informatica Intelligent Cloud Services (IICS)

• Enter Username
• Enter Password
• Click Log In

Review the My Services screen. These services are


persona / theme / pattern based

• Application Integration: For developers creating


Application Integration assets
• Application Integration Console: For operators
monitoring Application Integration
process/guides
• API Manager: For operators managing API
• API Portal: For developers consuming API

Choose Application Integration. This will take you to


the Explorer page
7

Review Explorer

• Serves as registry of assets


• Assets are organized by Projects and Folders
• Assets are Searchable, filtered and sorted
• Browse assets through Projects and Folders,
Asset Types or tags
Click on New.

• This dialog box is contextual based on the service


• Used to create assets specific to a service
• For Application Integration, you can create
o Processes: Define business flow; expose
as API
o Guides: Expose business flow with user
interactions through form-based screens
o App Connections: To connect to third-
party systems
o Service Connectors: To define connectivity
to third-party REST/SOAP based systems
o Process Object: To define complex data
types
Create a new Process.

• Review Process Designer


o Left palette contains different types of steps
o Right side is the Design canvas
o Bottom panel is to configure Process
properties
• Basic flow created with Start and End
• The canvas has support for basic operations e.g.
cut/copy/paste/search
• Drag-drop or double click to add an activity/step
on the path. Each activity is purpose based
8

By default, you would see General Tab on the


properties panel.

Name the process as Hello World

Go to Start Tab

• Define Binding as REST/SOAP


• Define authentication; allow anonymous access

Define input for this process in Start step property


sheet.

• Go to Input Fields and add a new field using

Name Type Description Required


input Text

Define output for this process in Start step property


sheet.

• Go to Output Fields and add a new field using

Name Type Description Initial Value


output Text
9

Drag and drop (or double-click and choose


Assignment) to add Assignment Step

• Go to Assignments

• Add Field output using


• Perform the assignment as given below:

Field Assigned Using From


output Field Input

Save the process

• Go to Actions and Publish the process


• Go to Properties Detail…

Review Process Properties

• Review the Swagger File


• Copy the Service URL
• SOAP endpoint and WSDL are also available

Invoke the Process as an API

• Pass the right URL parameters (input=Hello World)


• You should get back the expected response as:
{"output":"Hello World"}
10

Create Composite API: Initiate Order


Goal: Create a Business Process and expose it as an API-based service.
Duration: 120 minutes

In this lab, we would be automating Order Initiation using Cloud Application Integration. This is
how the flow looks like:

1. Customer provides Order Details (e.g. ItemName, ItemCount) and personal information
(e.g. CustomerName, CustomerEmail)
2. Item is looked-up in the inventory for the availability.
3. If item is found:
a. Fetch details from inventory on margins for this item.
b. Send emails to Customer and Vendor with order confirmation details.
c. Respond back to the Customer with Order Status, Order ID, Item Price and Order
price.
4. If item is not found:
a. Respond back to the Customer with “Item not in stock. Apologies for the
inconvenience.” Status.

The Overall design would look like:


11

Step 1: Import Assets


Duration: 10 minutes
We need to import Cloud Application Integration assets for this lab. They are needed to connect
to a third-party WebService.

• Get Inventory Detail – This is a Service Connector. It defines the means to connect to a
third-party webservice and details on the operations, endpoint, input and output for these
operation(s).
• Get-Inventory-Detail – This is a Connection for above service connector.

Follow below steps to import Cloud Application Integration artifacts into Cloud Platform.
1. Go to https://network.informatica.com/docs/DOC-17733 and download the “Get
Inventory Detail Connector.zip” file. Save it on your local file system.
2. Click on “Import” button on top right corner and import the downloaded file following
below steps:
12

3. Enable “Publish Application Integration assets after import” to perform automatic


publish of the assets post import.

4. Click Import.
5. Post Import, you can go to “My Import/Export Logs” and click on “Get Inventory Detail
Connector” to get details on Import process.
13

6. Importing these artifacts will come with their own Project/Folder hierarchy. It would have
automatically created a Project “Order Management” and a folder “Shared” inside the
project. The artifacts would be inside the “Shared” folder”. The assets would be in Published
state.

7. Go to “Order Management” Project and create “Lab Exercise” folder


14
15

Step 2: Create the Initiate Order Process


Duration: 10 minutes
In this section, we will create “Initiate Order” Process that:
• Takes Order Details (ItemName, ItemCount) and personal information (CustomerName,
CustomerEmail) as input
• Responds with Order Status, Order ID, Item Price and Order price as output

1. Go to “Lab Exercise” folder and Click “New” > Processes > Create to create a new
Process.

2. This will open Process Designer. You will see process with Start and End Steps already
configured. We will be filling the business logic between “Start” and “End”.

3. Select “Start” Step. We will define the input and output for this process as explained above:
a. Go to “General”. Here we configure basic process properties around
name/description.
i. Give this process a meaningful name in the “Name” field. We will call it
“Initiate Order”.
b. Go to “Start”. Here we need to configure process properties around accessibility.
i. Binding=REST/SOAP. This property defines the accessibility for this process.
With this setting, the process would be available as a WebService over HTTP
ii. Allowed Users=<your IICS username>. This property defines who can invoke
this service. You can use multiple users as well.
16

iii. Run On=Cloud Server. This property defines the execution environment for
this process. We have chosen the default value, Cloud Server.

c. Go to “Input Fields” tab and add Inputs as given below:

Name Type Description Required

CustomerName Text Name of the Customer Yes

CustomerEmail Text Email of the Customer Yes

ItemName Text Name of the Item Yes

ItemCount Integer Number of units of the Item Yes


ordered
17

d. Go to “Output Fields” tab and add Outputs as given below:

Name Type Description

Status Text Status of the order

OrderID Text Order tracking reference number

ItemPrice Number Price of the Item


Please note that you will have to
choose “Type” from “More types.”

OrderPrice Number Price of the order – Item Price * Item


Count

e. Go to “Advanced” and set the Tracing Level to Verbose. This will help you debug
by viewing field data and execution path.

Setting the Tracing Level to Verbose can cause performance degradation. Set it back to None once you deploy
the process to production.

4. Save the process.


5. Publish the process.
18

Trivia: Introduction to Cloud Application Integration Service


Connectors
Connectivity is often a measure to Business Success. With proliferation of applications across
verticals and use-cases, connectivity has become even more prominent. More so, the data
resides in the application which mandates that it is no longer available for local processing. You
usually have a read-only view of data but still need to work with it.

We also understand that it is virtually impossible to build native connectors for each system as
they run into thousands. However, we live in the age of “standards” where each of these
systems offer API interface.

Cloud Application Integration provides a “visual” way to create connections to any of such
systems via REST API. We call them Service Connectors (but they are more like creating
connectors on-the-fly). This is in addition to supporting native connectors like File, AMQP, JDBC.

It is a mere 5-min, less than 10-click process to create a service connector as long as the third-
party system has a web service interface for access, for which the service definition is available
in standard format, and user have access to the third-party system through credentials, if any
required.

To get the users kick-started on journey to leverage connectivity-on-the-fly, Informatica has


published 450+ service connectors on the community that are hosted on GitHub and exposed to
users as Blog on Cloud Application Integration community. We also encourage users to
collaborate and extend this effort by downloading, using, sharing and uploading new connectors
on GitHub.
19

Step 3: Get Item Details from Inventory


Duration: 15 minutes
Goal: Augment the process design to fetch Item details from the inventory
Input: Name of the Item
Output: Item details from Inventory like Cost Price, Selling Price and Sales Commission
Implementation: We will achieve this by making a service call to Inventory.

1. Drag and drop Service Step (or double-click on the link and choose Service Step
from dropdown) between Start and End Step.
2. Go to “General”. Name the Step as “Get Inventory Detail”.
3. Go to “Service”. Here we need to select the service/operation that we need to call.
a. Choose Service Type=Connection, Connection=Order Management > Shared >
Get-Inventory-Detail and Action=getInventoryDetail.
b. You would see the service description below along with Input needed by the
service and Output fields given out by the service.
4. Go to “Input Fields”. Add Field using as:

Name Required Value Assign

Item Name No Field ItemName


20

Step 4: Set Initiate Order Process Output


Duration: 5 minutes
Goal: Augment the Initiate Order process design to set output.

1. Drag and drop Assignment Step between Get Inventory Detail and End Step.
2. Go to “General”. Name the Step as “Assign Order Details”.
3. Go to “Assignments”. Add fields using and assign value to the output fields as
given below.

Field Assigned From


Using
Status Content Your order is accepted.

OrderID Formula util:getProcessId()

ItemPrice Field Item > sellprice [e.g. ]

OrderPrice Formula $output.ItemPrice * $input.ItemCount

For Value=Formula, open the Formula Editor , click on the field name and “Add”
Note: Field names are case-sensitive

4. Save the Process.


5. Publish the Process.
21

Step 5: Execute the Initiate Order Process


Duration: 5 minutes
Goal: We will invoke this process through HTTP request and see the response.
1. Go to Actions > Properties Detail.

2. Here, you will see details on service Endpoints and the service definition .
Click on this link to see service details (Operation, Authentication, Input and Output).
3. We will now invoke this process as a service using browser. Copy the service URL
using “Copy” button and paste it in a separate browser window.
22

4. Add Input parameters to this request. You final URL should look like this:

<Service
URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.c
om&ItemName=item1&ItemCount=2
You may be asked for authentication. In case, you are asked, please use your Cloud
account details for authentication.
5. You should see a successful response; something like:
{"Status":"Your order is
accepted.","OrderID":"178749969799331840","ItemPrice":50.0,"OrderPrice
":100.0}

6. Go to “My Processes” . You will see the process execution details here.
23

Step 6: Calculate Margin and Sales Commission for the Order


Duration: 15 minutes
Goal: Use Inventory details and User Input to calculate company margin and sales commission
for the order.
Implementation: We will do this by connecting to a third-party service. Metadata definition for
this service is available @ https://na1.ai.dm-us.informaticacloud.com/active-
bpel/rt/Calculate_Margin_Service?swagger.
In case you want to view the metadata definition, please ensure you open it in a new browser
window (since you are already logged into IICS with different user). You will be asked for
authentication. Please provide Username as testuser2 and Password as password2#
We will create a Service Connector that defines connectivity to this Service.
1. Go to New > Service Connectors > Service Connector Patterns > Create from Swagger
and click Create. You will see an edit dialogue.
2. Fill in the details as given below:
a. Name= Get Margin Detail
b. Location= Order Management\Lab Exercise
c. Description=<As per your choice>
d. Swagger source=URL
e. Swagger URL=https://na1.ai.dm-us.informaticacloud.com/active-
bpel/rt/Calculate_Margin_Service?swagger
f. Username=testuser2
g. Password=password2# … and click Next >.
3. You should now be seeing the Operations for this service. Review and click Next >.
4. Review the summary and click Finish. The Service connector is now ready and will open
in Edit mode.
5. We will now try to check this Service Connector for execution. We have capability of
testing the third-party service by using Test option. Please follow below instructions:
a. Go to Definitions > Connection Properties and assign values as given below.
These values would be passed in the API call as authentication parameters.

username testuser2

password password2#

b. Go to Actions > Input and set the input request for the action as given below:

Test with { "ItemSellingPrice": 100, "ItemCount": 2, "ItemCostPrice": 50,


"SalesCommissionInPercentage": 10 }
24

c. Go to Actions > Test Results and click Test button. You should see a
successful response.
6. Save the Service Connector.
7. Publish the Service Connector.

We will create a Connection for this Service Connector.


1. Go to New > App Connections and click Create. You will see an edit dialogue.
2. Fill in the details as given below:
a. Name= Get-Margin-Detail
b. Location= Order Management\Lab Exercise
c. Description=<As per your choice>
d. Type= Order Management > Lab Exercise > Get Margin Detail
e. Run On=Cloud Server or any Secure Agent
3. Also, fill in the Connection Properties as:
a. hostname= na1.ai.dm-us.informaticacloud.com:443
b. username= testuser2
c. password= password2#
4. Save the Connection.
5. Publish the Connection.
6. Metadata tab shows the Actions available for this connection as well as Objects (Input
and Output) for the action.

We will now augment the Process to calculate margin and commission using the connection we
just created.
1. Close and open “Initiate Order” Process.
2. Go to Start step > Temp Fields and add a new field by clicking on . This field will be
used as input to the Get Margin Detail Service
3. Add a new field as:
a. Name=InventoryDetails, Type=More Types > Connection defined Types > Order
Management > Lab Exercise > Get-Margin-Detail and choose
Calculate_Margin_ServiceRequest.
4. Go to Assign Order Details Assignment Step and Add Field:

Field Assigned Using From

InventoryDetails > ItemCostPrice Field Item > costprice

InventoryDetails > ItemCount Field ItemCount

InventoryDetails > ItemSellingPrice Field Item > sellprice

InventoryDetails > SalesCommissionInPercentage Field Item > commission

5. Drag and drop Service Step between Assign Order Details Assignment Step and End
Step.
25

6. Go to “General”. Name the Step as “Get Margin Detail”.


7. Go to “Service”. Here we need to select the service/operation that we need to call.
a. Choose Service Type=Connection, Connection= Order Management > Lab
Exercise > Get-Margin-Detail and Action=Calculate_Margin_ServiceOperation.
b. You would see the service description below along with Input needed by the
service and Output fields given out by the service.
8. Go to “Input Fields”. Assign body as Field “InventoryDetails”.
9. Save the Process.
10. Publish the Process.
26

Step 7: Send Email to Consumer and Service Provider with Order


Details
Duration: 15 minutes
Goal: Create separate emails to consumer and service provider with relevant details. Please
note that the email content and address would need to be relevant as per the recipient.
Implementation: We will be doing this by connecting to a third-party email service. Since we
need to send two emails with different content and recipient address, we will create a new
process that sends email using this service. This will need to be called in the “Order
Management” process as a subprocess.
Metadata definition for the third-part email service is available @ https://na1.ai.dm-
us.informaticacloud.com/active-bpel/rt/Email_Service?swagger.
In case you want to view, please ensure you open it in a new browser window (since you are
already logged into IICS with different user). You will be asked for authentication. Please provide
Username as testuser2 and Password as password2#
We will create a Service Connector that defines connectivity to this Service.
1. Go to New > Service Connectors > Service Connector Patterns > Create from Swagger
and click Create. You will see an edit dialogue.
2. Fill in the details as given below:
a. Name= Email Service
b. Location= Order Management\Lab Exercise
c. Description=<As per your choice>
d. Swagger source=URL
e. Swagger URL=https://na1.ai.dm-us.informaticacloud.com/active-
bpel/rt/Email_Service?swagger
f. Username=testuser2
g. Password=password2# … and click Next >.
3. You should now be seeing the Operations for this service. Review and click Next >.
4. Review the summary and click Finish. The Service connector is now ready and will open
in Edit mode.
5. We will now try to check this Service Connector for execution. We have capability of
testing the third-party service by using Test option. Please follow below instructions:
a. Go to Definitions > Connection Properties and assign values as given below.
These values would be passed in the API call as authentication parameters.

username testuser2

password password2#
27

b. Go to Actions > Input and set the input request for the action as given below:

Test with { "SendTo": "testconsumer@mailinator.com", "Message": "Test" }

6. Go to Actions > Test Results and click Test button. You should see a successful
response.
7. Save the Service Connector.
8. Publish the Service Connector.

We will create a Connection for this Service Connector that defines connection to this Service.
1. Go to New > App Connections and click Create. You will see an edit dialogue.
2. Fill in the details as given below:
a. Name= Email-Service
b. Location= Order Management\Lab Exercise
c. Description=<As per your choice>
d. Type= Order Management > Lab Exercise > Email Service
e. Run On=Cloud Server or any Secure Agent
3. Also, fill in the Connection Properties as:
a. hostname= na1.ai.dm-us.informaticacloud.com:443
b. username= testuser2
c. password= password2#
4. Save the Connection.
5. Publish the Connection.
6. Metadata tab shows the Actions available for this connection as well as Input and
Output for the action.
28

Step 8: Create a Process to Send Email


Duration: 15 minutes
We will now create a new process that sends email using this connection.
• Process takes email Address and Message as input
• This process sends the email

1. Go to “Lab Exercise” folder and Click “New” to create a new Process.


2. This will open Process Designer. You will see process with Start and End Steps already
configured. We need to fill the business logic between “Start” and “End”.
3. Select “Start” Step. We will define the input and output for this process as explained
above:
a. Go to “General”. Name the Process as “Send Email”.
b. Go to “Start”. Here we need to configure process properties around accessibility.
i. Binding=REST/SOAP. This property defines the accessibility for this
process. With this setting, the process would be available as a
WebService over HTTP
ii. Allow anonymous access.
iii. Run On=Cloud Server. This property defines the execution environment
for this process. We have chosen the default value, Cloud Server.

c. Go to “Input Fields” tab and add Inputs as given below:

Name Type Required

EmailAddress Text Yes

Message Text Yes


29

d. Go to Temp Fields and add a new field by clicking on . This field will be used as
input to the Email Service Service. Add a new field as:
• Name=Email, Type=More Types > Connection defined Types > Order
Management > Lab Exercise > Email-Service and choose
Email_ServiceRequest.

e. Go to “Advanced” and set the Tracing Level to Verbose. This will help you debug
by viewing field data and execution path.

Setting the Tracing Level to Verbose can cause performance degradation. Set it back to None once you deploy the
process to production.

4. Drag and drop Assignment Step between Start and End Step.
a. Go to “General”. Name the Step as “Create Email”.
b. Go to Assignments and assign value to the output fields as given below:

Field Assigned Using From

Email > Message Field Message

Email > Send To Field EmailAddress

5. Drag and drop Service Step between Create Email Assignment Step and End Step.
6. Go to “General”. Name the Step as “Call Email Service”.
7. Go to “Service”. Here we need to select the service/operation that we need to call.
a. Choose Service Type=Connection, Connection= Order Management > Lab Exercise >
Email-Service and Action=Email_ServiceOperation.
b. You would see the service description below along with Input needed by the service
and Output fields given out by the service.
8. Go to “Input Fields”. Assign body as Field “Email”.
9. Save the Process.
10. Publish the Process.
30

Step 9: Add Email Capability to the Initiate Order Process


Duration: 10 minutes
Goal: Augment the “Initiate Order” Process to send emails to consumer and vendor.
Implementation: We will be using the newly created “Send Email” process as a subprocess to
send email. Also, we will send these emails together at the same time using Parallel Paths step.
1. Close and open “Initiate Order” Process

2. Drag and drop Parallel Paths Step between Get Margin Detail and End Step.
3. Go to “General”. Give a meaningful name to this Step. We will name it “Send Emails”.
Hint: You can add more parallel paths by going to “Parallel Paths” tab and add using

4. Drag and drop Subprocess Step on Path 0 (Top path). Configure this as given below:
a. Go to “General”. Give a meaningful name to this Step. We will name it “Send
Email to Consumer”.
b. Go to “Subprocess”. Select the Process as “Send Email”. You would see the
process description below along with Input needed by the process and Output
given out by the process.
c. Go to “Input Fields” tab and add Inputs as given below:

Name Value Assign

EmailAddress Field CustomerEmail

Message Content Dear {$input.CustomerName}, <br> Thanks for ordering. Your


order ID is: {$output.OrderID}. <br><br> We will deliver your
order in 7 days.

5. Drag and drop Subprocess Step on Path 1 (Bottom path). Configure this as given below:
a. Go to “General”. Give a meaningful name to this Step. We will name it “Send
Email to Vendor”.
b. Go to “Process”. Select the Process as “Send Email”. You would see the process
description below along with Input needed by the process and Output given out
by the process.
c. Go to “Input Fields” tab and add Inputs as given below:
31

Name Value Assign

EmailAddress Content testvendor@mailinator.com

Message Content Order has been accepted. The order ID is: {$output.OrderID}. <br>Please
note below details for your records. <br><br>Overall Profit:
{$output.Calculate_Margin_ServiceResponse[1]/MarginBeforeCommission}
<br>Sales Commission:
{$output.Calculate_Margin_ServiceResponse[1]/SalesCommission}
<br>Profit after Commission:
{$output.Calculate_Margin_ServiceResponse[1]/MarginAfterCommission}

6. Save the Process.


7. Publish the Process.
32

Step 10: Execute the Process


Duration: 5 minutes
Goal: Execute the process, review the output and confirm the email.
1. Go to Actions > Properties Detail.
2. Copy the service URL using “Copy” button and paste it in a separate browser window.
3. Add Input parameters to this request. You final URL should look like this:

<Service
URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com
&ItemName=item1&ItemCount=2
You will be asked for authentication. Please use your Cloud account details for
authentication.
4. You should see a successful response; something like:
{"Status":"Your order is
accepted.","OrderID":"178749969799331840","ItemPrice":50.0,"OrderPrice"
:100.0}

5. Additionally, you will see Emails into two email accounts, testvendor@mailinator.com
and testconsumer@mailinator.com. To do this:
a. Go to www.mailinator.com
b. Search for testconsumer
c. Search for testvendor
d. Review the emails.

6. Go to “My Processes” and click refresh . You will see the process execution
details here.
33

Step 11: Fault Handling


Duration: 10 minutes
Goal: Update the “Initiate Order” process to handle faults
“Get Inventory Detail” generates a fault if the Item is not found. We will now see how to handle
this fault.
1. Call this process with below request:

<Service
URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com
&ItemName=item7&ItemCount=2
2. The response would be:
{"error":{"code":500,"detail":{"reason":"{\"status\":\"not_found\"}","c
ode":"HTTP_404"},"message":"{\"status\":\"not_found\"}"}}

3. Go to “My Processes” and click refresh . You will see the process
execution details here.

4. Click on “Id” link and review the process execution flow. It indicates that fault occurred
at “Get Inventory Detail” Step.

5. To handle this fault, go to “Initiate Order” Process and select “Get Inventory Detail” Step.
34

6. Go to “Fault Handling” and check “Catch Faults”. This will create a fault handling branch
in the process as shown below.

7. We want to calculate margin and send emails when we do not fault. Hence, we need to
move the success path on the non-faulted branch. We will do this by dragging and
dropping each of the steps one-by-one on the success branch.
35

8. Drag and drop Assignment Step on the Fault path.


9. Go to “Assignments”.
a. Go to “General”. Name the Step as “Set fault status”.
b. Add Fields as: Field=Status, Assigned Using=Content and assign “Item not in
stock. Apologies for the inconvenience.”
10. Save the Process.
11. Publish the Process.
36

Step 13: Execute the Process after Fault Handling


Duration: 5 minutes
1. Call this process with below request:

https://na1.ai.dm-us.informaticacloud.com/active-
bpel/rt/Initiate_Order?CustomerName=TestConsumer&CustomerEmail=testconsumer@
mailinator.com&ItemName=item7&ItemCount=2
You will be asked for authentication. Please use your Cloud account details for
authentication.
2. The response would be:
{"Status":"Item not in stock. Apologies for the inconvenience."}

3. Go to “My Processes” and click refresh .. You will see the process
execution details here.

4. Click on “Id” link and review the process execution flow. It indicates that fault occurred
at “Get Inventory Detail” Step but the process did not fault and completed successfully
with the expected message.
37

Step 14: Putting API under management


Duration: 10 minutes
Earlier, we learned how to create complex orchestration and expose them as API. However, we
still do not have any visibility on API invocation or enforce advanced authentication schemes or
policies on these APIs.

We will learn how to put this API under Management and consume these managed APIs. Let’s
introduce you to the two IICS Services that helps you do that:

Prerequisite: In order to invoke the serviceYou need to assign Service Consumer role to the user
invoking this service. You can do this by going to Administrator (Application) -> Users -> Click on
<username> and assign Service Consumer role, as illustrated below:

API Manager
Control and manage your APIs by applying authentication and authorization, rate limits, IP
filtering, versioning and more. With API Management analytics, get insight on your APIs’
consumption, trends, events and exceptions. This service caters to the Administrator persona
which controls the API access to different roles.
38

API Portal
Promote broader use of your APIs and offer consumer developers through an easy-to-access
API Portal that includes API information, “try it” capabilities, SDK generation and more. This
service caters to Developer persona who are keen on discovering and consuming the APIs.

Now, let’s put the API under managements

1. Choose API Manager Service from the Application Switcher .


2. If you are opening this service for the first time, you would be requested to choose API
domain name. Here, we will use the default name. Click Save.

3. You would be taken to API Registry page which shows all the available services
(REST/SOAP) in the org. You will see something like:

4. You can create a Managed API for an available API by clicking Actions > Create
Managed API. With this, the service will become available with a different URL that you
can apply policies on and perform analytics. We will create Initiate_Order API with REST
Protocol into a Managed API.
39

5. Choose appropriate API name. For this lab, we will use the default name as shown
below. Click Create.

6. This will make the API Status as Active. It indicates that the API is now available through
a URL from API Manager.

7. Copy the URL by clicking on Actions > Copy URL and suffix the request parameters (as
we did earlier). Request parameters are:
CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com&It
emName=item1&ItemCount=2
40

8. Paste the complete URL [<Copy


URL>?CustomerName=TestConsumer&CustomerEmail=testconsumer@mailinator.com
&ItemName=item1&ItemCount=2] in the browser. You will be asked for authentication.
Please use your Cloud account details for authentication.
9. You should see response (same as what we saw earlier):
{"Status":"Your order is
accepted.","OrderID":"179080697674215424","ItemPrice":50.0,"OrderPrice"
:100.0}

There are other key features of API Manager that we will let you explore on your own.

Applying rate limits

Apply rate limit policies per API through Actions > View Details > Rate Limit OR for all the APIs
in the org by going to Policies tab.

Performing Analytics on API invocation

Perform Analytics on the API invocations using the Analytics tab. This includes:
Overview tab
You can use the Overview page in the Analytics page to view graphical summary information
about APIs, including trends in usage over time, APIs with the most invocations, and the most
frequent users.
Activity Log
You can use the Activity Log tab in the Analytics page to view managed APIs access requests
for a selected date range.
Event Log
You can use the Event Log tab in the Analytics page to view policy breaches on managed APIs
for a selected date range.

API Versioning

Test and validate your APIs - Use API Versioning to control your API lifecycle.

Caching

Shorten response time and off load your backend - Use API Caching.
41

Appendix

Learn More
Visit below link to learn more about Informatica Cloud Application Integration,
• Searching an issue
• Browse the content by Categories
• Latest updates
https://network.informatica.com/community/informatica-network/products/cloud-
integration/cloud-application-integration

You might also like