DEV Community

anilkumarganna
anilkumarganna

Posted on

Define and manage application metadata in MuleSoft

Data without having a context has minimal or no value. Thus, metadata provides the following context and results in playing an important role within the organization. In Mulesoft, there are two types of metadata available; structural and descriptive. The structural metadata defines the certain components and design of structured data. The descriptive metadata is a type that handles the actual data content, including the information related to invention and recognition.

Moreover, in Mulesoft, metadata offers business organizations perception into why and how the data was developed, time and date of creation, the author and location of metadata, as well as protocols that might have been used to develop it.

Mulesoft metadata propagation

One of the major aspects of explaining what comes in and what goes out is that this information is proliferated in the flow. In the Mulesoft Metadata structure at the right side of the MuleSoft Properties window, the user may find the input and output tabs. These tabs express what data flows via the Message Processor. Here, we will see the input received and expected by a connector operation and the output that the operation will generate if there isn’t an anomaly.

Thus, having all the Mulesoft metadata of the flow described will help users to understand the happenings going on at any given point.
• What data should pass via?
• What will be the output and how this moves to the next Message processor?
• What happens with the user Mulesoft Message when he adds a new
Message Processor in a flow?
• How the payload, variables, and properties are converted?
• Moreover, how all this without the need of running user application saves a lot of time?

Now, sharing this information will help other developers to understand the work performed and make it much easier to put up.

And finally, all this is chiefly helpful while modifying data structures and types using DataWeave. In case, before generating a mapping, we have to configure all the Metadata information, while adding DataWeave in the middle. Moreover, it will already know what kind of input is and what we are trying to generate as a result. Through this information, it will help us to create the script/code needed to alter the data structures and types.

All the following reasons are thinking about the Metadata while developing our MuleSoft App is useful and important.

Metadata Editor Access

Here, we will try how to access the Mulesoft Metadata editor. The following steps will help us in this regard;
• Go to the properties editor of most components and select the Metadata tab within.
• Now, on a Transform Message Component, do right-click on the input or output and select the Set Metadata option. If there is no set available, you will find a Define metadata link there.
• In case, if your input metadata is missing or inbound properties, outbound properties, session, or record variables, that you know exist in the incoming mule message. Then, can manually add them to the editor.
• Later, just do right-click on one of the categories available and select New Property or New Variable option
• Finally, on the package explorer, do right click on the project and then select Mule --> Manage Metadata types within.

Adding different Metadata types

To explicate more than one metadata type on the metadata tab within the Mulesoft app, click Add metadata. Click for one time for each metadata type you need to explain. Similarly, to remove a metadata type from the app, just click the Remove (rem icon) next to the right of the editor in the panel.

Metadata Tab basic usage

The custom metadata tab exists in all type message processors except connectors (they already put up their own metadata to DataSense). Here, the custom metadata tab enables the user to interpret metadata types for message processors. Besides, they do not automatically put up their own types.

The stated metadata types are automatically identified as inputs by the next message processor within the flow.

The user can explain the following types of input and output metadata within Mulesoft:
• Flow Vars
• SessionVars
• Message Inbound Properties
• Message Outbound Properties &
• Message Payload

Defining Metadata using UI

Here the user can develop a new metadata class with some of the available options here. While explaining the formation via the editor, the user absolutely creates a schema for that type. These schemas are stored in the user’s project’s src/main/resources folder. And the user also can open these and edit them openly on Anypoint Studio.

After the user develops a new data type, he can couple any new metadata that he creates with this new type to avoid having to explain it again.

Fixed width

The Copybook and Fixed Width are technical parts of a Flat File, and they literally construct Flat File schemas. Moreover, the Flat File type is advised only for use cases that are not included by the other two types.

Wrap an element within a collection

For any type, the user can click on the Wrap Element within a Collection checkbox. This is available at the bottom of the metadata editor window in Mulesoft app:

This sets the Mulesoft metadata as a list, where each element on the list is an example of the composition that the user defines. Thus, for example; in case we set our metadata in an XML form, clicking this checkbox will make the metadata a list that contains N mentions of that XML formation.

Reader & Writer properties

Upon the Transform Message component, there are some formats like CSV also allow users to set some additional parameters within the reader or the writer's configuration, based on if the user wants to set the input or the output.

Managing Metadata

Metadata management provides business unit awareness into their data. This allows them to give better user experience for future customers. With a Mulesoft metadata management solution, business entities can manage data, making it simpler & easier to access for future use. Finally, it promotes the reuse of data. In addition to providing a way to secure metadata, a metadata management solution allows business organizations to get metadata from applications. And utilize the same in a manner to help future application designs well. Mulesoft training offers various solutions to help organizations take the benefit of metadata in the enterprise entirely.

CloudHub Insights

Working with MuleSoft ’s integration platform as a service (iPaaS), a cloud-based platform, CloudHub Insight is a tool that gives organizations visibility towards business events and deals. Moreover, it allows them to track everything that data performs within an application. These Insights delivers searchable data to help business units answer key questions regarding their applications. Like: What happened with a specific transaction or deal? When does it occur? How long did it take to continue? What was the output?

DataSense

Acquire information about data and define methods on how to exactly map or use data in an application. Here, DataSense exchanges the task of having to manually locate information employed by the internal and external depository and resources. Moreover, the DataSense identifies and uses metadata to help business entities get the most benefit out of application integration.

Summing Up

Thus, the above article helps us to understand about metadata in Mulesoft and its management. Learn more from Mulesoft Online Training .

Top comments (0)