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
Share this:
- Click to share on Facebook (Opens in new window)
- Click to share on Twitter (Opens in new window)
- Click to email a link to a friend (Opens in new window)
- Click to share on LinkedIn (Opens in new window)
- Click to share on Tumblr (Opens in new window)
- Click to share on Pinterest (Opens in new window)
- Click to share on Reddit (Opens in new window)