Professional Documents
Culture Documents
Integration Suite
Exercise
PUBLIC
EXERCISE: CLOUD INTEGRATION
Guidelines
The openSAP courses are very popular, and we welcome thousands of participants. The exercise described
in this document will be performed by hundreds of participants in parallel, using production tenants with
shared resources in a shared SAP Business Technology Platform (BTP) account. This means a few simple
things:
1. Use the tenant that we provide only for this exercise, and not for anything else. For further exploration
of Cloud Integration, use a free BTP trial account or a Free Tier tenant.
2. Do not share any private or personal information such as your name, email address or affiliation.
3. Please strictly follow the instructions, regarding the naming conventions you will use to name the
artifacts you will create. This ensures that you will be able to successfully complete the tasks,
without clashing with other participants.
4. Other artifacts, created by other participants, will appear in your shared account. Do not access or
delete these artifacts. Please respect the rules and allow others to have the same learnings as
you.
We have done everything to make this experience enjoyable. Your openSAP tenants were pre-configured by
a competent technical BTP administrator, Cloud Integration capability is already provisioned, and you
already have all the roles and definitions you need to complete this exercise.
Preparation
This exercise is intended to guide you through the step-by-step execution of the latest enhancements that
are offered as part of the Cloud Integration capability of SAP Integration Suite. Please follow the below steps
to make sure you have the right tenants and the details to execute the exercise.
1. The SAP Integration Suite tenant URL can be obtained from the system preparation document after
enabling your SAP Integration Suite tenant using the tenant booking application.
2. Copy and paste the Process Integration Client ID and Process Integration Client Secret obtained
from the tenant booking app and keep it handy in a notepad. We would need this to run the scenario.
2
Scenario Overview
In this sample scenario we like to replicate Product with associated entities i.e. Category and Supplier from
a WebShop Application to a Northwind Application using OData V2 APIs with asynchronous
decoupling and guaranteed delivery using internal message queues and JMS (Java Messaging Service)
adapter.
We also want to ensure idempotency, meaning that no duplicate products, categories, or suppliers should
be replicated in the target Northwind application. Let's break down the scenario for better understanding.
Components Involved:
1. WebShop Application: The source application where product data resides, including categories and
suppliers. We trigger the product replication using any external REST client by just sending the
Product Id and then the interface fetches the Product details along with Supplier and Category via
exposed OData V2 API.
2. Northwind Application: The target application where you like to replicate the data. It follows the
Northwind database schema and only provide OData V2 APIs without any user interface.
3. OData V2 APIs: Both the WebShop and Northwind applications expose OData V2 APIs for data
exchange.
4. Asynchronous Messaging with JMS: Instead of directly sending data to the Northwind Application,
we publish the data to a JMS queue for asynchronous processing and guaranteed delivery.
This decouples the replication process, ensuring that data is reliably delivered even if the Northwind
Application is temporarily unavailable.
5. Check for Idempotency: Before replicating any data, we also check whether it is already replicated in
the Northwind Application using an Idempotent Process Call to prevent duplication.
For each product, category, and supplier, we check whether a corresponding record with the same
unique identifier i.e., Product ID, Category Name, and Supplier ID is already replicated in the
Northwind Application or not.
6. Data Transformation Logic: Message Mapping artifacts are already created and deployed to map
the data structure for Product, Category, and Supplier from the WebShop application to match the
Northwind database schema.
7. Scripting Logic: Reusable groovy scripts are already created and deployed that provide some utilities
for Message Processing Logs (MPL), like writing payload attachments and custom headers with
business context i.e., Product ID.
8. Completion and Monitoring: Monitor the data replication process to ensure it completes
successfully.
Cloud Integration now provides a feature where users can consume reusable artifacts such as Message
Mapping and Script Collection Artifacts across different packages. This brings a better reusability experience
for our customers and the same is also demonstrated in this exercise.
As mentioned above, the message mapping and script collection artifacts are already created as part of the
solution package and deployed on the tenant, and we just consume the same during this exercise instead of
creating it again from scratch.
3
Note:
We have also provided the solution package in the tenant and available as part of additional material as
well that you can refer to if you run into errors.
In case you like to consume and run the integration flows without creating on your own as depicted in the
following steps, kindly check the solution documentation.
4
Task 1: Create Integration Flow to replicate Products from WebShop to JMS Queue
Note:
In this exercise where required, replace the ‘###’ with a unique identifier, e.g., your UserID like user001.
Explanation Screenshot
5
Explanation Screenshot
Hint: Replace ‘###’ with a unique identifier
e.g., your user id
Name:
openSAP_btp3_Week4_Exercise_###
Short Description:
In this exercise, we replicate
Product along with Category and
Supplier from WebShop to
Northwind application using OData
V2 test service.We'll cover Async
decoupling via JMS, Idempotent
Process Calls, Message Mapping
and Script Collection Artifacts, etc.
Version: 1.0.0
Press “Save”
Name:
WebShopToJMS_ProductReplicati
on_###
Short Description:
Product Replication from WebShop
to Northwind application by writing
it to JMS for Async Decoupling
Press “OK”
6
Explanation Screenshot
7
Explanation Screenshot
Address: /###/products
8
Explanation Screenshot
Step 14. In order to open the
general Integration Flow
settings, click on a white space in
the IFlow Diagram as shown in the
screenshot.
9
Explanation Screenshot
10
Explanation Screenshot
Press “OK”.
11
Explanation Screenshot
12
Explanation Screenshot
Press “OK”.
13
Explanation Screenshot
14
Explanation Screenshot
15
Explanation Screenshot
Hint: Replace ‘###’ with a unique identifier
e.g., your user id
Queue Name:
webshop_products_###
Name: CamelHttpResponseCode
Source Type: Constant
Source Value: 202
16
Explanation Screenshot
Type: Constant
Body: Accepted
Version: 1.0.0
Comment: initial version
Press “OK”
17
Task 2: Create Integration Flow to replicate Products to Northwind application using JMS Queue
Note:
In this exercise where required, replace the ‘###’ with a unique identifier, e.g., your UserID like user001.
18
Step 4. Navigate to “Artifacts” tab
and Press “Add” -> “Integration
Flow”
Name: JMS_to_Northwind
ProductReplication_###
Description: Product Replication
from WebShop to Northwind
application by reading it from
JMS for Async Decoupling
Press “OK”
19
Step 7. Press “Edit” button to
switch to the edit mode.
20
Step 11. Select “JMS” sender
adapter.
Queue Name:
webshop_products_###
21
Step 14. Select Package
“openSAP_btp3_Week_4_Exerci
se_Solution”.
22
Step 17. Select “Groovy Script”
step.
23
Step 20. Switch to “Referenced
Resources” and select
“MPLCustomHeader”.
Press “OK”.
Again, leave the script function
empty as the default
“processData” function will be
called if no value provided.
24
Step 23. Switch back to the
“Integration Process”, select the
“Set MPL Custom Header” step
and press the “+” button to create a
new flow step.
25
Step 26. Go to your Idempotent
Process “Replicate Product,
Category and Supplier to
Northwind” and widen the object
to allow space for more steps.
Entry 2:
Name: CustomHeaderValue
Source Type: Property
Source Value:
CamelDuplicateMessage
26
Note: This custom header helps us to filter
the message processing logs where the
product id is duplicate
CamelDuplicateMessage property is
provided by the platform
27
Step 33. Switch to “Processing”
tab and press “Select
Press “OK”
28
Step 37. Rename the step to:
Check duplicate
29
Step 40. Rename the Route to:
Duplicate
30
Step 44. Select the “Check
duplicate” router step and press
the “+” button to add a new flow
step.
31
Step 46. Rename the step to:
Get Product Details
32
Step 49. Select “OData” as
receiver adapter and protocol as
“OData V2”
Address: https://refapp-espm-ui-
cf.cfapps.eu10.hana.ondemand.co
m/espm-cloud-web/espm.svc
Authentication: None
33
Step 52. Select the “Get Product
Details” step and press the “+”
button to create a new flow step.
34
Step 56. Switch to “Referenced
Resources” and select
“MPLAttachment”.
Press “OK”
35
Step 60. Rename it to: Replicate
Entities
36
Step 64. Select “ProcessDirect”
receiver adapter.
37
Step 67. Click “Save as Version”
button on top right of the window.
Version: 1.0.0
Comment: initial version
Press “OK”
38
Task 3: Create Integration Flow to replicate entities data to Northwind application
Note:
In this exercise where required, replace the ‘###’ with a unique identifier, e.g., your UserID like user001.
39
Step 4. Navigate to the integration
package
“openSAP_btp3_Week4_Exercis
e_xxx” that you created in Task 1
above.
40
Hint: Replace ‘###’ with a unique identifier
e.g., your user id
Name: Northwind
Category_Supplier_Product_Entity
Replication_XXX
Description: Category, Supplier
and Product entity Replication to
Northwind using OData V2 test
service
Press “OK”
41
Step 12. Press and drag the
“Connector” button to connect the
“CI” sender with the “Start” step.
replicate_entities_###
42
Step 16. Select “Content
Modifier” step.
Entry 2:
Name: CustomHeaderValue
Source Type: XPath
Source Value:
/Products/Product/ProductId/text()
Data Type:
java.lang.String
43
Step 19. In order to open the
general Integration Flow
settings, click on a white space in
the IFlow Diagram as shown in the
screenshot.
44
Step 24. Select “Groovy Script”
step.
45
Step 27. Switch to “Referenced
Resources” and select
“MPLCustomHeader”.
Press “OK”.
46
Step 31. Select “Branch 1“and
rename it to Category
47
Step 34. Click the “Add” button to
create a new Number Range
object.
Name: CategoryIDNRO_###
Description: NRO to auto
increment Category ID while
creating the Categories on
Northwind
Minimum Value: 3
Maximum Value: 999
Press “OK”
48
Step 38. Rename the step to:
Set Properties
Entry 2
Name: CategoryName
Source Type: XPath
Source Value:
/Products/Product/CategoryName/t
ext()
DataType:
java.lang.String
Entry 3
Name: EntityName
Source Type: Constant
Source Value: Categories
Entry 4
Name: EntityMappingName
Source Type: Constant
Source Value: ref:MM_Category
49
Step 40. Select the “Set
Properties” flow step and press
the “+” button to add a new flow
step.
Type: Expression
Body:
<?xml version = "1.0" encoding = "UTF-8"
?>
<ProductCategories>
<ProductCategory>
<CategoryID>${property.CategoryID}</Cate
goryID>
<CategoryName>${property.CategoryName
}</CategoryName>
</ProductCategory>
</ProductCategories>
50
Step 44. Add a new “Local
Integration Process” and place it
underneath the main Integration
Process.
51
Step 48. Rename the name to:
Idempotent Category Replication
52
Step 51. Enter the following
properties.
Message ID:
${property.CategoryName}
53
Step 55. Navigate to “Processing”
tab and provide the following
details:
54
Step 59. Click on the “Receiver”,
participant and place it next to the
process and rename it to:
Northwind
Address:
<Northwind URL that you have
obtained in step 2>
Proxy Type: Internet
Authentication: None
CSRF Protected: Uncheck (False)
55
Step 63. Switch to “Processing”
tab and provide the following
properties:
56
Step 67. Switch to “Processing”
tab and provide the following
details:
XPath Expression:
/Products/Product/Supplier/Supplier
Value Type: Node
57
Step 71. Rename the step to:
Set Properties
Entry 2
Name: EntityName
Source Type: Constant
Source Value: Suppliers
Entry 3
Name: EntityMappingName
Source Type: Constant
Source Value: ref:MM_Supplier
58
Step 75. Rename the name to:
Idempotent Supplier Replication
Message ID:
${property.SupplierId}
59
Step 80. Let’s add one last branch
to the sequential multicast for the
product replication. Click on the
“Sequential Multicast 1” step and
press the “+” button.
60
Step 84. Click on the “Content
Modifier” step and rename it to:
Set Properties
Entry 2
Name: EntityName
Source Type: Constant
Source Value: Products
Entry 3
Name: EntityMappingName
Source Type: Constant
Source Value: ref:MM_Product
61
Step 87. Search for “enrich” and
choose “Content Enricher” under
“External Call”
Original Message
Path to Node: Products/Product
Key Element: CategoryName
Lookup Message
Path to Node:
Categories/Category
Key Element: Name
62
Step 90. Select the “Northwind”
receiver participant, press and
drag the “Connector” button to
connect the “Northwind” receiver
to the “Enrich Category ID” step.
Address:
<Northwind URL that you have
obtained in step 2>
Proxy Type: Internet
Authentication: None
CSRF Protected: Uncheck (False)
63
Step 94. Switch to “Processing”
tab and provide the following
properties:
64
Step 99. Choose the Local
Integration Process that you
created before.
65
Step 103. Provide the following
properties:
Version: 1.0.0
Comment: initial version
Press “OK”
66
Task 4: Test your scenario
Note:
In this exercise where required, replace the ‘###’ with a unique identifier, e.g., your UserID like user001.
67
Hint: Replace ‘###’ with a unique identifier
e.g., your user id
68
Step 7. You also need to add
Credentials. Therefore, switch to
the “Auth” or “Authorization” tab
and choose Type as
“Basic Auth”
69
Step 10. Change the Content-Type
to “XML”
<?xml version="1.0"?>
<Product>
<ProductId>HT-
1117</ProductId>
</Product>
70
Step 13. Jump back to the
Monitoring in the Integration Suite.
Select “Monitor” -> “Integrations”
71
Step 16. You should see all three
Integration Flows executed and in
status “Completed”.
Press “Enter”.
Now the messages are filtered
based on the custom header. You
can also see all Customer Headers
of one Message on the details
page.
E.g.,
https://services.odata.org/V2/(S(i
bagny0nu0lgbi3gzvvvto42))/ODa
ta/OData.svc/Products(1117)?$e
xpand=Category,Supplier
72
Note: While replicating the product from
WebShop to Northwind application, we
remove the “HT-” prefix, so whenever you
search the product in Northwind, just search
it without “HT-”
73
Coding Samples
Any software coding or code lines/strings (“Code”) provided in this documentation are only examples and are not intended for use in a production system environment. The Code is only intended to better
explain and visualize the syntax and phrasing rules for certain SAP coding. SAP does not warrant the correctness or completeness of the Code provided herein and SAP shall not be liable for errors or
damages cause by use of the Code, except where such damages were caused by SAP with intent or with gross negligence.
www.sap.com/contactsap
The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/trademark for additional trademark information and notices.