How event object changes when calls are made to external resources

plektonlabs-ejb-connection-mule3

This short tutorial discusses how the objects in a Mule event change when an external source is called through the flow. A Mule event consists of Mule message, attributes, payload and variables. The tutorial is explained with parent and child flow respectively.

Fig 1: Mule flow calling an external resource like a webservice. The request component is call to external service.

Lets say that HelloFlow is the parentFlow which calls the childFlow goodbyeFlow. Will call the objects in parentFlow as A_P ( Attributes of parentFlow), P_P (payload of parentFlow) and V_P (variable of parentFlow) (see Fig 2). In case of childFlow objects are A_C ( Attributes of childFlow), P_C (payload of childFlow) and V_C (variable of childFlow) (see Fig 3) . The two queryParams passed to the parentFlow are fname and lname respectively.

Fig 2: Attributes in parentFlow shown in debug mode.

Comparing Fig 2 and Fig 3 it is evident that attributes A_P gets replaced with attributes A_C. The two queryParams in parentFlow is modified with no queryParam in the childFlow. Similarly, the payload P_P is modified to P_C. However, if a response header from parentFlow then it gets added to the response header. In Fig 1 the variable in the childflow firstname refers to object which is attributes of parentFlow. Since the A_P are not transferred to child object so the var.firstName is Null.

Fig 3: Attributes in childFlow shown in debug mode.

If a variable V_P is defined in the parentFlow then it remains available even after response from the request is made. But V_C in the childFlow is not available only payload is available to the parentFlow.

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

More To Explore

Blog

The Use of APIs in the Business Supply chain

Supply chains that mostly rely on legacy EDI (electronic data interchange) systems, a technology introduced over half a century ago to support communication with business

Blog

The 5 Foundations of API Governance

For many, governance is a necessary but tedious task. But when done right, governance offers a clear direction, breaks down barriers, and enables different parts

How can we help?

A little about yourself and we're ready to go

We pride ourselves on swift communication and prompt responses. Let us know what you're thinking and how we can help you.

Contact Information​

Head Office
75 Cornwall Drive, Ajax ON L1T3G2

Toronto Office
602 – 8133 Warden Ave, Markham, ON L6G 1B3, Canada

Phone: +14168902757
Email: info@plektonlabs.com

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.