SlideShare a Scribd company logo
[27-02-2021]
[Kochi] MuleSoft Meetup Group
RAML, Dataweave functions.
2
Introductions
● API + RAML Best Practices
● The Power of dataweave
Agenda
3
Organizers
Supriya Pawar
Technical Lead at
Accenture
About the organizer:
 Kochi MuleSoft Meetup Leader.
 7+ Years of Experience in Integrations and API Technologies.
 Certified MuleSoft Developer, Integration Architect and platform Architect.
4
Speakers
Sanjana Mishra
Senior Developer at Accenture
About the Speaker:
 Having 5+ years of overall experience building integration solutions.
 Certified MuleSoft Developer And Platform Architect.
About the Speaker:
 5+ Years of Experience in Integrations and API Technologies.
 Certified MuleSoft Developer, Integration Architect and platform
Architect.
Sumit Ahuja
Senior Developer at Accenture
RAML + API Best Practices
6
What is RAML ? Why we use it ?
Best Practices in RAML ?
● Use Spec Driven Development
● Think about the API
● Modularize and Reuse
● Mocking
● Resources and Naming
● HTTP Codes and Verbs
7
8
Use Spec Driven Development
● Use Design Patterns/ Code Reuse.
● Mock and get User Feedback.
● Make Necessary Changes.
● Start Coding to the Spec and don't deviate.
9
Benefits of Spec Driven
● Parallelize the development process
● Improves understanding of the whole
● Guide Development
10
Think about the API
11
Think of a Long term
● Your API is a Contract
● Versioning is not a Solution
● You can pay a little now , or much more Later.
● You need to think things through
● Mindset is everything
12
Think Things Through
● Who is your API for ?
● What type of API are you building ?
● How are you going to maintain your API ?
● How are you going to document your API ?
● How are you going to lets users interact with your API ?
● How are you going to manage authentication, provisioning and developer security ?
● How are going to protect your servers against attacks etc ?
● How are you going to manage support ?
13
Who Will Be Using Your API?
14
Versioning – A Necessary Evil
● Problems with versioning :
○ Backward Incompatibilities
○ Multiple services to maintain
○ Multiple systems to support
○ Creates Confusion among developers
15
Modularize and Reuse (RAML Inheritance)
● This can be Best achieved using the below two features of RAML :
○ Resource Types
■ ResourceType is basically a template that is used to define the descriptions, methods, and parameters that
can be used by multiple resources without writing the duplicate code or repeating code.
○ Traits
■ Traits is like function and is used to define common attributes for HTTP method (GET, PUT, POST,
PATCH, DELETE, etc) such as whether or not they are filterable, searchable, or pageable.
16
Defining Resource Types
17
Calling resource Types from RAML
18
Declaring Traits
19
Calling Traits from Resource Types and Resources
20
Mocking
● The API mocking service enables you simulate the behavior of an API specification. The
mocking service provides a test link to an API. The mocking service returns the responses
(both HTTP status codes and example payloads) that are defined in your API specification
and is valuable for testing or for simply exploring how your API behaves.
● Simulate a Call to an API using an Internal URL
● Simulate a Call to an API using a Public URL
21
Simulate a Call to an API using an Internal URL
22
Simulate a Call to an API using a Public URL
23
Resources and Naming
● Use of camelCase for placeholders in URL.
● Use nouns in lowercase to represent a resource, for resources with multiple words, use
lowercase for all the words or use '-' (dash) in between the words and make it readable.
● Use of Parameters:
○ URI Parameter
○ Query Parameter
24
Example
25
HTTP Codes
● 1xx : Informational
● 2xx : Success
● 3xx : Redirect
● 4xx : Client error
● 5xx : Server error
26
HTTP verbs
● GET
● PUT
● PATCH
● POST
● DELETE
27
Power of Dataweave
Overview
● DataWeave is the MuleSoft expression language for accessing and transforming data within
mule apps
● Not only limited to data transformation
● Provides module or lambda function creation support
● Supports flow control and Scope Operations
● Provides feasibility for streaming for efficient processing of large documents without
overloading memory
● Datasense or preview mapping to avoid possible errors
29
Data Formats
30
31
● Sample snippet to read a XLS file using DWL vs Java
Read Function
Logging
32
● Use this function to help with debugging DataWeave scripts
33
● Flow control operations such as If else , do , else if can be used
Flow Control and Scope Operations
Lookup Operation
● Enables you to execute a flow from within dataweave and use the payload for further
processing
● In case the flow to be executed has a external connection you can provide a timeout value.
● Note : The lookup function does not support calling subflow
34
35
● The Below example creates the lambda function to check validity by comparing dates
Creating Lambda Functions
Creating Lambda Functions (Using Variable)
36
● The Below example create executes the lambda function and stores in variable
checkValildity.
Using Map Iterator
37
● Use to iterate over array or list of values
Map Object
38
● Use to iterate over key value pairs of objects
Filter
39
● The value inside array can be also referred as $
● To filter an array as per given function
Get Set from Objects
40
41
● The accumulator can be referred as $$
● The value in the array can be referred as $
Reduce
42
● Combine set of subarrays into single array
● It flattens only the first level of subarrays and omits empty subarrays
Flatten
43
● Iterates over an object and returns an array of keys, values, or indices from the object.
● It is an alternative to mapObject which is similar but returns an object, instead of an array.
Pluck
keysOf – Mule 4.3
44
valuesOf – Mule 4.3
45
firstWith – Mule 4.3
46
47
● How to get a Object from Map operator
Quick Hacks
48
● How to dynamically populate a value
Quick Hacks
Introduce yourself to your neighbor
Networking time
Thank you

More Related Content

What's hot (19)

PDF
MuleSoft Surat Virtual Meetup#27 - MuleSoft Runtime 4.4, Transit Gateway and ...
Jitendra Bafna
 
PPTX
Anypoint connector basics
Ramakrishna kapa
 
PPTX
Batch processing
Ramakrishna kapa
 
PDF
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
LINE Corporation
 
PPTX
Selenium-4
Manoj Kumar Kumar
 
PPTX
Kochi Mulesoft Meetup #6
sumitahuja94
 
PPTX
Mumbai MuleSoft Meetup #19 - Anypoint monitoring and MQ Integrations
Akshata Sawant
 
PDF
What’s new in WSO2 Enterprise Integrator 6.6
WSO2
 
PPTX
mulesoft meetup @ bangalore
D.Rajesh Kumar
 
PDF
Reactive programming
Mesut Can Gurle
 
PPTX
10th Manila MuleSoft Meetup Aug 2021
Ryan Anthony Andal
 
PPTX
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Lohika_Odessa_TechTalks
 
PDF
Reactive programming - Observable
Dragos Ionita
 
PDF
Api design best practice
Red Hat
 
PPTX
Enterprise Integration Patterns and Apache Camel
Miloš Zubal
 
PPTX
Flux and React.js
sara stanford
 
PPT
Flux architecture
Badr Zaman [Front End , J2EE ]
 
PDF
Clovaを支える技術 機械学習配信基盤のご紹介
LINE Corporation
 
PDF
Microservices in Go with Go kit
Shiju Varghese
 
MuleSoft Surat Virtual Meetup#27 - MuleSoft Runtime 4.4, Transit Gateway and ...
Jitendra Bafna
 
Anypoint connector basics
Ramakrishna kapa
 
Batch processing
Ramakrishna kapa
 
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
LINE Corporation
 
Selenium-4
Manoj Kumar Kumar
 
Kochi Mulesoft Meetup #6
sumitahuja94
 
Mumbai MuleSoft Meetup #19 - Anypoint monitoring and MQ Integrations
Akshata Sawant
 
What’s new in WSO2 Enterprise Integrator 6.6
WSO2
 
mulesoft meetup @ bangalore
D.Rajesh Kumar
 
Reactive programming
Mesut Can Gurle
 
10th Manila MuleSoft Meetup Aug 2021
Ryan Anthony Andal
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Lohika_Odessa_TechTalks
 
Reactive programming - Observable
Dragos Ionita
 
Api design best practice
Red Hat
 
Enterprise Integration Patterns and Apache Camel
Miloš Zubal
 
Flux and React.js
sara stanford
 
Clovaを支える技術 機械学習配信基盤のご紹介
LINE Corporation
 
Microservices in Go with Go kit
Shiju Varghese
 

Similar to Mule soft meetup__official__feb-27_2021 (20)

PPTX
Mumbai MuleSoft Meetup #15
Akshata Sawant
 
PPTX
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
Jitendra Bafna
 
PDF
MuleSoft Manchester Meetup #3 slides 31st March 2020
Ieva Navickaite
 
PDF
Mulesoft Online Training.pdf
SpiritsoftsTraining
 
PPTX
The ins and outs of RAML
MuleSoft Meetups
 
PPTX
MuleSoft Meetup 3 Charlotte Presentation Slides
Subhash Patel
 
PPTX
West Yorkshire Mulesoft Meetup #6
Francis Edwards
 
PPTX
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
Manish Kumar Yadav
 
PDF
Second meetup slidess
Alan Muñoz Ochoa
 
PDF
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Jitendra Bafna
 
PDF
Faridabad MuleSoft Meetup Group (1).pdf
RohitSingh585124
 
PPTX
Manila MuleSoft Meetup #4 January 2019
Christopher Co
 
PDF
Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modelin...
Jitendra Bafna
 
PPTX
Mule soft RAML API Designing
Raja Reddy
 
PPTX
Mule soft meetup_charlotte_4__draft_v2.0
Subhash Patel
 
PPTX
MuleSoft London Community - API Marketing, Culture Change and Tooling
Pace Integration
 
PDF
ApiAddicts Meetup Sept 2016, Madrid
Christian Heidenreich
 
PPTX
Managing api development
Ciprian Sorlea CSM-CSPO
 
PDF
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
PPTX
Faridabad Mulesoft Meetup Oct 10
Amit Singh
 
Mumbai MuleSoft Meetup #15
Akshata Sawant
 
MuleSoft Surat Virtual Meetup#9 - RAML Reusability and Simplified
Jitendra Bafna
 
MuleSoft Manchester Meetup #3 slides 31st March 2020
Ieva Navickaite
 
Mulesoft Online Training.pdf
SpiritsoftsTraining
 
The ins and outs of RAML
MuleSoft Meetups
 
MuleSoft Meetup 3 Charlotte Presentation Slides
Subhash Patel
 
West Yorkshire Mulesoft Meetup #6
Francis Edwards
 
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
Manish Kumar Yadav
 
Second meetup slidess
Alan Muñoz Ochoa
 
Engineering Student MuleSoft Meetup#6 - Basic Understanding of DataWeave With...
Jitendra Bafna
 
Faridabad MuleSoft Meetup Group (1).pdf
RohitSingh585124
 
Manila MuleSoft Meetup #4 January 2019
Christopher Co
 
Engineering Student MuleSoft Meetup#2 - API Design Using Restful API Modelin...
Jitendra Bafna
 
Mule soft RAML API Designing
Raja Reddy
 
Mule soft meetup_charlotte_4__draft_v2.0
Subhash Patel
 
MuleSoft London Community - API Marketing, Culture Change and Tooling
Pace Integration
 
ApiAddicts Meetup Sept 2016, Madrid
Christian Heidenreich
 
Managing api development
Ciprian Sorlea CSM-CSPO
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
Faridabad Mulesoft Meetup Oct 10
Amit Singh
 
Ad

More from sumitahuja94 (7)

PPTX
Connect systems without code using MuleSoft Composer - General.pptx
sumitahuja94
 
PDF
MuleSoft RPA Automation as APIs.pdf
sumitahuja94
 
PPTX
Kochi Mulesoft Meetup #11 - Runtime Fabric on Google Kubernetes Engine (GKE)
sumitahuja94
 
PPTX
Kochi Mulesoft Meetup #10 - MuleSoft Composer: Connect apps and data easily w...
sumitahuja94
 
PPTX
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
sumitahuja94
 
PPTX
MuleSoft Kochi Meetup #3– Integration with Web Sockets
sumitahuja94
 
PPTX
Kochi mulesoft meetup 02
sumitahuja94
 
Connect systems without code using MuleSoft Composer - General.pptx
sumitahuja94
 
MuleSoft RPA Automation as APIs.pdf
sumitahuja94
 
Kochi Mulesoft Meetup #11 - Runtime Fabric on Google Kubernetes Engine (GKE)
sumitahuja94
 
Kochi Mulesoft Meetup #10 - MuleSoft Composer: Connect apps and data easily w...
sumitahuja94
 
MuleSoft Kochi Meetup #5– Handling Mule Exceptions
sumitahuja94
 
MuleSoft Kochi Meetup #3– Integration with Web Sockets
sumitahuja94
 
Kochi mulesoft meetup 02
sumitahuja94
 
Ad

Recently uploaded (20)

PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 

Mule soft meetup__official__feb-27_2021

  • 1. [27-02-2021] [Kochi] MuleSoft Meetup Group RAML, Dataweave functions.
  • 2. 2 Introductions ● API + RAML Best Practices ● The Power of dataweave Agenda
  • 3. 3 Organizers Supriya Pawar Technical Lead at Accenture About the organizer:  Kochi MuleSoft Meetup Leader.  7+ Years of Experience in Integrations and API Technologies.  Certified MuleSoft Developer, Integration Architect and platform Architect.
  • 4. 4 Speakers Sanjana Mishra Senior Developer at Accenture About the Speaker:  Having 5+ years of overall experience building integration solutions.  Certified MuleSoft Developer And Platform Architect. About the Speaker:  5+ Years of Experience in Integrations and API Technologies.  Certified MuleSoft Developer, Integration Architect and platform Architect. Sumit Ahuja Senior Developer at Accenture
  • 5. RAML + API Best Practices
  • 6. 6 What is RAML ? Why we use it ?
  • 7. Best Practices in RAML ? ● Use Spec Driven Development ● Think about the API ● Modularize and Reuse ● Mocking ● Resources and Naming ● HTTP Codes and Verbs 7
  • 8. 8
  • 9. Use Spec Driven Development ● Use Design Patterns/ Code Reuse. ● Mock and get User Feedback. ● Make Necessary Changes. ● Start Coding to the Spec and don't deviate. 9
  • 10. Benefits of Spec Driven ● Parallelize the development process ● Improves understanding of the whole ● Guide Development 10
  • 11. Think about the API 11
  • 12. Think of a Long term ● Your API is a Contract ● Versioning is not a Solution ● You can pay a little now , or much more Later. ● You need to think things through ● Mindset is everything 12
  • 13. Think Things Through ● Who is your API for ? ● What type of API are you building ? ● How are you going to maintain your API ? ● How are you going to document your API ? ● How are you going to lets users interact with your API ? ● How are you going to manage authentication, provisioning and developer security ? ● How are going to protect your servers against attacks etc ? ● How are you going to manage support ? 13
  • 14. Who Will Be Using Your API? 14
  • 15. Versioning – A Necessary Evil ● Problems with versioning : ○ Backward Incompatibilities ○ Multiple services to maintain ○ Multiple systems to support ○ Creates Confusion among developers 15
  • 16. Modularize and Reuse (RAML Inheritance) ● This can be Best achieved using the below two features of RAML : ○ Resource Types ■ ResourceType is basically a template that is used to define the descriptions, methods, and parameters that can be used by multiple resources without writing the duplicate code or repeating code. ○ Traits ■ Traits is like function and is used to define common attributes for HTTP method (GET, PUT, POST, PATCH, DELETE, etc) such as whether or not they are filterable, searchable, or pageable. 16
  • 18. Calling resource Types from RAML 18
  • 20. Calling Traits from Resource Types and Resources 20
  • 21. Mocking ● The API mocking service enables you simulate the behavior of an API specification. The mocking service provides a test link to an API. The mocking service returns the responses (both HTTP status codes and example payloads) that are defined in your API specification and is valuable for testing or for simply exploring how your API behaves. ● Simulate a Call to an API using an Internal URL ● Simulate a Call to an API using a Public URL 21
  • 22. Simulate a Call to an API using an Internal URL 22
  • 23. Simulate a Call to an API using a Public URL 23
  • 24. Resources and Naming ● Use of camelCase for placeholders in URL. ● Use nouns in lowercase to represent a resource, for resources with multiple words, use lowercase for all the words or use '-' (dash) in between the words and make it readable. ● Use of Parameters: ○ URI Parameter ○ Query Parameter 24
  • 26. HTTP Codes ● 1xx : Informational ● 2xx : Success ● 3xx : Redirect ● 4xx : Client error ● 5xx : Server error 26
  • 27. HTTP verbs ● GET ● PUT ● PATCH ● POST ● DELETE 27
  • 29. Overview ● DataWeave is the MuleSoft expression language for accessing and transforming data within mule apps ● Not only limited to data transformation ● Provides module or lambda function creation support ● Supports flow control and Scope Operations ● Provides feasibility for streaming for efficient processing of large documents without overloading memory ● Datasense or preview mapping to avoid possible errors 29
  • 31. 31 ● Sample snippet to read a XLS file using DWL vs Java Read Function
  • 32. Logging 32 ● Use this function to help with debugging DataWeave scripts
  • 33. 33 ● Flow control operations such as If else , do , else if can be used Flow Control and Scope Operations
  • 34. Lookup Operation ● Enables you to execute a flow from within dataweave and use the payload for further processing ● In case the flow to be executed has a external connection you can provide a timeout value. ● Note : The lookup function does not support calling subflow 34
  • 35. 35 ● The Below example creates the lambda function to check validity by comparing dates Creating Lambda Functions
  • 36. Creating Lambda Functions (Using Variable) 36 ● The Below example create executes the lambda function and stores in variable checkValildity.
  • 37. Using Map Iterator 37 ● Use to iterate over array or list of values
  • 38. Map Object 38 ● Use to iterate over key value pairs of objects
  • 39. Filter 39 ● The value inside array can be also referred as $ ● To filter an array as per given function
  • 40. Get Set from Objects 40
  • 41. 41 ● The accumulator can be referred as $$ ● The value in the array can be referred as $ Reduce
  • 42. 42 ● Combine set of subarrays into single array ● It flattens only the first level of subarrays and omits empty subarrays Flatten
  • 43. 43 ● Iterates over an object and returns an array of keys, values, or indices from the object. ● It is an alternative to mapObject which is similar but returns an object, instead of an array. Pluck
  • 44. keysOf – Mule 4.3 44
  • 47. 47 ● How to get a Object from Map operator Quick Hacks
  • 48. 48 ● How to dynamically populate a value Quick Hacks
  • 49. Introduce yourself to your neighbor Networking time