How to use different programming languages (Java, .NET, Groovy, JavaScript, Python, Ruby) into a scripting component instead of having to re-engineer the code’s behavior through a series of different Mule components.
2. BASIC CONSIDERATIONS
• Anypoint Studio provides a set of transformers to
handle the most common data transformation
scenarios
• Developer can chain transformers if a transformer did
not exist for specific needs
• The DataWeave Transform Message component can be
used in place of most other transformers
3. SPECIAL CASES
• Transforming complex data structures
• Applying complex business rules
• The available transformers cannot meet the
requirement
• Simply throw the old lines of code into a component
instead of having to reengineer the code’s behavior
through a series of different Mule components
4. POSSIBLE SOLUTIONS
• Building custom components and/or transformers
• Turning to the most favorite Programming Languages:
o Java
o .NET
o Scripting languages: Groovy, Javascript, Python or Ruby
7. SCRIPT COMPONENT (1/2)
Basic usage: To set up in the scripting component,
identify what scripting engine to use, and the script
itself, which you can reference or type directly into the
element.
8. SCRIPT COMPONENT (2/2)
Choose a
programming
language for the
scripting component:
• Groovy
• JavaScript
• Python
• Ruby
9. SCRIPT ENGINE: GROOVY (1/2)
Placing a Groovy (JavaScript, Python, or Ruby)
Component is actually the same as placing a Script
component and then selecting the Groovy (JavaScript,
Python, or Ruby) engine.
10. SCRIPT ENGINE: GROOVY (2/2)
Specify the file
location of the script
or simply type in the
script on the script
text window.
11. SCRIPT ENGINE: JAVASCRIPT
JavaScript allows the developer to configure interceptors and
alter the values or references of particular properties in a script.
12. SCRIPT ENGINE: PYTHON
Python allows the developer to configure interceptors and alter the
values or references of particular properties in a script.
13. SCRIPT ENGINE: RUBY
Ruby allows the developer to configure interceptors and alter the values
or references of particular properties in a script.
17. SUMMARY
Mule allows developers to:
• Build their own component and/or transformer
• Simply write their favorite programming language
• Put the different programming languages in a row