0% found this document useful (0 votes)
88 views4 pages

Session 7 Assignment

Related mulesoft scopes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views4 pages

Session 7 Assignment

Related mulesoft scopes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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,


http://ocalhost:8081/api/insertAccountDetails?system=AWS
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 body.Type of file is json
eg: MuleSoftTechzone.json
Share the screenshot showing the file inserted in AWS s3

B) Whenever user hits the url,


http://ocalhost:8081/api/insertAccountDetails?system=SALESFORCE
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,


http://ocalhost:8081/api/insertAccountDetails?system=FILE
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 body.Type of file is csv
eg: MuleSoftTechzone.csv

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 session6.json 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

You might also like