BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
2 / 81 · Module 1 — MuleSoft Mental Model · filtered: interview← prev⊞ allnext →

1.12A realistic integration

Suppose your application receives:

POST /customers

with:

{
  "customerId": "C92834",
  "name": "Acme Corporation",
  "email": "info@acme.com"
}

The Mule implementation could be:

HTTP Listener
      ↓
Validate request
      ↓
Set Variable
vars.originalCustomer
      ↓
Transform Message
      ↓
Salesforce Upsert Account
      ↓
Transform Message
      ↓
HTTP 201

DataWeave prepares:

{
  "External_Customer_ID__c": "C92834",
  "Name": "Acme Corporation"
}

And Salesforce might return:

{
  "id": "0018X000012345",
  "success": true
}

Then Mule transforms that into your public API contract:

{
  "customerId": "C92834",
  "salesforceId": "0018X000012345",
  "status": "created"
}

Notice something architecturally important:

The consumer shouldn't necessarily know what Salesforce's response looks like.

Mule provides an abstraction boundary.