Our MuleSoft app is built to interact with Scores data in Salesforce database. It is a RESTful API that allows us to perform CRUD operations on Salesforce objects. We use Code Builder to build the app and CloudHub to deploy it.
API Documentation (in review 🚧)
Postman Collection (in progress 👨💻)
CloudHub Deployment (outdated 🚧)
For development and testing purposes, we can run the app using MuleSoft Code Builder.
MuleSoft Code Builder is a modern development environment designed to simplify and streamline the process of building and deploying integrations and APIs. It offers both local and cloud-based versions.
Below we outline how to use the cloud-based version. If you want to setup the environment locally, you can check instructions here (succesfully tested only on macOS).
Get Started
button.Launch
button (if it's greyed out, refresh the page and wait).Source Control
icon on the left sidebar.Clone Repository
button.Clone from GitHub
option (you will need you GitHub account later, so it's a preferred option).AmericaSCORESBayArea/salesforce-data-api
.Clone
button.local.properties
file in the src/main/resources/properties
folder.http.host=0.0.0.0
http.private.port=8091
sfdc.user=integrationuser@americascores.org.scoresqa
sfdc.url=https://americascoresbayarea--scoresqa.sandbox.my.salesforce.com/services/Soap/u/48.0
sfdc.tkn=
sfdc.password=
typeform.clientid=1234
typeform.clientsecret=1234
typeform.tkn=1234
Please note:
sfdc.tkn
and sfdc.password
fields are sensitive. Please contact the developers to get the values.typeform.clientid
, typeform.clientsecret
, and typeform.tkn
fields are not used as we are moving away from Typeform. You can leave them as is.Add -M-Denv=local
to Mule Runtime arguments:
-M-Denv=local
to the list of arguments:-M-Dmule.forceConsoleLog -M-Dmule.testingMode -M-XX:-UseBiasedLocking -M-Dfile.encoding=UTF-8 -M-XX:+UseG1GC -M-XX:+UseStringDeduplication -M-Dcom.ning.http.client.AsyncHttpClientConfig.useProxyProperties=true -M-Dmule.debugger.test.port=8000 -M-Dmule.debug.enable=true console0 -M-Denv=local
Config Run and Debug settings.
create a launch.json file
link (below the "Run and Debug" button).Install Thunder Client extension.
Extensions
icon on the left sidebar.Thunder Client
and install it.Try the following request using Thunder Client:
GET http://localhost:8091/api-internal/contacts?firstName=John&lastName=Doe
Ta-da! You are now running the Mule app in the cloud-based environment. 🚀
src/main/mule/api
folder.Manage your IDE
option.Reboot
button.The local build performed during the run differs from the build performed during the deployment. When running the app locally, raml
files in local src/main/resources/api
folder are used. When deploying the app, the raml
files fetched from the Exchange are used. When building the app for deployment, the global.xml.anypoint
should be used instead of global.xml
. (handled by the local-build.sh
script)
To manually build the app for deployment, you need to execute the local-build.sh
script. Then, you can manually upload the generated .jar
file to CloudHub. Make sure the following properties are set in Mule Runtime secrets:
anypoint.platform.config.analytics.agent.enabled=
anypoint.platform.client_id=
anypoint.platform.client_secret=
keystore.password=
keystore.key.password=
sfdc.password=
sfdc.tkn=
typeform.clientsecret=
typeform.clientid=
typeform.tkn=
api.id=
env=