2. Mule Expression Component
• This component evaluates an expression.
• It accepts either a user-defined expression or a reference to a file.
• The processor view is as below.
3. Mule Expression Filter
• This component evaluates a range of expressions.
• The Evaluator and Expression properties are required.
4. Mule Expression Transformer
• The Expression Transformer executes one or more expressions on the current
message.
• The result of these expressions becomes the payload of the current message.
Minimum Configuration:
• An expression evaluator and the expression itself.
• In the below figure, Check the Return source if Null box if you want the message
payload source to be returned without modification when all expressions evaluate
to null.
• Use the Advanced tab to optionally configure the return arguments.
5. • For each return argument, you enter or select from the pull-down list its expression
evaluator. Then enter the expression to use. If you set Evaluator to custom, you also
need to specify the custom evaluator. If you are using a custom expression evaluator,
you must first have registered the custom evaluator with the Expression Evaluator
Manager. Expression syntax varies depending on the evaluator.
6. • When you have multiple expressions for return arguments, by default expression
evaluation returns an error and stops when an expression evaluates to null. Check
the Optional box if you want expression evaluation to continue to the next
expression when an expression evaluates to null.
• The evaluators should be of this enumeration '[attachment, attachments,
attachments-list, bean, endpoint, exception-type, function, groovy, header,
headers, headers-list, json, json-node, jxpath, map-payload, message, mule, ognl,
payload, process, regex, string, variable, xpath, xpath2, xpath-node, custom]'.
8. Description:
• 1. Use http connector to trigger the flow.
• 2. Expression component to set the Employee Details as outbound properties.
• 3. Message Properties component to set a Session Variable.
• 4. Pass all the properties to another flow using a http outbound end point and add
session properties to the header as session expires after every flow.
• 5. The data received will be of Byte Array Stream so use an Object to String
Transformer.
9. • 6. Check the attached Session variable using the "#[message]" MEL in Logger
component.
• 7. Get all the details from the inbound properties and use a map object to set-
payload. In a similar fashion List can also be used.
• 8. Transform the payload type from Object to String.
• 9. Evaluate if the payload type is of String or not using Expression Filter. If the
payload is of type String the flow execution forwards.
• 10. Use choice router to check for a specific text in the payload and print his Server
IP using Mule Expression Transformer.