DataWeave – Tip #3

I have already presented how to call Java code using message processors with the newest Java Module for Mule 4.x. For earlier Mule versions, Entry Point Resolvers were used to invoke custom Java code. However, for scenarios when we would like to use custom code in DataWeave, for transformations, another approach is needed. The approach presented in this article will be more concise, comparing ways in which we can use message processors. This process has been highly extended, compared to the possibilities of Mule 3.x. Mule 3 allowed us to invoke static methods. In contrast, Mule 4 not only permits us to call static methods but also instantiate classes and access their instance attributes.

Invoke a Method

Below, I have attached the DataWeave code responsible for converting an array into a list. To perform the conversion, I will use the already existing asList static method in the Arrays class. https://goo.gl/tkKsFD #DataIntegration #ML

Subscribe To Newsletter

Sign up for my newsletter and get the latest technology news

2019 © Craig Brown PhD. All rights reserved.