Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified modules/ROOT/assets/images/int-dw-fx-data-tab-attributes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified modules/ROOT/assets/images/int-dw-fx-data-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified modules/ROOT/assets/images/int-dw-fx-input-output-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions modules/ROOT/pages/int-configure-components.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ Understand the basics of Mule flows, the Mule event structure, including the pay
//add component content
include::partial$acb-component-info.adoc[tags="add-components"]

[[set-custom-metadata-for-component]]
== Set Custom Metadata for a Component

To set custom metadata for a component, add or open the component in the canvas and then apply the metadata using the custom metadata options from the *Metadata* tab, *Expression Builder*, or dataweave functions. For more information, see <<set-custom-metadata-on-metadata-or-data-tab, Set Custom Metadata on the Metadata or Data Tab>> and see <<set-custom-metadata-in-transformation-builder, Set Custom Metadata in Transformation Builder>>.

image::int-set-component-custom-metadata.png["Set Custom Metadata for a component"]

[[copy-components]]
== Copy Components

Expand Down
38 changes: 33 additions & 5 deletions modules/ROOT/pages/int-configure-dw-expressions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Anypoint Code Builder integrates DataWeave expressions and transformations into
* Object-to-object and array-to-array transformations
* Concatenation of strings, numbers, and booleans
* Type conversions
* Custom metadata for inputs and outputs

Anypoint Code Builder supports these transform mapping use cases:

Expand Down Expand Up @@ -79,7 +80,7 @@ The markup `#[]` in the *fx* field also appears in the XML to indicate that the
+
image::int-dw-fx-expression-builder.png["*Expression Builder* interface shows the *Data*, *Functions*, and *Preview* tabs for building DataWeave expressions in the `Set Variable` component"]
+
Use the *Data*, *Functions*, and *Preview* tabs to ease configuration of expressions in your components. Preview the expression output without running your Mule app with data from external sources:
Use the *Data*, *Functions*, and *Preview* tabs to ease configuration of expressions in your components. Select custom metadata for the payload, attributes, and Mule variables. Preview the expression output without running your Mule app with data from external sources:

* <<tab-data>>
* <<tab-functions>>
Expand All @@ -93,7 +94,7 @@ Use the *Data*, *Functions*, and *Preview* tabs to ease configuration of express
[[tab-data]]
=== Check the Data Structure

To review the data structure of the Mule event, including the payload, attributes, and Mule variables, use the *Data* tab. The tab includes any sample data and is part of *Expression Builder* for a component *fx* field. For example:
To review the data structure of the Mule event, including the payload, attributes, and Mule variables, use the *Data* tab. The tab includes any sample data and custom metadata and is part of *Expression Builder* for a component *fx* field. For example:

[%header,cols="1a,1a"]
|===
Expand All @@ -107,9 +108,23 @@ image:int-dw-fx-data-tab-attributes.png["Data tab for expression field with mock

The IDE shows the automatically generated strings as mock values and uses them to generate output for previews, such as in the <<tab-preview, Preview>> tab. The attribute metadata keys in the example come from the configuration of an `HTTP Listener` component in the flow.

The *Input/Output* tab shows the structure of data entering (*Input*) and exiting (*Output*) components. For example:
[[set-component-custom-metadata-on-metadata-or-data-tab]]
=== Set Component Custom Metadata on the Metadata or Data Tab

image:int-dw-fx-input-output-sample.png["Input/Output tab for a component"]
The *Metadata* tab shows the structure of data entering (*Input*) and exiting (*Output*) components. For example:

image:int-dw-fx-input-output-sample.png["Metadata tab for a component"]

From the *Metadata* tab or the *Data* tab of *Expression Builder*, manage component metadata by setting, clearing, or editing custom definitions for inputs and outputs. Each payload, attribute, or variable supports only one custom metadata assignment at a time.

To set custom metadata from the *Metadata* tab or the *Data* tab of *Expression Builder*:

. Click *No metadata selected* if metadata isn't already set or click the name of the custom metadata. If default metadata is being used, click *Default*.
. Click *Set Custom Metadata*.
. Select, edit, or preview existing custom metadata or create new custom metadata. See <<create-custom-metadata, Create Custom Metadata>> for more information about creating custom metadata. See <<edit-custom-metadata, Edit Custom Metadata>> for more information about editing custom metadata.
. Click *Apply and Close*.

To clear custom metadata, click the name of the custom metadata and then click *Clear Custom Metadata*. The metadata is cleared from the component.

[[tab-functions]]
=== List DataWeave Functions and Get Documentation
Expand Down Expand Up @@ -373,6 +388,20 @@ If needed, map multiple source field to a target field, and then the Transform B
+
You can select the generated sample or provide your own <<sample-data, sample data>>.

[[set-custom-metadata-in-transformation-builder]]
=== Set Custom Metadata in Transformation Builder

In Transformation Builder, you can manage component metadata by setting, clearing, or editing custom definitions for inputs and outputs. Each payload, attribute, or variable supports only one custom metadata assignment at a time.

To set custom metadata:

. Click *No metadata selected* if metadata isn't already set or click the name of the custom metadata. If default metadata is being used, click *Default*.
. Click *Set Custom Metadata*.
. Select, edit, or preview existing custom metadata or create new custom metadata. See <<create-custom-metadata, Create Custom Metadata>> for more information about creating custom metadata. See <<edit-custom-metadata, Edit Custom Metadata>> for more information about editing custom metadata.
. Click *Apply and Close*.

To clear custom metadata, click the name of the custom metadata and then click *Clear Custom Metadata*. The metadata is cleared from the component.

[[sample-data]]
== Provide Sample Data for a DataWeave Expression

Expand Down Expand Up @@ -549,4 +578,3 @@ When complete, Anypoint Code Builder shows a message that the dependency was suc
* xref:troubleshoot-dataweave.adoc[]
* xref:int-create-integrations.adoc#add-components[Add a Component to Your Project]
* xref:acb-reference.adoc[]

59 changes: 59 additions & 0 deletions modules/ROOT/pages/int-manage-custom-metadata.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
= Managing Custom Metadata

Define and assign custom metadata to accurately represent your organization's unique data structures within your integration projects. Create metadata for inputs and outputs using common formats so your data transformations stay accurate. Custom metadata connects your visual development tools to your data requirements, facilitating easier testing and workflow creation.

image::int-custom-metadata-project-properties.png["Custom Metadata tab on the Project Properties page"]

== Supported Metadata Types

Anypoint Code Builder supports these metadata types:

* CSV
* Copybook
* Excel
* Fixed Width
* Flat File
* JSON
* Object
* Simple type
* XML

[[create-custom-metadata]]
== Create Custom Metadata

To create custom metadata:

. Click *Create New*.
. Enter a unique name for the metadata.
. Select the metadata type, such as CSV, JSON, or XML.
. Add additional required details for the metadata, depending on the type selected, such as the definition or source type, schema, and class. You must also upload a sample file for some metadata types.
. Select to wrap the element in a collection, which converts the custom metadata into an array. The enrichment element in the `application-types.xml` file is updated automatically with the conversion.
. Click *Save and Close*.

The custom metadata is stored in the `application-types.xml` file in your project's resources folder. Sample files and custom metadata created in Anypoint Code Builder are compatible with Anypoint Studio and vice versa.

image::int-application-types-file.png[width=50%,"The application-types.xml file in the resources folder of the project"]

[NOTE]
To apply custom metadata to a component, add or open the component in the canvas and then apply the metadata using the custom metadata options from the Metadata tab, *Expression Builder*, or *Transformation Builder*. For more information, see <<set-custom-metadata-on-metadata-or-data-tab, Set Custom Metadata on the Metadata or Data Tab>> and see <<set-custom-metadata-in-transformation-builder, Set Custom Metadata in Transformation Builder>>.

[[edit-custom-metadata]]
== Edit Custom Metadata

To edit custom metadata, click the three dots next to the source file and then click *Edit*. Make your changes and then click *Save and Close*. The changes are applied to all components that use the custom metadata.

== Preview Custom Metadata

To preview custom metadata, click the name of the metadata. The preview shows the metadata in the selected format.

[[delete-custom-metadata]]
== Delete Custom Metadata

To delete custom metadata from the *Custom Metadata* tab, click the three dots next to the source file and then click *Delete*. The metadata is deleted from all components that use it.

You can also delete custom metadata when editing by clicking *Delete Custom Metadata* from the three dots menu.

== See Also

. xref:int-configure-dw-expressions.adoc#set-component-custom-metadata-on-metadata-or-data-tab[Set Component Custom Metadata on the Metadata or Data Tab]
. xref:int-configure-dw-expressions.adoc#set-custom-metadata-in-transformation-builder[Set Custom Metadata in Transformation Builder]