Session 7 Assignment Page 1 of 4
Session 7 :
Nov 20th - 2020:
Task for the day:
Note: Try to use all components as much as possible like logger, set
variable, setpayload,choice, scatter-gather,http-reques,transform
message,private/sub flows, flow-ref wherever needed. You can use your
mind to accommodate all these components if required
Create a RESTful Application which has 2 resources
/insertAccountDetails
/insertEverywhere
For :
/insertAccountDetails:
Step1 : Create RAML .
/insertAccountDetails
It should be a POST method
queryParams : system
Enum values only . “AWS,SALESFORCE,FILE” see how to define enum
values
Body : application/json
{
"Name" : "MuleSoftTechzone",
"Phone" : "11111111",
"BillingCity" :"hyderabad"
All are Strings and Mandatory
Sample Response:
{
“message” : “records inserted”,
“destination” : “Salesforce/AWS/File”
}
Session 7 Assignment Page 2 of 4
Step2 : Import Project into Anypoint Studio and implement logic.:
A) Whenever user hits the url,
[Link]
With body
{
"Name" : "MuleSoftTechzone",
"Phone" : "11111111",
"BillingCity" :"hyderabad"
}
It should create a file in Amazon s3 bucket (create your own bucket).
File name should be the name passed in [Link] of file is json
eg: [Link]
Share the screenshot showing the file inserted in AWS s3
B) Whenever user hits the url,
[Link]
With body
{
"Name" : "MuleSoftTechzone",
"Phone" : "11111111",
"BillingCity" :"hyderabad"
}
It should create an account in Salesforce . Share screenshot of that
C) Whenever user hits the url,
[Link]
With body
{
"Name" : "MuleSoftTechzone",
"Phone" : "11111111",
"BillingCity" :"hyderabad"
}
Session 7 Assignment Page 3 of 4
It should create csv file in Local disk (any folder is fine) . Hint: use
application/csv in transform message.
File name should be the name passed in [Link] of file is csv
eg: [Link]
Note : details should not be hardcoded. Everything should be in
property file
For :
/insertEverywhere:
RAML : simple just add resource name
GET method. No request.
Response :
{
Message : “inserted details in all systems”
}
The data must be picked up from the FILE which is already stored in
your local folder.
The file should be [Link] and content is below:
{
"Name" : "MuleSoftTechzone",
"Phone" : "11111111",
"BillingCity" :"hyderabad"
You have to READ the file from local folder.
And you have to insert details in salesforce , upload to aws s3,
Basically it’s combined work of above resource .
Use scatter gather to do it.
Share screenshot of that
Note : use property file for configuration details, add loggers wherever
needed.
Session 7 Assignment Page 4 of 4
SUBMIT ASSIGNMENTS WITH SCREENSHOTS
Apart from Above scenario: If you have installed Database on your local,
please do Handson if possible