-
Notifications
You must be signed in to change notification settings - Fork 519
BasicDataWeaveInApexRecipes
pozil edited this page Nov 14, 2024
·
4 revisions
Demonstrates various ways of invoking a DataWeave scripts in Apex. Note that this class demonstrates both static and dynamic way of invoking DataWeave scripts.
Group DataWeaveInApex Recipes
Invokes a DataWeave script in Apex using static invocation.
Uses the /dw/helloWorld.dwl DataWeave script to log a message.
This shows how to invoke the script using the Apex class that is automatically
generated by the platform from the DataWeave script. The DataWeave script is deployed as metadata.
| Type | Description |
|---|---|
String |
output of the DataWeave script as a string (hard coded to "Hello World") |
Invokes a DataWeave script in Apex using dynamic invocation thanks to DataWeave.Script.createScript().
| Param | Description |
|---|---|
scriptName |
name of the DataWeave metadata to invoke |
| Type | Description |
|---|---|
String |
output of the DataWeave script as a string |