Lab 2: Download the complete Omni Channel project


Now that we’ve seen how APIKit helps developers import the designed REST API to enable MuleSoft flow development, we’ll download a fully implemented Omni Channel API project.

Step 1: Import the project from Anypoint Exchange

  1. From Studio open exchange

    module2 lab2 open exchange
  2. Filter by Examples

  3. Select the sub organization

  4. Click on the omni-channel-api

    module2 lab2 omni channel
  5. In the portal press Open

    module2 lab2 open project

    Once you open it, the project is going to be imported into Studio.

    module2 lab2 menu import

Step 2: Examine the different flows within the project

The previous lab already introduced the APIKit, Error handling and Dataweave Transform Message processors. In below flows we introduce REST Connectors, Flow Control components and Scopes. So let’s first look at these in more detail.


REST Connector
A REST Connector is a component that can be used in Mule applications that’s been custom created via a specific framework. This framework allows you to create components entirely by using other existing Mule components. When an API Specification is published to exchange a REST Connector is automatically generated for it in Exchange by REST Connect Tool.


Flow Control
Flow Control Routers such as the Choice Router allows for controling the message flow within a Mule flow.


Sometimes referred to as "wrappers", the message processors known as Scopes appear as processing blocks when you first place them on the Message Flow canvas.

Now, lets look at all the flows within the project.


This flow calls the Order API to get an order from the database based on the order id


This flow calls the Order API to get orders from the database based on a search


This flow calls the Product API to get a product based on the product id


This flow returns products from the database by calling the Product API


This flow returns all the items in a users shopping cart based on the user id


This flow puts an item into a users shopping cart based on the user id


This flow confirms the items to purchase in a users shopping cart.

Step 3: Test the application

To test the API, let’s run it within Studio first.

  1. Right click the application.

  2. Select Run As > Mule Application.

    module2 lab2 step4 12 studio run.png
  3. The application will start running, and the console will show the Mule Runtime logs

    module2 lab2 step4 13 studio console deployed
    Anypoint Studio deployed this application to an embedded Mule Runtime. There is no need to deploy to a separate Mule server environment. The developer will be able to develop and test the application locally until it’s ready to be deployed to a shared development or QA environment.
  4. Test the application using the console. Click the Open Console on the APIkit Console tab.

    module2 lab2 step4 14 apikit console base url
  5. A browser window opens at: http://localhost:8081/console/.

  6. Click open the /products/search resource on the left and click GET.

    module2 lab2 step4 15 browser apikit console tryit
  7. Then tick the Show optional parameters and fill them in as below and click SEND.

    module2 lab2 step4 16 apikit console get request
  8. Unlike Lab 1, this project is a complete solution and is making calls to System and Process REST APIs. The response you see in the Console is coming from other sources.

    module2 lab2 step4 17 apikit console response

    Let’s go ahead and stop the application to get ready for the next lab.

  9. Go to the console tab and press the red squared button to stop the Mule runtime server.

    module2 lab2 step4 18 studio stop


In this lab, we

This lab shows how quick and easy it is to enable your teams to get up and running quickly with pre-built project templates.

Congratulations! You have completed Lab 2.

Please proceed to Lab 3