Thursday, August 14, 2025

More Examples: Assign vs Stitch in OIC Gen3

๐Ÿ“˜ More Examples: Assign vs Stitch in OIC Gen3

๐Ÿงช Example 1: Set Boolean Flag (Assign)

Scenario: Based on a condition, set a flag to true or false.

isEligible = true

Why Assign? Simple scalar assignment.

๐Ÿงช Example 2: Combine Strings (Assign)

Scenario: Generate a unique ID for a transaction.

transactionId = "TXN-" + currentDate + "-" + customerId

Why Assign? String operations with known variables.

๐Ÿงช Example 3: Set a Variable from an Expression (Assign)

Scenario: Calculate tax based on amount.

taxAmount = totalAmount * 0.18

Why Assign? Mathematical expression with constants and variables.


๐Ÿชข Example 4: Append Dynamic Payloads to a List (Stitch)

Scenario: While processing each record from an input array, append valid records to a result list.

validRecords.append(currentRecord)

Why Stitch? You’re dynamically building an array over iterations.

๐Ÿชข Example 5: Merge Customer Profile Data (Stitch)

Scenario: You get partial customer data from two different sources and want to stitch them into one object.


customerProfile.name = source1.name
customerProfile.email = source2.email
customerProfile.address = source1.address
  

Why Stitch? Updating only specific fields inside a nested object.

๐Ÿชข Example 6: Update an Element in a Nested List (Stitch)

Scenario: Change the quantity of the third item in the order list.

orderList[2].quantity = 5

Why Stitch? You're modifying an element deep within a data structure without affecting others.


๐Ÿ“Š Summary Comparison

Use Case Assign Stitch
Set default values
Append item to array
Set calculated value
Update nested field
Build composite object

No comments:

Post a Comment

AI IN OIC

Leveraging Artificial Intelligence in Oracle Integration Cloud (OIC) Oracle Integration Cloud (OIC) is a comprehensive platform that ena...