Nav

To Enable Business Events

Event tracking requires some processing and network overhead to aggregate and store the events that the Mule servers generate, so by default, tracking is not enabled for connectors or message processors that support it. However, enabling tracking for default events is very simple. You just need to explicitly configure the scope for tracking the default events. You can configure the scope either:

  • At the flow level.

  • At the message processor (connector or component) level, which takes precedence over the flow level setting.

Enabling Event Tracking at the Flow Level

To enable default event tracking for elements in a flow that allow event tracking.

Note that you can disable tracking for specific processors or connectors to override the flow-level enablement.

  1. From a Mule app, click to open the flow component.

  2. Enable default Business Events by selecting this: 

    • Enable Default Events Tracking using one of these options:

    • In the UI, you can check the Enable Default Events Tracking checkbox.

    • In the Studio XML, you can add this attribute to the flow element, for example:

      <flow name="testFlow" tracking:enable-default-events="true">

  3. Optionally, set an identifier for all tracked events pertaining to this flow so that meaningful information, such as an order number, is displayed for a transaction.

    • In the UI, you can check Use Transaction ID and supply an ID.

    • In the Studio XML, you can add a child element to the flow element that looks like this:

      
                     
                  
      1
      2
      3
      4
      5
      
      <flow name="flow">
        ...
        <tracking:transaction id="#[expression]" />
        ...
      </flow>
  4. Save your settings.

Enabling Event Tracking at the Message Processor Level

You can enable event tracking on individual connectors and components that support event tracking. Not all processors support default event tracking. If the checkbox is not present in a message processor or connector, default tracking is not supported.

  1. Click to open a message processor in a Mule flow. 

  2. Select Enable Default Events Tracking.

    Note that you can also do enable tracking through the Studio XML for the component, for example:

    
                
             
    1
    2
    3
    4
    5
    
    <flow name="flow">
      ...
        <choice doc:name="Choice" tracking:enable-default-events="true"/>
      ...
    </flow>

Customizing the Transaction ID 

You can define a Transaction ID so that meaningful information, such as an order number, is displayed for a transaction when you analyze tracked events at runtime. If you do not customize the Transaction ID, Mule assigns a numeric transaction ID by default. To make the ID more user-friendly for your business needs, you can customize through a DataWeave expression.

It is good practice to make sure that your custom ID is unique for each transaction in your application. The following example sets up a unique ID based on a unique order ID extracted from a payload.


         
      
1
2
3
4
5
<flow name="flow">
...
  <tracking:transaction id="#[payload.orderId]" />
...
</flow>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+