You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>>.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/int-configure-dw-expressions.adoc
+33-5Lines changed: 33 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ Anypoint Code Builder integrates DataWeave expressions and transformations into
18
18
* Object-to-object and array-to-array transformations
19
19
* Concatenation of strings, numbers, and booleans
20
20
* Type conversions
21
+
* Custom metadata for inputs and outputs
21
22
22
23
Anypoint Code Builder supports these transform mapping use cases:
23
24
@@ -79,7 +80,7 @@ The markup `#[]` in the *fx* field also appears in the XML to indicate that the
79
80
+
80
81
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"]
81
82
+
82
-
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:
83
+
Use the *Data*, *Functions*, and *Preview* tabs to ease configuration of expressions in your components. Select custom metadata for the payload and attributes. Preview the expression output without running your Mule app with data from external sources:
83
84
84
85
* <<tab-data>>
85
86
* <<tab-functions>>
@@ -93,7 +94,7 @@ Use the *Data*, *Functions*, and *Preview* tabs to ease configuration of express
93
94
[[tab-data]]
94
95
=== Check the Data Structure
95
96
96
-
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:
97
+
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:
97
98
98
99
[%header,cols="1a,1a"]
99
100
|===
@@ -107,9 +108,23 @@ image:int-dw-fx-data-tab-attributes.png["Data tab for expression field with mock
107
108
108
109
Automatically generated strings are displayed as mock values and are used 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.
109
110
110
-
The *Input/Output* tab shows the structure of data entering (*Input*) and exiting (*Output*) components. For example:
111
+
[[set-custom-metadata-on-metadata-or-data-tab]]
112
+
=== Set Custom Metadata on the Metadata or Data Tab
111
113
112
-
image:int-dw-fx-input-output-sample.png["Input/Output tab for a component"]
114
+
The *Metadata* tab shows the structure of data entering (*Input*) and exiting (*Output*) components. For example:
115
+
116
+
image:int-dw-fx-input-output-sample.png["Metadata tab for a component"]
117
+
118
+
From the *Metadata* tab or the *Data* tab of *Expression 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.
119
+
120
+
To set custom metadata from the *Metadata* tab or the *Data* tab of *Expression Builder*:
121
+
122
+
. 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*.
123
+
. Click *Set Custom Metadata*.
124
+
. 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.
125
+
. Click *Apply and Close*.
126
+
127
+
To clear custom metadata, click the name of the custom metadata and then click *Clear Custom Metadata*. The metadata is cleared from the component.
113
128
114
129
[[tab-functions]]
115
130
=== 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
286
301
+
287
302
You can select the generated sample or provide your own <<sample-data, sample data>>.
288
303
304
+
[[set-custom-metadata-in-transformation-builder]]
305
+
=== Set Custom Metadata in Transformation Builder
306
+
307
+
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.
308
+
309
+
To set custom metadata:
310
+
311
+
. 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*.
312
+
. Click *Set Custom Metadata*.
313
+
. 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.
314
+
. Click *Apply and Close*.
315
+
316
+
To clear custom metadata, click the name of the custom metadata and then click *Clear Custom Metadata*. The metadata is cleared from the component.
317
+
289
318
[[sample-data]]
290
319
== Provide Sample Data for a DataWeave Expression
291
320
@@ -462,4 +491,3 @@ When complete, Anypoint Code Builder shows a message that the dependency was suc
462
491
* xref:troubleshoot-dataweave.adoc[]
463
492
* xref:int-create-integrations.adoc#add-components[Add a Component to Your Project]
0 commit comments