Mule Concepts
Elements in a Mule Flow :
Transformers
• Transformer prepares a message for further
processing by enhancing or altering the contents of
the message properties, variables, or payload.
• Data transformation is one of the most powerful
functionalities of Mule.
• A pre-built transformer to perform a standard data
conversion can be used instead of writing custom
logic.
Elements in a Mule Flow :Transformers
• Mule provides a set of standard transformers to
handle the most common data transformation
scenarios.
• These elements require minimal configuration so as
to facilitate quick construction of applications that
must juggle different data formats between
resources and processors.
• You can arrange several transformers in a sequence
to achieve the output you need, if a particular
transformer is unavailable.
Elements in a Mule Flow :Transformers
• The Transformers can be broadly categorized into the
following :
– Java Object
– Content
– SAP
– Script
– Properties, Variables, and Attachments
Elements in a Mule Flow :Transformers
• Java Object :
– This category contains the bulk of the Mule
transformers.
– Each Transformer from this category can change a
Java Object into :
• another Java object.
• a non-Java data type e.g. an HTTP request.
• Or from a non-java data type to a Java Object.
– Examples :
• JSON to Object
• XML to Object
Elements in a Mule Flow :Transformers
• Content :
– This group of transformers modifies messages by
• adding to
• deleting from
• Or by converting a message payload.
– Example :
• Append String
• Expression
• Parse Template
• XSLT
Elements in a Mule Flow :Transformers
• SAP :
– These transformers change SAP objects (JCo functions or
IDoc documents) into XML representations, or vice versa.
– Examples :
• SAP Object to XML
• XML to SAP Function (BAPI)
• XML to SAP IDoc
Elements in a Mule Flow :Transformers
• Script:
– This type of transformer utilizes a custom script to perform
the transformation.
– Use one of these transformers to implement a custom
script to perform the transformation, If you can’t find the
transformer you need.
– Add one of these to the flow, then write a script in your
favorite language to convert data as needed.
– Examples :
• Groovy
• JavaScript
• Python
• Ruby
• Script
Elements in a Mule Flow :Transformers
• Properties, Variables, and Attachments :
– These transformers add, remove, or copy properties,
variables, and attachments on the message, rather than
acting on the message payload.
– This group of message processors doesn’t so much
transform as manipulate or enrich the contents of the
message header, hence also called as message enrichers.
– Examples :
• Attachment
• Property
• Session Variable
• Variable
Elements in a Mule Flow :Transformers
• DataWeave Transformer:
– This message processor both converts and maps data.
– It is labeled as Transform Message in the palette.
– In addition to transforming data from one format to
another, DataWeave can map an input field, such as
last_name, to a different output field, such as
family_name.
– It can map multiple fields, such as title, first_name, and
last_name, to a composite output field such as full_name.
– It can retrieve session state information in a message to
facilitate conditional message routing.
– it can use Mule expression evaluation to facilitate
conditional value recalculation.
– it can even look up information in tables or other flows
Elements in a Mule Flow :Transformers
Mule Concepts
Thank You.

Mule concepts transformers

  • 1.
    Mule Concepts Elements ina Mule Flow : Transformers
  • 2.
    • Transformer preparesa message for further processing by enhancing or altering the contents of the message properties, variables, or payload. • Data transformation is one of the most powerful functionalities of Mule. • A pre-built transformer to perform a standard data conversion can be used instead of writing custom logic. Elements in a Mule Flow :Transformers
  • 3.
    • Mule providesa set of standard transformers to handle the most common data transformation scenarios. • These elements require minimal configuration so as to facilitate quick construction of applications that must juggle different data formats between resources and processors. • You can arrange several transformers in a sequence to achieve the output you need, if a particular transformer is unavailable. Elements in a Mule Flow :Transformers
  • 4.
    • The Transformerscan be broadly categorized into the following : – Java Object – Content – SAP – Script – Properties, Variables, and Attachments Elements in a Mule Flow :Transformers
  • 5.
    • Java Object: – This category contains the bulk of the Mule transformers. – Each Transformer from this category can change a Java Object into : • another Java object. • a non-Java data type e.g. an HTTP request. • Or from a non-java data type to a Java Object. – Examples : • JSON to Object • XML to Object Elements in a Mule Flow :Transformers
  • 6.
    • Content : –This group of transformers modifies messages by • adding to • deleting from • Or by converting a message payload. – Example : • Append String • Expression • Parse Template • XSLT Elements in a Mule Flow :Transformers
  • 7.
    • SAP : –These transformers change SAP objects (JCo functions or IDoc documents) into XML representations, or vice versa. – Examples : • SAP Object to XML • XML to SAP Function (BAPI) • XML to SAP IDoc Elements in a Mule Flow :Transformers
  • 8.
    • Script: – Thistype of transformer utilizes a custom script to perform the transformation. – Use one of these transformers to implement a custom script to perform the transformation, If you can’t find the transformer you need. – Add one of these to the flow, then write a script in your favorite language to convert data as needed. – Examples : • Groovy • JavaScript • Python • Ruby • Script Elements in a Mule Flow :Transformers
  • 9.
    • Properties, Variables,and Attachments : – These transformers add, remove, or copy properties, variables, and attachments on the message, rather than acting on the message payload. – This group of message processors doesn’t so much transform as manipulate or enrich the contents of the message header, hence also called as message enrichers. – Examples : • Attachment • Property • Session Variable • Variable Elements in a Mule Flow :Transformers
  • 10.
    • DataWeave Transformer: –This message processor both converts and maps data. – It is labeled as Transform Message in the palette. – In addition to transforming data from one format to another, DataWeave can map an input field, such as last_name, to a different output field, such as family_name. – It can map multiple fields, such as title, first_name, and last_name, to a composite output field such as full_name. – It can retrieve session state information in a message to facilitate conditional message routing. – it can use Mule expression evaluation to facilitate conditional value recalculation. – it can even look up information in tables or other flows Elements in a Mule Flow :Transformers
  • 11.