From 401840166fd5c3e0e3ee63958b461c52e55ba85c Mon Sep 17 00:00:00 2001 From: mulesoft-es-automation-jenkins-onprem Date: Fri, 15 Nov 2024 17:45:32 +0000 Subject: [PATCH] Update docs for DataWeave support/2.9.x --- modules/ROOT/pages/_partials/nav-dw.adoc | 5 - .../pages/dataweave-system-properties.adoc | 128 +++++++++++------- .../ROOT/pages/dw-core-functions-match.adoc | 3 +- .../pages/dw-dates-functions-datetime.adoc | 3 +- .../dw-strings-functions-capitalize.adoc | 13 +- 5 files changed, 90 insertions(+), 62 deletions(-) diff --git a/modules/ROOT/pages/_partials/nav-dw.adoc b/modules/ROOT/pages/_partials/nav-dw.adoc index 62bac7514..750a1c529 100644 --- a/modules/ROOT/pages/_partials/nav-dw.adoc +++ b/modules/ROOT/pages/_partials/nav-dw.adoc @@ -258,11 +258,6 @@ *** xref:dw-multipart-functions-form.adoc[form] *** xref:dw-multipart-functions-generateboundary.adoc[generateBoundary] *** xref:dw-multipart-types.adoc[Multipart Types] -** xref:dw-mule.adoc[dw::Mule] -*** xref:dw-mule-functions-causedby.adoc[causedBy] -*** xref:dw-mule-functions-lookup.adoc[lookup] -*** xref:dw-mule-functions-p.adoc[p] -*** xref:dw-mule-types.adoc[Mule Types] ** xref:dw-runtime.adoc[dw::Runtime] *** xref:dw-runtime-functions-dataformatsdescriptor.adoc[dataFormatsDescriptor] *** xref:dw-runtime-functions-eval.adoc[eval] diff --git a/modules/ROOT/pages/dataweave-system-properties.adoc b/modules/ROOT/pages/dataweave-system-properties.adoc index 0c540fa5c..ef4deb257 100644 --- a/modules/ROOT/pages/dataweave-system-properties.adoc +++ b/modules/ROOT/pages/dataweave-system-properties.adoc @@ -26,7 +26,7 @@ Sets the size (in bytes) of in-memory input and output buffers that DataWeave us |`com.mulesoft.dw.charbuffersize`| Determines the size (in bytes) of the buffer used by the writer. -* Type: `Number` (in bytes) +* Type: `Integer` * Default: `4096` @@ -64,14 +64,17 @@ output application/dw * Type: `Boolean` -* Default: `false` +* Default: ` + false for language levels: 2.3, 2.4 + + false for language levels: 2.5` Available for language levels: 2.3, 2.4, 2.5 //com.mulesoft.dw.decode_binaries_with_writer_encoding// |`com.mulesoft.dw.decode_binaries_with_writer_encoding`| -When set to `true`, binary values in JSON are written using JsonWriter encoding. Otherwise, the property uses either the encoding defined in the value schema or the default one. +If set, then binary values in json are written using JsonWriter encoding, otherwise it will use either the encoding defined in the value schema or the default one. * Type: `Boolean` * Default: `false` @@ -80,13 +83,16 @@ When set to `true`, binary values in JSON are written using JsonWriter encoding. //com.mulesoft.dw.defaultOperator.disableExceptionHandling// |`com.mulesoft.dw.defaultOperator.disableExceptionHandling`| -When set to `true`, DataWeave disables the `default` operator that catches runtime exceptions. -Enabling the `default` operator doesn’t return the `default value` when a runtime exception occurs. -When set to `false`, the `default` operator catches the runtime exceptions and returns the `default value`. +When set to `true` disable the `default` operator to catch runtime exceptions. +Enabling this behavior `default` operator does not return the `default value` when a runtime exception occurs. +When set to `false` the `default` operator catches the runtime exceptions and returns the `default value`. * Type: `Boolean` -* Default: `true` +* Default: ` + false for language levels: + + true for language levels: 2.5, 2.6, 2.7, 2.8, 2.9` Available for language levels: 2.5, 2.6, 2.7, 2.8, 2.9 @@ -106,7 +112,8 @@ _Experimental:_ Dumps the input context and the failing script into a folder whe * Type: `Boolean` * Default: `false` -`com.mulesoft.dw.dump_files` is an _experimental feature_ that is subject to change or removal from future versions of DataWeave. See xref:dataweave-troubleshoot.adoc[]. +` +com.mulesoft.dw.dump_files` is an _experimental feature_ that is subject to change or removal from future versions of DataWeave. See xref:dataweave-troubleshoot.adoc[]. //com.mulesoft.dw.dump_folder// |`com.mulesoft.dw.dump_folder`| @@ -115,7 +122,8 @@ _Experimental:_ Specifies the path in which to dump files when `com.mulesoft.dw. * Type: `String` * Default: `java.io.tempdir (system property value)` -`com.mulesoft.dw.dump_folder` is an _experimental feature_ that is subject to change or removal from future versions of DataWeave. See xref:dataweave-troubleshoot.adoc[]. +` +com.mulesoft.dw.dump_folder` is an _experimental feature_ that is subject to change or removal from future versions of DataWeave. See xref:dataweave-troubleshoot.adoc[]. //com.mulesoft.dw.dumper_fill_stacktrace// |`com.mulesoft.dw.dumper_fill_stacktrace`| @@ -124,13 +132,14 @@ _Experimental:_ Adds the StackTrace for dumper exceptions when `com.mulesoft.dw. * Type: `Boolean` * Default: `false` -`com.mulesoft.dw.dumper_fill_stacktrace` is an _experimental feature_ that is subject to change or removal from future versions of DataWeave. See xref:dataweave-troubleshoot.adoc[]. +` +com.mulesoft.dw.dumper_fill_stacktrace` is an _experimental feature_ that is subject to change or removal from future versions of DataWeave. See xref:dataweave-troubleshoot.adoc[]. //com.mulesoft.dw.error_value_length// |`com.mulesoft.dw.error_value_length`| Sets the maximum length of exception messages to display to the user. The message is truncated to the maximum length. This setting is useful for avoiding long exception messages. -* Type: `Number` +* Type: `Integer` * Default: `80` @@ -138,30 +147,45 @@ Sets the maximum length of exception messages to display to the user. The messag |`com.mulesoft.dw.indexsize`| Sets the maximum size (in bytes) of the page in memory that indexed readers use. -* Type: `Number (in bytes)` +* Type: `Integer` * Default: `1572864` //com.mulesoft.dw.java.disable_set_accessible// |`com.mulesoft.dw.java.disable_set_accessible`| -When set to `true`, the JavaModuleLoader doesn’t change the accessible flag for fields or methods used via reflection. The default value evaluates the current JDK version used and the language level. The value is `true` when the used JDK is 17 or later and the language version is 2.6 or later. +When set to `true` the JavaModuleLoader does not change the accessible flag for fields or methods used via reflection. The default value evaluates the current JDK version used and the language level. The value is `true` when the used JDK is 17+ and the language version is bigger than 2.6 * Type: `Boolean` -* Default: - ** `false` for language levels: 2.5 +* Default: ` + false for language levels: 2.5 - ** `true` for language levels: 2.6, 2.7, 2.8, 2.9 + true for language levels: 2.6, 2.7, 2.8, 2.9` Available for language levels: 2.5, 2.6, 2.7, 2.8, 2.9 +//com.mulesoft.dw.java.honour_bean_definition_accessor// +|`com.mulesoft.dw.java.honour_bean_definition_accessor`| + +When set to `true` the JavaModuleLoader honour the bean definition by using the setter/getter methods to access properties via reflection at object value selectors.If it is set to `false`, the JavaModuleLoader uses the setter/getter methods to access properties if exists or it uses the field accessor as default. + +* Type: `Boolean` + +* Default: ` + false for language levels: 2.8 + + true for language levels: 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15` + +Available for language levels: 2.8, 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2.15 + + //com.mulesoft.dw.java.stacktrace// |`com.mulesoft.dw.java.stacktrace`| -Specifies the depth of the Java stack trace. +Specifies the depth of the Java stack trace -* Type: `Number` +* Type: `Integer` * Default: `6` @@ -172,10 +196,10 @@ When set, `java.sql.Date` maps to the DataWeave `Date` type. If `false`, it maps * Type: `Boolean` -* Default: - ** `false` for language levels: 2.4 +* Default: ` + false for language levels: 2.4 - ** `true` for language levels: 2.5 + true for language levels: 2.5` Available for language levels: 2.4, 2.5 @@ -184,7 +208,7 @@ Available for language levels: 2.4, 2.5 |`com.mulesoft.dw.max_memory_allocation`| Sets the size (in bytes) of each slot in the off-heap memory pool. DataWeave stores payloads that exceed this size in temporary files `dw-buffer-input-${count}.tmp` and `dw-buffer-output-${count}.tmp`. -* Type: `Number (in bytes)` +* Type: `Integer` * Default: `1572864` @@ -192,7 +216,7 @@ Sets the size (in bytes) of each slot in the off-heap memory pool. DataWeave sto |`com.mulesoft.dw.memory_pool_size`| Sets the number of slots in the memory pool. DataWeave buffers use off-heap memory from a pool, up to a defined size (`com.mulesoft.dw.memory_pool_size` * `com.mulesoft.dw.max_memory_allocation`). DataWeave allocates the remainder using heap memory. See xref:dataweave-memory-management.adoc[DataWeave Memory Management]. -* Type: `Number` +* Type: `Integer` * Default: `60` @@ -206,9 +230,9 @@ Sets the default Content-Type to use on parts of the `multipart/*` format when a //com.mulesoft.dw.scheduler.size// |`com.mulesoft.dw.scheduler.size`| -Specifies the size of DataWeave scheduler thread pool. +Specifies the size of DataWeave scheduler thread pool -* Type: `Number` +* Type: `Integer` * Default: `100` @@ -216,15 +240,15 @@ Specifies the size of DataWeave scheduler thread pool. |`com.mulesoft.dw.stacksize`| Sets the maximum size of the stack. When a function recurses too deeply, DataWeave throws an error, such as Stack Overflow. The maximum size limit is 256. -* Type: `Number` +* Type: `Integer` * Default: `256` //com.mulesoft.dw.stripTrailingZeroes// |`com.mulesoft.dw.stripTrailingZeroes`| -When set to `false`, DataWeave restores the behavior of preserving trailing zeroes for some formats (such as DataWeave, JSON, and YAML) present in 2.4.0. -Starting with 2.5.0, trailing zeroes are removed by default. +When set to false restores the behavior of preserving trailing zeroes for some formats (e.g.: dw, json, yaml) present in 2.4.0 +Since 2.5.0 trailing zeroes are removed by default. .DataWeave script: [source,xml,linenums] ---- @@ -241,10 +265,10 @@ output application/json * Type: `Boolean` -* Default: - ** `false` for language levels: +* Default: ` + false for language levels: - ** `true` for language levels: 2.5, 2.6, 2.7, 2.8, 2.9 + true for language levels: 2.5, 2.6, 2.7, 2.8, 2.9` Available for language levels: 2.5, 2.6, 2.7, 2.8, 2.9 @@ -253,7 +277,7 @@ Available for language levels: 2.5, 2.6, 2.7, 2.8, 2.9 |`com.mulesoft.dw.telemetry.bufferSize`| Determines the size in bytes of the telemetry event buffer. -* Type: `Number (in bytes)` +* Type: `Integer` * Default: `1048576` @@ -267,7 +291,7 @@ Enables Dataweave telemetry service. //com.mulesoft.dw.telemetry.memory// |`com.mulesoft.dw.telemetry.memory`| -When set to `true`, the telemetry service collects memory usage statistics. +If set, then the telemetry service will collect memory usage statistics * Type: `Boolean` * Default: `false` @@ -275,7 +299,7 @@ When set to `true`, the telemetry service collects memory usage statistics. //com.mulesoft.dw.telemetry.sync// |`com.mulesoft.dw.telemetry.sync`| -When set to `true`, telemetry events are published synchronously. +If set, then telemetry events are published synchronously. * Type: `Boolean` * Default: `false` @@ -292,7 +316,7 @@ When set to `true`, tracks the stack trace from which the {CursorProvider#close( //com.mulesoft.dw.valueSelector.selectsAlwaysFirst// |`com.mulesoft.dw.valueSelector.selectsAlwaysFirst`| -When set to `true`, returns the first occurrence of an element (even if the element appears more than once). Enabling this behavior degrades performance. +When set to set to `true`, returns the first occurrence of an element (even if the element appears more than once). Enabling this behavior degrades performance. The following example illustrates the behavior that is controlled by this property. (Assume that the DataWeave script acts on the XML input.) @@ -351,14 +375,17 @@ output application/json * Type: `Boolean` -* Default: `false` +* Default: ` + false for language levels: 2.3, 2.4 + + false for language levels: 2.5` Available for language levels: 2.3, 2.4, 2.5 //com.mulesoft.dw.workingdirectory.base// |`com.mulesoft.dw.workingdirectory.base`| -Specifies the base directory in which temporary files are written. +Specifies the base directory in which temporary files will be written * Type: `String` * Default: `java.io.tmpdir (system property value)` @@ -374,9 +401,9 @@ File deletion occurs synchronously when this property is set to `true`. //com.mulesoft.dw.workingdirectory.max_output_buffer_size// |`com.mulesoft.dw.workingdirectory.max_output_buffer_size`| -Specifies the maximum size of a file written in bytes. +Specifies the maximum size of a file to be written in bytes -* Type: `Number (in bytes)` +* Type: `Long` * Default: `-1` @@ -399,14 +426,14 @@ Controls whether DTD handling is enabled or disabled. When this property is set //com.mulesoft.dw.xml_reader.honourMixedContentStructure// |`com.mulesoft.dw.xml_reader.honourMixedContentStructure`| -When set to `true`, DataWeave retains a mixed-content structure instead of grouping text with mixed content into a single text field. +When this property is set to `true`, DataWeave retains a mixed-content structure instead of grouping text with mixed content into a single text field. * Type: `Boolean` -* Default: - ** `false` for language levels: 2.4 +* Default: ` + false for language levels: 2.4 - ** `true` for language levels: 2.5 + true for language levels: 2.5` Available for language levels: 2.4, 2.5 @@ -414,14 +441,14 @@ Available for language levels: 2.4, 2.5 //com.mulesoft.dw.xml_writer.declareXmlNamespace// |`com.mulesoft.dw.xml_writer.declareXmlNamespace`| -When set to `false`, DataWeave doesn’t declare the `xml` implicit namespace. +When this property is set to `false`, DataWeave does not declare the `xml` implicit namespace. * Type: `Boolean` -* Default: - ** `true` for language levels: 2.4, 2.5 +* Default: ` + true for language levels: 2.4, 2.5 - ** `false` for language levels: 2.6 + false for language levels: 2.6` Available for language levels: 2.4, 2.5, 2.6 @@ -429,11 +456,14 @@ Available for language levels: 2.4, 2.5, 2.6 //mule.dw.java_module_loader_deterministic_functions_ordering// |`mule.dw.java_module_loader_deterministic_functions_ordering`| -When set to `true`, the JavaModuleLoader loads the methods for Java Classes in deterministic order. DataWeave considers the method name, the parameters count, and finally, the parameter type name. +When set to true the JavaModuleLoader loads the methods for Java Classes in deterministic order. DataWeave considers the method name, the parameters count, and finally, the parameter type name. * Type: `Boolean` -* Default: `true` +* Default: ` + false for language levels: + + true for language levels: 2.5, 2.6` Available for language levels: 2.5, 2.6 diff --git a/modules/ROOT/pages/dw-core-functions-match.adoc b/modules/ROOT/pages/dw-core-functions-match.adoc index def77326a..52f6b5764 100644 --- a/modules/ROOT/pages/dw-core-functions-match.adoc +++ b/modules/ROOT/pages/dw-core-functions-match.adoc @@ -30,7 +30,7 @@ statements]. In this example, the regex matches the input email address and contains two capture groups within parentheses (located before and after the `@`). The result is an array of elements: The first matching the entire regex, the -second matching the initial capture group (`[a-z]*`) in the regex, the +second matching the initial capture group (`[a-z]*`) in the the regex, the third matching the last capture group (`[a-z]*`). ==== Source @@ -86,3 +86,4 @@ output application/json Helper function that enables `match` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ + diff --git a/modules/ROOT/pages/dw-dates-functions-datetime.adoc b/modules/ROOT/pages/dw-dates-functions-datetime.adoc index 6bdf4616a..9146d4ebd 100644 --- a/modules/ROOT/pages/dw-dates-functions-datetime.adoc +++ b/modules/ROOT/pages/dw-dates-functions-datetime.adoc @@ -19,7 +19,7 @@ _Introduced in DataWeave version 2.4.0._ |=== | Name | Description | `parts` | `Number` values for `year`, `month`, `day`, `hour`, `minutes`, and - `seconds` fields followed by a `TimeZone` value for the `timezone` + `seconds` fields followed by a `TimeZone` value for the the `timezone` field. Valid values are numbers between 1 and 12 for the `month`, 1 through 31 for the `day`, 0 through 23 for the `hour`, 0 through 59 for `minutes`, and 0 through 59 (including decimals, such as 59.99) for seconds. You can specify the name-value pairs in any @@ -53,3 +53,4 @@ output application/json "newDateTime": "2012-10-11T12:30:40-03:00" } ---- + diff --git a/modules/ROOT/pages/dw-strings-functions-capitalize.adoc b/modules/ROOT/pages/dw-strings-functions-capitalize.adoc index 545c251dd..0ac253d86 100644 --- a/modules/ROOT/pages/dw-strings-functions-capitalize.adoc +++ b/modules/ROOT/pages/dw-strings-functions-capitalize.adoc @@ -8,9 +8,11 @@ endif::[] [[capitalize1]] == capitalize(text: String): String -Capitalizes the first letter of each word in a string. +Capitalizes the first letter of each word in a string. -The function treats every non-alphabetic character as a separator and replaces underscores with spaces. For example, `capitalize("a*s_b’s")` results in `"A*S B’S"`. + +It also removes underscores between words and puts a space before each +capitalized word. === Parameters @@ -36,8 +38,7 @@ output application/json "a" : capitalize("customer"), "b" : capitalize("customer_first_name"), "c" : capitalize("customer NAME"), - "d" : capitalize("customerName"), - "e" : capitalize("a*s_b’s") + "d" : capitalize("customerName") } ---- @@ -49,8 +50,7 @@ output application/json "a": "Customer", "b": "Customer First Name", "c": "Customer Name", - "d": "Customer Name", - "e": "A*S B’S" + "d": "Customer Name" } ---- @@ -59,3 +59,4 @@ output application/json == capitalize(text: Null): Null Helper function that enables `capitalize` to work with a `null` value. +