Más contenido relacionado La actualidad más candente (20) Similar a Melbourne Virtual MuleSoft Meetup November 2020 (20) Melbourne Virtual MuleSoft Meetup November 20202. 2
Use the chat function to ask questions and comment.
We will use Kahoot for our trivia later in the meetup.
Welcome to the Meetup
3. 3
Meet your local Meetup leaders
Join the group at meetups.mulesoft.com/melbourne
to be notified of all future events
Daniel Soffner
MuleSoft
Strategic Technical Architect
"Mo Bro"
Adam Bond
MuleSoft
Lead Solution Engineer
5. 5
Your Agenda for today
★ Welcome and Updates (Daniel Soffner)
★ What's New in Anypoint API Community Manager (Adam Bond)
★ Salesforce Connect & ODATA APIs using MuleSoft (Neha Das)
★ Trivia and Giveaways (All)
7. 7
Friends of Max
● Bite Sized
● Topic list includes:
○ Introduction to
Batch Processing
○ Anypoint Service
Mesh
○ API Manager
Overview
○ The Importance of
CICD
8. 8
MuleSoft Troubleshooting Workshop
Free!
This troubleshooting workshop is for those who want to improve their troubleshooting skills in
order to resolve problems faster and build more robust MuleSoft applications.
Duration: 2 hours 15 mins
Objectives
At the end of this workshop, participants should be able to:
● Better understand the support process and organisation
● Understand the role of the customer and support team
in troubleshooting
● Appreciate the tactics and mechanisms used to identify
and resolve a problem
● Learn how to use tools to extract information that aid
troubleshooting
● Learn what tools are used in the analysis and resolution
process
https://register.gotowebinar.com/rt/4692044236771900174
9. JAPAC Season of
Success series
MuleSoft Training’s Season of Success is here! This offer
includes new flexible instructor-led course formats and a
special edition t-shirt to everyone who achieves their MuleSoft
certification*
What’s included:
● A new flexible schedule of instructor-led courses
● Quizzes and swag giveaways*
● Special edition t-shirt when you pass your certification
See schedule: https://sfdc.co/season-of-success
* Countries eligible for swag shipment are Australia, New Zealand, Singapore, Japan, Hong Kong, Malaysia,
Thailand, Philippines, Indonesia, and Vietnam.
Terms and conditions apply
11. 11
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: meetups.mulesoft.com/melbourne
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve
the program
What’s next?
14. Engage an ecosystem of
developers and partners
● Start from preconfigured
templates to quickly drive API
product adoption
● Personalize experiences with
clicks not code
● Engage consumers through
forums, chat and case
management
● Track API program KPIs in
real-time
API Community Manager
15. API Groups
Discover API groups:
● Search packaged API groups for
easier consumption
● Request API Group access
● Showcase API Groups in API
Communities
Manage API Groups
● Customize T&C
● Generate single API group
credentials
● Monitor and analyze API Group
performance
Govern API Groups:
● Define and manage API Group SLAs
● Visualize API Group dependencies
Improve API packaging to drive adoption
Available
NOW
16. Extended search in API Communities
Simple and unified discovery
● Single search interface for consumer
developers
● Results include matching CMS
content, articles and cases, in
addition to APIs, API Groups and
Client Applications
Improve developer experience
Available
NOW
17. Version-based API publishing and navigation
Upcoming release
Simplifies publication of APIs as
a single unit and allows fine-grain
control on versions visibility for
consumers
Use cases
➔ Discover and navigate API
as a unit, rather than
individual versions as
before
18. Automated installer and diagnostics
Simplifies setup, and upgrades of
the ACM package, and enables
diagnosing and resolving
configuration issues
automatically
Use cases
➔ Configure ACM salesforce
org and connect it to
Anypoint
Upcoming release
19. NTO Marketing Anypoint
Master Org
NTO Logistics Anypoint
Master Org
NTO Digital Anypoint
Master Org
Cross-org API community
Single community for multiple Anypoint Platform orgs
Expected in H1, 2021
Expand reuse and discovery
across organisational
boundaries
● Publish APIs from
multiple orgs into a single
community;
● Manage and scale your
API consumer ecosystem
from a single location;
● Remove dependencies on
central teams in exposing
APIs to consumers.
21. All contents © MuleSoft, LLC
Salesforce
Connect & ODATA
APIs using
MuleSoft
Neha Das
Senior Architect, MuleSoft Professional Services
MuleSoft Melbourne Meetup
– Nov 2020
22. All contents © MuleSoft, LLC
Salesforce Connect & ODATA APIs using MuleSoft
What is ODATA API? ODATA Support in
Mule 4
Salesforce Connect in
Action
What we will cover in this session?
Demo and Q&A
24. All contents © MuleSoft, LLC
What is ODATA?
OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a
set of best practices for building and consuming RESTful APIs. OData helps you focus
on your business logic while building RESTful APIs without having to worry about the
various approaches to define request and response headers, status codes, HTTP
methods, URL conventions, media types, payload formats, query options, etc. OData
also provides guidance for tracking changes, defining functions/actions for reusable
procedures, and sending asynchronous/batch requests.
OData RESTful APIs are easy to consume. The OData metadata, a machine-readable
description of the data model of the APIs, enables the creation of powerful generic
client proxies and tools. #
# https://www.odata.org
25. All contents © MuleSoft, LLC
In simple words…
● Open Data Protocol (OData) is an open protocol to allow the creation and
consumption of queryable and interoperable RESTful APIs in a simple and
standard way.
● It defines an abstract data model (EDM) and a protocol (based on REST) that
let any client access information exposed by any data source.
● It defines a set of standardised URL Conventions and query options
● normally provided by specific vendors as a layer on top of their Databases;
e.g SAP and Microsoft.
● Consuming OData-enabled HTTP services is easy and it provides a quick and
easy way to query multiple levels of information
● Developing OData services on the other hand, requires a more deep analysis:
○ The OData services should allow filtering, ordering and selecting by all available
properties (plus expansion on multiple objects, e.g Order -> Order Details -> Line
Item -> Line Item Detail -> etc)
26. All contents © MuleSoft, LLC
Entity Data Model and Service Model
Understanding the anatomy of an ODATA Service
27. All contents © MuleSoft, LLC
The metadata of an OData message can be summarized as below;
Anatomy of an ODATA API - EDM
● contain the definition of Entity Sets and the
associations.
○ Entity set -> collection of Entity Type.
○ Entity type -> data type that contains details of a
specific type of data ex. Customer, Supplier, Sales
Order, Employee etc.
○ Entity key -> uniquely identifier on an entity type.
Ex. Employee number, Sales Order number, Product
ID etc
○ Association -> relationship between two or more
entity types. Ex. Products to its Manufacturer
○ A navigation property -> property set on an entity
type to understand the associations of the entity
type.
Please note:
1. Mule ODATA Plugin does not support Associations
and Navigation Property
2. Mule ODATA Plugin only supports OData2.0
28. All contents © MuleSoft, LLC
Accessing the Service Document Accessing the Metadata
Understanding the ODATA API
● Service Root URI
● Example:
https://services.odata.org/OData/OData.svc/
● Suffix to the Service Root URI : $metadata
● Example:
http://services.odata.org/OData/OData.svc/$
metadata
29. All contents © MuleSoft, LLC
Accessing the Service Accessing the Metadata
Understanding the ODATA API
● Service Root URI
● Example:
https://services.odata.org/OData/OData.svc/
● Suffix to the Service Root URI : $metadata
● Example:
http://services.odata.org/OData/OData.svc/$
metadata
30. All contents © MuleSoft, LLC
Accessing an Entity Set Accessing a particular entity
in an entity set
Understanding the ODATA API
● Example:
http://services.odata.org/OData/OData.svc/C
ategories
● Suffix ?$format=json to get json format
● Example:
http://services.odata.org/OData/OData.svc/C
ategories(1)
31. All contents © MuleSoft, LLC
Understanding the ODATA API
Query Description Example
$format By default, data returned is in an XML feed. This query allows us to change the format of data.
Example: Return all the suppliers returned by the service in JSON format instead of XML.
http://services.odata.org/OData/OData.svc/Su
ppliers?$format=json
$top This query option helps to limit the data returned by the service.
Example: return only the 1st Category instead of all the Categories.
http://services.odata.org/OData/OData.svc/Cat
egories?$top=1
$skip Opposite of $top. The skip queries can be used to skip records.
Example: skip the first 2 records in the Products set and return the rest of products. Hence on the
execution of the given query, Products with ID as 0 and 1 gets skipped.
http://services.odata.org/OData/OData.svc/Pro
ducts?$skip=2
$inlinecount Total number of records as part of the response payload. Extract the number from the field
<count></count>
Example: in the payload you will find that in the field <count>, the value is returned as 2, meaning there are
total 2 Suppliers as part of the service.
http://services.odata.org/OData/OData.svc/Su
ppliers?$inlinecount=allpages
$orderby Sort the records returned by the service.
Example: Sort the Product entity set by the price of each product in ascending order. Here Price is a field
returned as part of the Product set. Suffix desc to return the records in the descending order.
http://services.odata.org/OData/OData.svc/Pro
ducts?$orderby=Price
http://services.odata.org/OData/OData.svc/Pro
ducts?$orderby=Price desc
$expand return all the products along with their Category, use the URL provided in the example. http://services.odata.org/OData/OData.svc/Cat
egories?$expand=Products
$filter Similar to the ‘where’ query in SQL.
Example: get all the products with rating greater than 3
Note: that we can use both Logical and Arithmetic operators. There are also various functions like
substring etc that is supported. Please refer this link for the extensive list that you can use.
http://services.odata.org/OData/OData.svc/Pro
ducts?$filter=Rating gt 3
$select As in any SQL query, this query option can be used to Select specific or all fields of an Entity set or entity.
Example: Return the fields rating and Price of a Product with ID = 3
http://services.odata.org/OData/OData.svc/Pro
ducts(3)?$select=Rating,Price
● Understanding Query Options*
*OData 2.0
33. All contents © MuleSoft, LLC
Creating an OData-Enabled API
● The APIkit OData Extension supports OData (Open Data Protocol) Version 2 for creating HTTP-based
data services. Through these services, you can query the data sources using HTTP.
● The APIkit OData Extension builds the services from the entity data model (EDM), which OData
services use to formalize their resource descriptions. You write the EDM in RAML using EDM-
compatible data types to represent API entities.
● The APIkit OData Extension generates Mule flows to handle OData requests. After configuring a data
source and adding endpoints to the flows, deploying the app exposes an OData API accessible
through different URLs.
● You can use the APIkit OData Extension to expose a legacy API as an OData API, orchestrate data
before exposing it in Salesforce, or create a bidirectional OData API for Oracle, DB2, or Azure DB, for
example.
34. All contents © MuleSoft, LLC
Implement the FlowsUse the APIKit OData
Extension to generate
the necessary API Specs
(RAML) and API Flows,
with the ODATA EDM as
an input
Draft the ODATA EDM
and place that in
resources/api directory
of the Mule Project
ODATA Implementation Workflow
Install the APIKit OData
Extension in Anypoint
Studio
35. All contents © MuleSoft, LLC
Annotations EDM Data Types
APIkit OData Extension Reference
● odata.key
Defines whether a field is a key or not.
● odata.nullable
Defines whether a field is a nullable or not.
● odata.precision
Specifies the precision of a field. Only valid for date and numeric types.
● odata.scale
Specifies the precision of a field. Only valid for numeric types.
● odata.remote
The name of the Entity in the remote data source.
● odata.type
This is use to specify some OData types that are not present in RAML (Guid,
Time and DateTimeOffset).
● Edm.String <-> type: string
● Edm.Boolean <-> type: boolean
● Edm.Double <-> type: number
● Edm.Single <-> type: number, format: float
● Edm.Binary <-> type: file
● Edm.DateTime <-> type: datetime-only
● Edm.Int32 <-> type: integer
● Edm.Int64 <-> type: integer, format: int64
● Edm.Int16 <-> type: integer, format: int16
● Edm.Byte <-> type: integer, format: int8
● Edm.Decimal <-> type: number, (odata.precision): 3,
(odata.scale): 3
● Edm.Guid <-> type: string , (odata.type): guid
● Edm.Time <-> type: time-only
● Edm.DateTimeOffset <-> type: datetime
37. All contents © MuleSoft, LLC
Implementing the flows - APIkit OData Service variables
● vars.odata.fields
fields of your entity in a list of strings (List<String>)
● vars.odata.keyNames
contains the keys of your entity
● vars.odata.remoteEntityName
contains the table name
● vars. inlineCount
Variablename to be used to set to return the total no. of
records to meet the query option $inlinecount
38. All contents © MuleSoft, LLC
ODATA Implementation Concerns
● Creating OData from scratch involves a lot of effort in order to cover all the expected functionalities
specified by the protocol (as an analogy, OData is like SQL as a service). The feasibility of the
implementation depends on the capabilities available in backend systems:
○ SQL-based Databases: Good fit
○ Any vendor (e.g SAP, Microsoft) providing this as an out of the box capability on top of their Databases:
Good fit
○ SOAP services: Not a good fit
● Please note that the below capabilities are not supported OOTB by the ODATA Extension:
○ ODATA 4.0 Standard
○ Association and Navigation Properties – so as a result cannot support expansion on multiple objects
○ $expand option – support available in RAML but ineffective due to no support for Associations and
NavigationProperties
40. All contents © MuleSoft, LLC
Salesforce Connect
• Salesforce Connect is a framework that enables you to view, search, and modify
data that’s stored outside your Salesforce org. For example, perhaps you have data
that’s stored on premises in an enterprise resource planning (ERP) system. Instead
of copying the data into your org, you can use external objects to access the data in
real time via web service callouts.
• No data physically stored in Salesforce but queried in real-time.
• Provides a live connection to external data rather than a copy that consumes
storage and must be regularly synced (alternate to traditional ETL approach).
• External objects are similar to custom objects, except that they map to data
located outside your Salesforce org. External object data is always up to
date. Accessing an external object fetches the data from the external system in real
time.
41. All contents © MuleSoft, LLC
When to use Salesforce Connect?
• You have a large amount of data that you don’t want to copy into your Salesforce
org.
• You need small amounts of data at any one time.
• You need real-time access to the latest data.
• You store your data in the cloud or in a back-office system, but want to display or
process that data in your Salesforce org.
• You do not have to set up triggers and workflows for getting external data
• Unable to store data into Salesforce platform to meet local compliance and
regulatory needs ( data residency etc. )
43. All contents © MuleSoft, LLC
Salesforce Connect – Types of External Connections
Connects to data exposed by any OData
2.0 producer on the Internet. OData (Open
Data Protocol) is a modern, REST-based
protocol for integrating data. Vendors
such as SAP and Microsoft have
already implemented OData support, so
products such as NetWeaver and
SharePoint are directly accessible.
Integration products from Salesforce
partners extend the reach of Salesforce
Connect to a much wider range of back-
office systems.
Connects to data that’s stored in
another Salesforce org. The
Cross-org adapter uses the
standard Lightning Platform
REST API. It directly connects to
the other org without the need of
an intermediary web service, as
is the case with OData.
OData 2.0 adapter
Cross-org adapter
Connects to data exposed by any OData 4.0
producer on the Internet. OData (Open Data
Protocol) is a modern, REST-based protocol
for integrating data. Vendors such as SAP
and Microsoft have already implemented
OData support, so products such as
NetWeaver and SharePoint are directly
accessible. Integration products from
Salesforce partners extend the reach of
Salesforce Connect to a much wider range of
back-office systems.
If the OData and cross-org
adapters aren’t suitable for your
needs, develop your own
adapter with the Apex
Connector Framework.
OData 4.0 adapter
Custom adapter
(APEX)
44. All contents © MuleSoft, LLC
Salesforce Connect – ODATA API Considerations & API Limits
• Salesforce Connect supports only the
following OData system query
options. All other options in the
OData 2.0 and 4.0 specifications are
unused.
– $count (OData 4.0 only)
– $filter
– $inlinecount (OData 2.0 only)
– $orderby
– $search (OData 4.0 only)
– $select
– $skip
– $top
– OData 2.0 Custom Query Option
• An org is limited to:
– 20,000 OData callouts per hour for
Enterprise, Performance, and
Unlimited editions. Higher limits are
available on request.
– 1,000 OData callouts per hour for
Developer Edition.
• More Details Refer –
– https://help.salesforce.com/articleVie
w?id=platform_connect_consideratio
ns_query_rate_limits.htm&type=5
Important note on ODATA Key Fields :
An external lookup relationship links a child standard, custom, or external object to a parent
external object.
The values of the standard External ID field on the parent external object are matched against
the values of the external lookup relationship field. For a child external object, the values of the
external lookup relationship field come from the specified External Column Name.
Each External ID value of an External Object is derived according to the entity key that’s defined in the
OData service metadata document of the remote data service (OData producer). The entity key is formed
from a subset of the entity type’s properties.
45. All contents © MuleSoft, LLC
View
Set up a custom tab to view the data.
Sync
Syncing creates the external objects
corresponding to the tables that you
selected. Manual creation possible but sync
is recommended.
Salesforce Connect Workflow (Simplified)
Set up
External Data Source
(ODATA API Service Root URI is
configured)
Click “Validate & Sync” to select the
required tables (autodiscovered) and hit
”Sync”
47. All contents © MuleSoft, LLC
References
• https://www.mydbsync.com/blogs/odata-and-rest-apis-a-comparison/
• https://blogs.sap.com/2013/10/03/lets-talk-odata-shall-we/
• https://docs.mulesoft.com/apikit/4.x/creating-an-odata-api-with-apikit
• https://docs.mulesoft.com/apikit/4.x/implement-endpoints-odata-task
• https://docs.mulesoft.com/apikit/4.x/apikit-odata-extension-reference
• https://docs.google.com/document/d/1fvA6YoJiKlVaogS3Y8i7-hAB5Fe-P5dmZUyBIi4tMtg/edit#
• https://docs.google.com/document/d/1PhjtrtB2-GPpe4du5in8kfrxrqBObZ4Limirr4H7bBs/edit#
• https://blogs.mulesoft.com/dev/tech-ramblings/odata-for-pragmatics/
• https://trailhead.salesforce.com/en/content/learn/modules/lightning_connect
• https://help.salesforce.com/articleView?id=odata_query_string_options.htm&type=5
• https://help.salesforce.com/articleView?id=platform_connect_considerations_query_rate_limits.htm&type=5
• https://help.salesforce.com/articleView?id=odata_external_id_entity_key.htm&type=5
48. All contents © MuleSoft, LLC
Thank you!
Neha Das
Sr. Architect , MuleSoft Professional Services
49. Trivia
There are prizes to be won
Open kahoot.it on your mobile phone browser
Login with the Game PIN we will give you in a minute
Use your real name to win prizes