Tracking a Custom Business Event icon

Tracking a Custom Business Event

(0 reviews)

home

Shows how to track data using the custom business event component.

Example

Order data in JSON format is sent through an HTTP endpoint to a Ruby transformer. The custom code embedded with this component is used to calculate the discount that is offered for a certain product type. The Custom Business event keeps track of the item name, number of units and price per unit for the order data.

Set Up and Run the Example

  1. Install this example into your Anypoint Studio workspace from Anypoint Exchange.

  2. Export the project from your Studio workspace to a zip file using File > Export > Mule > Anypoint Studio Project to Mule Deployable Archive.

  3. Sign in to Anypoint Platform > Runtime Manager.

  4. Click Deploy Application and choose the deployable zip file.

  5. In the Advanced Settings tab enable Metadata and Replay and then Apply changes.

  6. Click Start to deploy your application in Runtime Manager.

  7. Use Postman to make a POST request using JSON to http://(yourdomain).cloudhub.io:

    {
    "email": "aaa@abc.sk",
    "item name": "shoes",
    "item units": 2,
    "item price per unit": 10,
    "membership": "free"
    }

    The response body should contain price per unit with the applied discount (-15% for shoes):

  8. Go to your Runtime Manager account and click the Insight tab in the left panel to see that your custom business event was logged.

Documentation

Read full documentation in GitHub


Reviews

TypeExample
OrganizationMulesoft Inc.
Published by
MuleSoft Organization
Published onMar 17, 2018
Asset overview

Asset versions for 1.4.x

Asset versions
VersionActions
1.4.0