Hey guys !
In this Post I am going through the For Each functionality in OSB 12c.
Use Case
Simple Integration Scenarios, Where Source system payload has Repeated Nodes, Target System expects one node at a time.
Design
Step 1 :
Create a OSB Project, Add a Pipeline. Inside Pipeline Add a For Each Action.
Step 2:
Provide the required data in For Each Properties. Shown below
This is all we need to Implement For Each.
However we will have to further process the Data, This could depend on your Requirement.
For the Demo Purpose, I am Sending this data to a Business Service using Publish Action.
Step 3:
Add a Publish Action inside For Each. Add a Assign action to see the Payload of the For Each iteration in Testing. Screens Below
Step 4:
Export and Deploy your code to Server.
Testing
Request Payload
<?xml version="1.0" encoding="UTF-8"?>
<Envelope>
<Message>
<MessageID>1</MessageID>
<OrderReport>
<OrderID>102-4552-913811</OrderID>
<Item>
<OrderItemCode>09588730573218</OrderItemCode>
<SKU>05988-2066</SKU>
</Item>
</OrderReport>
</Message>
<Message>
<MessageID>2</MessageID>
<OrderReport>
<OrderID>102-4556812-97811</OrderID>
<Item>
<OrderItemCode>09588730573218</OrderItemCode>
<SKU>05988-20166</SKU>
</Item>
</OrderReport>
</Message>
<Message>
<MessageID>3</MessageID>
<OrderReport>
<OrderID>102-4556812-91371</OrderID>
<Item>
<OrderItemCode>09588730573218</OrderItemCode>
<SKU>05988-266</SKU>
</Item>
</OrderReport>
</Message>
</Envelope>
For Each output for Last Iteration
<Message> |
<MessageID>3</MessageID> |
<OrderReport> |
<OrderID>102-4556812-91371</OrderID> |
<Item> |
<OrderItemCode>09588730573218</OrderItemCode> |
<SKU>05988-266</SKU> |
</Item> |
</OrderReport> |
</Message> |
Thats All Folks !
Here are some other posts, which may interests you
1. Fusion Middleware 12c – SAP Adapter Configuration
http://osb-dheeraj.blogspot.in/2016/02/fusion-middleware-12c-sap-adapter.html
2. Oracle Integration Cloud Service (ICS)
http://osb-dheeraj.blogspot.in/2016/02/oracle-integration-cloud-service-ics.html
3. SOA Interview Questions : Service Oriented Architecture Interview Questions Part 1
http://osb-dheeraj.blogspot.in/2016/02/soa-interview-questions-service.html
http://osb-dheeraj.blogspot.in/2016/02/osb-12c-domain-value-map-dvm.html