Skip to content

Commit 4786afb

Browse files
W-21202212-Add-DW-enhancements-CP
1 parent 35cd0aa commit 4786afb

1 file changed

Lines changed: 94 additions & 5 deletions

File tree

modules/ROOT/pages/int-configure-dw-expressions.adoc

Lines changed: 94 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= Using DataWeave Expressions and Transformations in Anypoint Code Builder
22
:page-aliases: int-use-dw-to-transform-data.adoc, int-address-dw-errors.adoc, int-import-dw-libraries.adoc
33

4-
DataWeave is the MuleSoft programming language for data transformation and for defining expressions. Use DataWeave to process Mule event data, such as `payload`, `attributes`, and `vars`, in connector operations and other components. Develop DataWeave expressions and transformations in your Mule applications using the *Expression Field*, *Expression Builder*, or *Transformation Builder*, or by editing the configuration XML. Generate DataWeave transformations with AI help by providing input and output sample data, metadata, or both.
4+
DataWeave is the MuleSoft programming language for data transformation and for defining expressions. Use DataWeave to process Mule event data, such as `payload`, `attributes`, and `vars`, in connector operations and other components. Develop DataWeave expressions and transformations in your Mule applications using the *Expression Field*, *Expression Builder*, or *Transformation Builder*, or by editing the configuration XML. Generate DataWeave transformations with AI help by providing input and output sample data, metadata, or both. AI-powered auto mapping provides comprehensive error feedback for GenAI actions, including authorization, metadata, and request limits, ensuring a more reliable and guided mapping experience.
55

66
image::int-dw-transform-ui.png["A configuration panel showing three numbered callouts: 1) fx button for Expression Field, 2) Expression Builder button, and 3) Transformation Builder button"]
77

@@ -210,11 +210,14 @@ If using AI-assisted transformations, evaluate these considerations:
210210
* AI requires valid data to create the transformation script. Write it manually if needed.
211211
* AI chat history isn't available in *Transformation Builder*.
212212
* Avoid using real personally identifiable information (PII) in sample data or AI inputs. Provide input and output sample data that contains only fictional or masked data.
213+
* AI-assisted transformations provide comprehensive error feedback for GenAI actions. If you encounter errors related to authorization, metadata, or request limits, the error messages guide you to resolve the issue. See <<troubleshoot-ai-assisted-transformations>> for detailed troubleshooting steps.
213214

214215
[[map-with-ai]]
215216
=== Map with AI
216217

217-
The *Map with AI* feature automatically suggests a field-to-field mapping. This feature requires you to provide both input and output metadata for the component and triggers only when no DataWeave script is present. It performs auto-mapping based on the provided metadata.
218+
The *Map with AI* feature automatically suggests a field-to-field mapping using AI-powered auto mapping. This feature requires you to provide both input and output metadata for the component and triggers only when no DataWeave script is present. It performs auto-mapping based on the provided metadata.
219+
220+
*Map with AI* provides comprehensive error feedback for GenAI actions, including authorization errors, metadata issues, and request limits. If you encounter errors during the mapping process, see <<troubleshoot-ai-assisted-transformations>> for detailed guidance on resolving specific error types.
218221

219222
If you don't have access to *Map with AI*, you must:
220223

@@ -265,11 +268,97 @@ After inserting a script, the XML file is updated, and you can regenerate the sc
265268
[[troubleshoot-ai-assisted-transformations]]
266269
=== Troubleshoot AI-Assisted Transformations
267270

268-
If you have issues with the AI-assisted transformations, follow these steps:
271+
AI-assisted transformations in *Transformation Builder* provide comprehensive error feedback to help you resolve issues. Error messages indicate the type of error and provide guidance to resolve it.
272+
273+
If you encounter errors when using AI-assisted transformations, identify the error type and follow the corresponding resolution steps:
274+
275+
* <<troubleshoot-authorization-errors, Authorization Errors>>
276+
* <<troubleshoot-metadata-errors, Metadata Errors>>
277+
* <<troubleshoot-request-limit-errors, Request Limit Errors>>
278+
* <<troubleshoot-general-ai-errors, General AI Errors>>
279+
280+
[[troubleshoot-authorization-errors]]
281+
==== Authorization Errors
282+
283+
Authorization errors occur when your Anypoint Platform account lacks the required permissions or when Einstein generative AI isn't properly configured for your organization.
284+
285+
If you receive an authorization error:
286+
287+
. Verify that you are logged in to Anypoint Platform from Anypoint Code Builder.
288+
+
289+
For more information, see xref:start-acb.adoc#log-in-to-anypoint-platform-from-the-ide[Log in to Anypoint Platform from the IDE].
290+
. Contact your Anypoint Platform organization administrator to verify:
291+
+
292+
* You have the *Mule Developer Generative AI User* permission assigned in Anypoint Platform access management.
293+
* Einstein generative AI is enabled for your organization. For more information, see xref:access-management::enabling-einstein.adoc[Enabling Einstein for Anypoint Platform].
294+
* You have accepted the terms and conditions for using Einstein generative AI.
295+
* Your Anypoint Platform organization is current and active.
296+
. If you are the organization administrator, verify that:
297+
+
298+
* The Salesforce organization connected for requests has generative AI enabled.
299+
* The Salesforce organization has an xref:access-management::trusted-salesforce-org.adoc[established tenant relationship] with your Anypoint Platform organization, and the connection is enabled.
300+
* The Salesforce organization is valid and not expired or disabled.
301+
302+
[[troubleshoot-metadata-errors]]
303+
==== Metadata Errors
304+
305+
Metadata errors occur when the input or output metadata provided to *Map with AI* or *Map and Transform with AI* is invalid, missing, or improperly structured.
306+
307+
If you receive a metadata error:
308+
309+
. Verify that both input and output metadata are provided when using *Map with AI*.
310+
+
311+
*Map with AI* requires both input and output metadata to perform automatic field-to-field mapping.
312+
. Check that your metadata structure is valid:
313+
+
314+
* Ensure the metadata follows the expected schema format.
315+
* Verify that required fields are present in the metadata.
316+
* Confirm that data types match between input and output metadata where applicable.
317+
. Review the metadata source:
318+
+
319+
* If metadata is generated from sample data, ensure the sample data structure is correct.
320+
* If metadata is imported from an API specification, verify the specification is valid and complete.
321+
* Refresh metadata by clicking *More Actions* in *Transformation Builder* and selecting *Refresh metadata*.
322+
. For *Map and Transform with AI*, ensure that:
323+
+
324+
* Input sample data is provided and valid.
325+
* Output sample data is provided and valid.
326+
* Sample data formats match the expected MIME types. See <<sample-data>> for supported formats.
327+
328+
[[troubleshoot-request-limit-errors]]
329+
==== Request Limit Errors
330+
331+
Request limit errors occur when you exceed the rate limits for GenAI API requests. These limits help ensure fair usage and system stability.
332+
333+
If you receive a request limit error:
334+
335+
. Wait before retrying your request:
336+
+
337+
* The error message indicates when you can retry the request.
338+
* Avoid making multiple rapid requests in succession.
339+
. Reduce the frequency of AI-assisted transformation requests:
340+
+
341+
* Batch multiple transformations when possible.
342+
* Use manual mapping for simple transformations to reduce API calls.
343+
. Contact your Anypoint Platform organization administrator if:
344+
+
345+
* Request limits are consistently reached during normal usage.
346+
* You need to understand your organization's specific rate limits.
347+
. Consider alternative approaches:
348+
+
349+
* Use *Manually Adding Data Sources and Targets* for straightforward mappings. See <<manually-add-data-sources-targets>>.
350+
* Write DataWeave scripts manually for complex transformations that don't require AI assistance.
351+
352+
[[troubleshoot-general-ai-errors]]
353+
==== General AI Errors
354+
355+
If you encounter other errors with AI-assisted transformations:
269356

270357
. Log in to Anypoint Platform and try again.
271-
. Ask your Anypoint Platform admin to verify that generative AI is enabled for your organization.
272-
. If you're logged in to Anypoint Platform, and your organization has access to Einstein generative AI, accept the terms and conditions for using Einstein generative AI.
358+
. Verify that your Anypoint Platform organization has access to Einstein generative AI.
359+
. Ensure you have accepted the terms and conditions for using Einstein generative AI.
360+
. Check your network connection and try again.
361+
. If the error persists, contact your Anypoint Platform organization administrator or MuleSoft support.
273362

274363
[[manually-add-data-sources-targets]]
275364
=== Manually Adding Data Sources and Targets

0 commit comments

Comments
 (0)