diff --git a/modules/ROOT/assets/image-source-files/custom-metadata-project-prop.graffle b/modules/ROOT/assets/image-source-files/custom-metadata-project-prop.graffle new file mode 100644 index 000000000..6935cf88b Binary files /dev/null and b/modules/ROOT/assets/image-source-files/custom-metadata-project-prop.graffle differ diff --git a/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab-attributes.graffle b/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab-attributes.graffle index 8693bdda7..1b0ba3aff 100644 Binary files a/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab-attributes.graffle and b/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab-attributes.graffle differ diff --git a/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab.graffle b/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab.graffle index 0742864c6..83893a765 100644 Binary files a/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab.graffle and b/modules/ROOT/assets/image-source-files/int-dw-fx-data-tab.graffle differ diff --git a/modules/ROOT/assets/image-source-files/int-dw-fx-input-output-sample.graffle b/modules/ROOT/assets/image-source-files/int-dw-fx-input-output-sample.graffle index 25a58915a..71aa31bfa 100644 Binary files a/modules/ROOT/assets/image-source-files/int-dw-fx-input-output-sample.graffle and b/modules/ROOT/assets/image-source-files/int-dw-fx-input-output-sample.graffle differ diff --git a/modules/ROOT/assets/images/int-custom-metadata-project-prop.png b/modules/ROOT/assets/images/int-custom-metadata-project-prop.png new file mode 100644 index 000000000..cd467322f Binary files /dev/null and b/modules/ROOT/assets/images/int-custom-metadata-project-prop.png differ diff --git a/modules/ROOT/assets/images/int-dw-fx-data-tab-attributes.png b/modules/ROOT/assets/images/int-dw-fx-data-tab-attributes.png index 3f87c171b..7c1209739 100644 Binary files a/modules/ROOT/assets/images/int-dw-fx-data-tab-attributes.png and b/modules/ROOT/assets/images/int-dw-fx-data-tab-attributes.png differ diff --git a/modules/ROOT/assets/images/int-dw-fx-data-tab.png b/modules/ROOT/assets/images/int-dw-fx-data-tab.png index fafb45a6e..56c11db76 100644 Binary files a/modules/ROOT/assets/images/int-dw-fx-data-tab.png and b/modules/ROOT/assets/images/int-dw-fx-data-tab.png differ diff --git a/modules/ROOT/assets/images/int-dw-fx-input-output-sample.png b/modules/ROOT/assets/images/int-dw-fx-input-output-sample.png index 670c55a4b..5fb0f92a7 100644 Binary files a/modules/ROOT/assets/images/int-dw-fx-input-output-sample.png and b/modules/ROOT/assets/images/int-dw-fx-input-output-sample.png differ diff --git a/modules/ROOT/pages/int-configure-components.adoc b/modules/ROOT/pages/int-configure-components.adoc index d9d77df75..92310b87e 100644 --- a/modules/ROOT/pages/int-configure-components.adoc +++ b/modules/ROOT/pages/int-configure-components.adoc @@ -34,6 +34,11 @@ 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 <> and see <>. + [[copy-components]] == Copy Components diff --git a/modules/ROOT/pages/int-configure-dw-expressions.adoc b/modules/ROOT/pages/int-configure-dw-expressions.adoc index b8e08e27e..0e36111b6 100644 --- a/modules/ROOT/pages/int-configure-dw-expressions.adoc +++ b/modules/ROOT/pages/int-configure-dw-expressions.adoc @@ -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: @@ -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: * <> * <> @@ -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"] |=== @@ -107,9 +108,23 @@ image:int-dw-fx-data-tab-attributes.png["Data tab for expression field with mock Automatically generated strings are displayed as mock values and are used to generate output for previews, such as in the <> 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 <> for more information about creating custom metadata. See <> 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 @@ -286,6 +301,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 <>. +[[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 <> for more information about creating custom metadata. See <> 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 @@ -462,4 +491,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[] - diff --git a/modules/ROOT/pages/int-manage-custom-metadata.adoc b/modules/ROOT/pages/int-manage-custom-metadata.adoc new file mode 100644 index 000000000..55a24adb0 --- /dev/null +++ b/modules/ROOT/pages/int-manage-custom-metadata.adoc @@ -0,0 +1,57 @@ += 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. + +== 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 +. 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-custom-metadata-project-properties.png["Custom Metadata tab on the Project Properties page"] + +[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 <> and see <>. + +[[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] \ No newline at end of file