BassemE/mulesoft-documentation-embeddings huggingface dataset:
Email Connector XML and Maven Support | MuleSoft Documentation
# Email Connector XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio.
If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
When you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file.
## Add a Namespace for the Connector
Paste the following code inside the `<mule>` tag of the header of your configuration XML:
```
http://www.mulesoft.org/schema/mule/email>
http://www.mulesoft.org/schema/mule/email/current/mule-email.xsd
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<mule xmlns:email="http://www.mulesoft.org/schema/mule/email"
	xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:file="http://www.mulesoft.org/schema/mule/file"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
	http://www.mulesoft.org/schema/mule/file
	http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
	http://www.mulesoft.org/schema/mule/http
	http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
	http://www.mulesoft.org/schema/mule/ee/core
	http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
	http://www.mulesoft.org/schema/mule/email
	http://www.mulesoft.org/schema/mule/email/current/mule-email.xsd">
```

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector:
```
<dependency>
 <groupId>org.mule.connectors</groupId>
 <artifactId>mule-email-connector</artifactId>
 <version>x.x.x</version>
 <classifier>mule-plugin</classifier>
</dependency>
```

Replace `x.x.x` with the version that corresponds to the connector you are using.
To obtain the most up-to-date `pom.xml` file information:
  1. Go to Anypoint Exchange.
  2. In Exchange, click **Login** and supply your Anypoint Platform username and password.
  3. In Exchange, search for `email`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Pass XML Attributes | MuleSoft Documentation
# Pass XML Attributes
DataWeave enables you to pass attributes from within an XML tag input source to the target output XML. The DataWeave example shows how to pass the XML attributes in the `NameDetail` field of the input source payload to the `TargetName` field of the XML output.
This example uses: - `.*` multivalue selector that returns an array of `NameDetail` elements. - `map` function to iterate over the array of NameDetail elements of the input. - The dynamic attribute expression `@dynamicAttributes` to create the attributes of the new output tag by selecting the attributes dynamically from the input.
DataWeave Script:
```
%dw 2.0
output application/xml
---
{
  Result: {
    (payload.Names.*NameDetail map ( nameDetail , indexOfNameDetail ) -> {
      TargetName @((nameDetail.@)): {
        item: nameDetail.item
      }
    })
  }
}
```

Input XML Payload:
```
<?xml version="1.0" encoding="UTF-8"?>
   <Names>
     <NameDetail NameId="11111" NameType="Person" Name="Richarson" GivenNames="John" PreferredLanguage="English" CompanyNumber="" Gender="Male" Title="" >
      <item>doo</item>
     </NameDetail>
     <NameDetail NameId="22222" NameType="Person" Name="Richarson" GivenNames="Susan" PreferredLanguage="Spanish" CompanyNumber="" Gender="Female" Title="" >
      <item>dah</item>
     </NameDetail>
     <NameDetail NameId="33333" NameType="Person" Name="Knox" GivenNames="Frances" PreferredLanguage="English" CompanyNumber="" Gender="Male" Title="" >
      <item>dab</item>
     </NameDetail>
   </Names>
```

Output XML:
```
<?xml version='1.0' encoding='UTF-8'?>
<Result>
 <TargetName NameId="11111" NameType="Person" Name="Richarson" GivenNames="John" PreferredLanguage="English" CompanyNumber="" Gender="Male" Title="">
  <item>doo</item>
 </TargetName>
 <TargetName NameId="22222" NameType="Person" Name="Richarson" GivenNames="Susan" PreferredLanguage="Spanish" CompanyNumber="" Gender="Female" Title="">
  <item>dah</item>
 </TargetName>
 <TargetName NameId="33333" NameType="Person" Name="Knox" GivenNames="Frances" PreferredLanguage="English" CompanyNumber="" Gender="Male" Title="">
  <item>dab</item>
 </TargetName>
</Result>
```

## Related Examples
  * Output Self-closing XML tags
  * Insert an Attribute into an XML Tag
  * Include XML Namespaces
  * Exclude Fields from the Output
  * Output a Field When Present
  * Conditionally Reduce a List through a Function


## See Also
  * DataWeave Selectors
  *
Troubleshooting Self-Managed Gateway Logging Issues | MuleSoft Documentation
# Troubleshooting Self-Managed Gateway Logging Issues
When configuring logging for Anypoint Flex Gateway, you might encounter logging issues caused by incorrect directory permissions, and so on. The following topics provide possible causes for logging issues and describe how to troubleshoot:
  * Logs Do Not Appear in a Third-Party Logging Service
  * Logs Do Not Appear when Running in a VM


## Logs Do Not Appear in a Third-Party Logging Service
After applying a logging configuration YAML file, logs should begin appearing within a few minutes. If your logs do not appear in your third party logging service:
  1. Ensure that your third-party service is running.
  2. If the service is running, check the runtime logs for potential configuration errors.
You can view the runtime logs for both Flex Gateways running in Connected Mode and Local Mode by following the steps in Viewing Standard Output Logs. Additionally, for Flex Gateways running in Connected Mode, you can view runtime logs in Runtime Manager.
Potential configuration errors appear similar to the following:
```
[flex-gateway-fluent] [2023/09/07 20:17:49] [error] [output:http:http.1] hzk83039.live.dynatrace.com:443, HTTP status=401
[flex-gateway-fluent] {"error":{"code":401,"message":"Missing authorization parameter."}}
[flex-gateway-fluent] [2023/09/07 20:17:49] [ warn] [engine] failed to flush chunk '20-1694117863.683606251.flb', retry in 7 seconds: task_id=2, input=emitter_for_rewrite_tag.11 > output=http.1 (out_id=1)
```

  3. Whether or not configuration errors appear in the runtime logs, view the /var/tmp/mulesoft/flex-gateway/fluent-bit.conf file to ensure your configuration values are correct.


## Logs Do Not Appear when Running in a VM
Log files do not appear after specifying a target log directory in an access log policy. An example log directory might be `/var/log`.
### Cause
Your log output directory might not have `write` permission.
### Solution
To resolve this issue, grant `write` permission to the output directory.
min | MuleSoft Documentation
# min
## min<T <: Comparable>(@StreamCapable values: Array<T>): T | Null
Returns the lowest `Comparable` value in an array.
The items must be of the same type or `min` throws an error. The function returns `null` if the array is empty.
### Parameters
Name | Description  
---|---  
The input array. The elements in the array can be any supported type.  
### Example
This example returns the lowest numeric value of each input array.
#### Source
```
%dw 2.0
output application/json
---
{ a: min([1, 1000]), b: min([1, 2, 3]), c: min([1.5, 2.5, 3.5]) }
```

#### Output
```
{ "a": 1, "b": 1, "c": 1.5 }
```
dasherize | MuleSoft Documentation
# dasherize
## dasherize(text: String): String
Replaces spaces, underscores, and camel-casing in a string with dashes (hyphens).
If no spaces, underscores, and camel-casing are present, the output will match the input.
### Parameters
Name | Description  
---|---  
The input string.  
### Example
This example replaces the spaces, underscores, and camel-casing in the input. Notice that the input "customer" is not modified in the output.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
 "a" : dasherize("customer"),
 "b" : dasherize("customer_first_name"),
 "c" : dasherize("customer NAME"),
 "d" : dasherize("customerName")
}
```

#### Output
```
{
 "a": "customer",
 "b": "customer-first-name",
 "c": "customer-name",
 "d": "customer-name"
}
```

## dasherize(text: Null): Null
Helper function that enables `dasherize` to work with a `null` value.
Coercions Types (dw::util::Coercions) | MuleSoft Documentation
# Coercions Types (dw::util::Coercions)
Type | Definition | Description  
---|---|---  
Formatter |  `type Formatter = { format?: String, locale?: String }` |  Type used for formatting `Dates` types and `Number`. Supports the following fields:
  * `format`: (optional) The ISO-8601 formatting to use on the date or time. For example, this parameter accepts character patterns based on the Java 8 `java.time.format`. A `null` value has no effect on the value.
  * `locale`: (optional) ISO 3166 country code to use, such as `US`, `AR`, or `ES`. A `null` or absent value uses your JVM default. When you pass a translatable format, such as `eeee` and `MMMM`, a `locale` (such as `ES`) transforms the corresponding numeric values to a localized string.

  
MillisOrSecs |  `type MillisOrSecs = "milliseconds" | "seconds"` |  Type used for setting units to `"milliseconds"` or `"seconds"`.  
PeriodUnits |  `type PeriodUnits = "hours" | "minutes" | "seconds" | "milliseconds" | "nanos"` |  Type used for setting units of a `Period` value to `"hours"`, `"minutes"`, `"seconds"`, `"milliseconds"`, or `"nanos"`.  
RoundingMode |  `type RoundingMode = "UP" | "DOWN" | "CEILING" | "FLOOR" | "HALF_UP" | "HALF_DOWN" | "HALF_EVEN"` |  Type used when rounding decimal values up or down.
Dedicated Load Balancer Allowlists | MuleSoft Documentation
# Dedicated Load Balancer Allowlists
If you want to allow IP addresses access to your dedicated load balancer (DLB), you must add those IP addresses, in CIDR notation, to the allowlist of the DLB.
The allowlist works for inbound connections at the load-balancer level only, not at the CN certificate level.   
---  
You can either add the allowed IP addresses when you create the DLB or add them to an existing DLB using either Runtime Manager or the command-line interface.
## DLB Allowlist Entry Limits
The maximum number of IP address entries that you can add to the DLB allowlist depends on the inbound HTTP mode setting in the DLB configuration, which specifies the behavior of the DLB when receiving an HTTP request.
Inbound HTTP Mode | Maximum Allowlist Entries  
---|---  
If the number of entries in the DLB allowlist exceeds 120, you can’t set HTTP mode to **On**.   
---  
## Add an IP Address to the Allowlist of an Existing DLB
To add an IP address to the allowlist of a DLB using Runtime Manager:
  1. From Anypoint Platform, click **Runtime Manager**.
  2. Click **Load Balancers** and then click the load balancer name.
  3. In the **Allowlisted CIDRs** tab, click **Add New CIDR** :
Figure 1. The arrow shows the **Add New CIDR** option in the **Allowlisted CIDRs** tab.
  4. Enter the IP address in valid CIDR format (for example, `10.2.0.0/16`).
  5. Click **Add To List**.
  6. If you want to delete a CIDR, hover over the **…​** icon to display the trash can icon.
  7. Click **Apply Changes**.


To add a range of IP addresses to the allowlist for a DLB using the CLI:
```
cloudhub load-balancer allowlist add myLB_name myCIDRblock
```

The IP addresses must be in valid CIDR format (for example, `10.2.0.0/16`).
If you want to remove IP addresses from the allowlist:
```
cloudhub load-balancer allowlist remove myLB_name myCIDRblock
```

## See Also
  * cloudhub load-balancer allowlist add
  * cloudhub load-balancer allowlist remove
  *   * Create a Load Balancer with Runtime Manager
  * Create a Load Balancer with the Anypoint Platform CLI
  * Internal Worker DNS vs Internal DLB DNS in CloudHub
Anypoint Platform CLI Release Notes | MuleSoft Documentation
# Anypoint Platform CLI Release Notes
Anypoint Platform CLI is a scripting and command-line tool for Anypoint Platform and Anypoint Platform Private Cloud Edition (Anypoint Platform PCE).
The following release notes are provided for Anypoint Platform CLI:
  * Anypoint Platform CLI 4.x
  * Anypoint Platform CLI 3.x


## See Also
  * Anypoint CLI Documentation
Google BigQuery Connector 1.1 | MuleSoft Documentation
# Google BigQuery Connector 1.1
Anypoint Connector for Google BigQuery (Google BigQuery Connector) syncs data and automates business processes between Google BigQuery and third-party applications, either on-premises or in the cloud.
For information about compatibility and fixed issues, refer to the Google BigQuery Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Google BigQuery API
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * How to create a Mule app using Anypoint Studio


Before creating an app, you must have:
  * Credentials to access the Google BigQuery target resource
  * Anypoint Platform
  * Anypoint Studio version 7.3.5 or later


## Common Use Cases For the Connector
These are some common use cases for Google BigQuery Connector:
  * Use log and event data collection to analyze problems
  * Insert, update, and delete data in Google BigQuery
  * Execute a query in Google BigQuery


For examples of these use cases, refer to Google BigQuery Connector Examples.
## Connection Types
Google BigQuery connections use the following authentication types:
  * JWT Connection Uses a token for authentication
  * OAuth2 Connection Uses service account authentication


For information about configuring authentication types, refer to Configure a Global Element for the Connector.
## Next Step
After you complete the prerequisites, you are ready to create an app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Google BigQuery Connector Reference
  * MuleSoft Help Center
Troubleshooting NetSuite Restlet Connector | MuleSoft Documentation
# Troubleshooting NetSuite Restlet Connector
You might encounter the following issues when working with the Anypoint Connector for NetSuite Restlet (NetSuite Restlet Connector):
  * Connectivity test failure during application startup.
  * The connector returns a permissions error when fetching metadata.


## Connectivity Test Failure During Application Startup
If a connectivity test fails during application startup and you see the following statement in the stack trace, configure a reconnection strategy for the connector:
```
Caused by: java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:998) ~[?:1.8.0_221]
```

To configure a reconnection strategy for the connector in Anypoint Studio (Studio), add these lines to the **Configure XML** tab in the connector properties window:
```
<reconnection failsDeployment="true">
	<reconnect count="2" frequency="5" />
</reconnection>
```

For example, the configuration XML for the connector might look like this after you add the reconnection strategy:
```
<netsuite-restlet:rest-config name="NetSuite_Config" doc:name="NetSuite Config" doc:id="8a4f73c2-e5e1-4f5d-8978-980069828ff0" >
	<netsuite-restlet:restlet-login-connection email="${netsuite.email}" password="${netsuite.password}" account="${netsuite.account}" roleId="${netsuite.roleId}" applicationId="${netsuite.applicationId}" readTimeout="60000" connectionTimeout="60000">
		<reconnection failsDeployment="true">
			<reconnect count="2" frequency="5" />
		</reconnection>
	</netsuite-restlet:restlet-login-connection>
```

In Studio, you can also use the **Advanced** tab in the connector properties window to configure a reconnection strategy. To do so, complete the following fields:
Reconnection strategy  
---  
Frequency (ms)  
Reconnection Attempts  
## Permissions Error When Fetching Metadata
To avoid receiving a permissions error when fetching metadata, enable the `Control SuiteScript and Workflow Triggers in Web Services Request` option in NetSuite for the role used in the connector configuration.
## Inability to Search for Certain Types of Objects
There is a limitation in NetSuite’s SuiteTalk API, that prevents you from searching for certain types of objects, such as Sales Order objects. Because of this limitation, you can’t use the NetSuite Connector `Search` operation to locate these objects.
To perform a search for Sales Order objects and other unsupported objects, you can do the following:
  * Develop a SuiteScript, deploy it as a RESTlet, and call it from the connector.


## Empty Payload in the Call RESTlet (GET) Operation
Even though the **Call RESTlet (GET)** operation is a GET operation, you must specify a payload for the **Data** field or else the connector throws an error. You can specify an empty payload, such as `{}`, to avoid this error.
## See Also
  * MuleSoft Help Center
  *
SFTP Connector 1.3 | MuleSoft Documentation
# SFTP Connector 1.3
Anypoint Connector for SFTP (SFTP Connector) provides access to files and folders on an SFTP server. SFTP connector operations manage file transfers over the SFTP (Secure File Transfer Protocol) protocol. The connector’s main features include:
  * The ability to read files or list directory contents on demand
  * Support for common SFTP operations such as creating directories, copying, moving, renaming, and deleting files
  * Support for locking files
  * File matching functionality
  * A design that is consistent with that of File Connector and FTP Connector
The same set of operations is available on these connectors, and they behave similarly.


## Representation of File Attributes
Mule 4 provides a message structure of a payload and attributes in which the data moves around, making that payload a file content. The attributes provide an object that contains metadata on the payload and information such as the file’s name, path, size, and timestamps. For FTP Connector and SFTP Connector, these attributes are known as _file attributes_.
The Mule message contains the concepts of encoding and MIME type. These describe the format in which a payload is represented. The file attributes describe a file’s encoding and MIME type.
## Before You Begin
To use this connector, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have access to Anypoint Platform and Anypoint Studio.
## Next Step
After you complete the prerequisites, you are ready to create your own app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Azure Service Bus Connector 3.1 | MuleSoft Documentation
# Azure Service Bus Connector 3.1
Anypoint Connector for Azure Service Bus (Azure Service Bus Connector) makes it easy to build integrations that send messages to and receive messages from Azure Service Bus, which is an asynchronous messaging cloud platform. This connector supports communication with queues and topics and can perform actions such as:
  * Send to queue
  * Send to topic
  * Receive from queue
  * Receive from subscription


To use the Azure management API for CRUD operations of queues, topics, subscriptions, and rules, use Anypoint Connector for Azure Service Bus Management (Azure Service Bus Management Connector).
This connector supports integrations with Azure Service Bus (cloud). It does not work with Microsoft Service Bus (on-premises). To connect with Microsoft Service Bus on-premises, use Anypoint Connector for Microsoft Service Bus.   
---  
For compatibility information and fixed issues, see the release notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Azure Service Bus APIs
  * Anypoint connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * How to create a Mule app using Anypoint Studio


Before creating an app, you must have:
  * Access to the Azure target resource
  * OpenJDK 8
  * Anypoint Studio 7.1.0 or later
  * Mule Runtime 4.2.x EE or later


## Audience
  * New user
To create your Mule app, see:
  *   * Examples, which provides one or more use cases for the connector.
  * Advanced user
  * Read the following:
  * XML and Maven Support
  * Examples topics


## Authentication Types
Azure Service Bus Connector uses the SAS (shared access signature) authentication connection type to connect to Azure.
For information about configuring these authentication types, see Using Anypoint Studio to Configure Azure Service Bus Connector.
## Next Step
After you complete the prerequisites and experiment with templates and examples, you are ready to create an app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Azure Service Bus Connector Release Notes
  * Azure Service Bus Management Connector
  * Azure Service Bus Connector on Exchange
  * MuleSoft Help Center
Anypoint Platform Private Cloud Edition Release Notes | MuleSoft Documentation
# Anypoint Platform Private Cloud Edition Release Notes
  * Anypoint Platform Private Cloud Edition 4.1.0 Release Notes
  * Anypoint Platform Private Cloud Edition 4.0.0 Release Notes
  * Anypoint Platform Private Cloud Edition 3.2.5 Release Notes
  * Anypoint Platform Private Cloud Edition 3.2.4 Release Notes
  * Anypoint Platform Private Cloud Edition 3.2.3 Release Notes
  * Anypoint Platform Private Cloud Edition 3.2.2 Release Notes
  * Anypoint Platform Private Cloud Edition 3.2.1 Release Notes
  * Anypoint Platform Private Cloud Edition 3.2.0 Release Notes
  * Anypoint Platform Private Cloud Edition 3.1.3 Release Notes
  * Anypoint Platform Private Cloud Edition 3.1.2 Release Notes
  * Anypoint Platform Private Cloud Edition 3.1.1 Release Notes
  * Anypoint Platform Private Cloud Edition 3.1.0 Release Notes
Designing API Specs and Fragments | MuleSoft Documentation
# Designing API Specs and Fragments
Use API Designer to create, design, test, and publish new API Specifications.
## Design Using the Text or Visual Editor
You can use either the text editor or the Visual Editor to create API specifications.
With the text editor, you can:
  * Design according to best practices with a context-aware shelf that auto-populates with the appropriate methods, resources, parameters, and security components.
  * Include RAML API fragments, such as security schemas and data types, from Exchange or write your own.
  * Apply rulesets from Exchange to validate the governance conformance of your projects.
  * Import existing API specifications.


With the visual editor, you can:
  * Create a specification for use cases in which you do not need to include RAML fragments.
  * Scaffold a specification that you can complete and customize in the text editor.
toTimeZone | MuleSoft Documentation
# toTimeZone
## toTimeZone(str: String): TimeZone
Transform a `String` value into a `TimeZone` value.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The `String` value to transform into a `TimeZone` value.  
### Example
This example shows how `toTimeZone` behaves with different inputs. It produces output in the `application/dw` format.
#### Source
```
%dw 2.0
import * from dw::util::Coercions
output application/dw
---
{
  toTimeZoneOffset: toTimeZone("-03:00"),
  toTimeZoneAbbreviation: toTimeZone("Z"),
  toTimeZoneName: toTimeZone("America/Argentina/Buenos_Aires")
}
```

#### Output
```
{
 toTimeZoneOffset: |-03:00|,
 toTimeZoneAbbreviation: |Z|,
 toTimeZoneName: |America/Argentina/Buenos_Aires|
}
```
Manage Schedulers | MuleSoft Documentation
# Manage Schedulers
You can use Runtime Manager to view and control the Scheduler components within the flows in your deployed applications. Use the **Schedulers** tab in the navigation menu to enable or disable Scheduler elements, change the frequency, or run the scheduled job immediately, all without changing the running application.
From the **Schedulers** tab, you can:
  * Enable or disable the Scheduler
  * Change the frequency
  * Specify when to start running the Scheduler
  * Specify the timezone for a cron Scheduler


You can’t set a timezone for a scheduler running on CloudHub or Government Cloud.   
---  
Runtime Manager lists the name of each Scheduler component as `polling://{flow_name}`.
## Use Cases
Schedule management is useful in the following contexts:
  * You want to change the schedulers in your application at runtime without redeploying.
  * You want to disable a scheduled job while one of the applications you are connecting to is undergoing maintenance.
  * You want runtime visibility into the schedulers in your application.


## Considerations and Limitations
When using the **Schedulers** tab, consider the following:
  * If a scheduled job is not triggered because the application is not running, Runtime Manager triggers the job as soon as the application restarts.
  * The scheduler reads the job configuration every time it runs.
To apply your changes immediately, run your jobs manually after updating the schedule.


## View and Manage Application Schedulers in Runtime Manager
To use the scheduling feature in Runtime Manager, deploy an application that includes one or more Scheduler elements:
Figure 1. The arrow shows the **Scheduler** component in the Anypoint Studio canvas.
After deploying the app, view and manage the Scheduler elements in Runtime Manager:
  1. Click **Applications** in the left pane, click the app name, and then click **Schedulers** :
Figure 2. The screenshot shows (**1**) the **Schedulers** option and (**2**) the checkbox on the **Schedulers** page.
The **Name** column shows the name of the flow that contains the Scheduler element.
Runtime Manager lists the Scheduler elements in the order that they appear in your application:
Figure 3. The screenshot shows (**1**) the checkbox, (**2**) the **Disable** button, and (**3**) the schedule in the details pane.
  2. Enable one or more schedulers by selecting checkboxes and clicking **Enable**.
  3. Update a cron Scheduler by selecting a single checkbox and updating the schedule configuration in the details pane:
Figure 4. The arrow shows the cron schedule configuration in the details pane.
  4. Update a fixed-frequency Scheduler by selecting a single checkbox and updating the schedule configuration in the details pane:
Figure 5. The arrow shows the fixed-frequency schedule configuration in the details pane.
  5. Disable one or more schedulers by selecting checkboxes and clicking **Disable**.
  6. Click **Update** to save changed settings.


## See Also
  * Scheduler Endpoint (Trigger)
  * Migrating the Poll Component
Add Servers to a Cluster | MuleSoft Documentation
# Add Servers to a Cluster
Private Cloud Edition 
All servers that you add to a cluster must run on the same versions of:
  * Mule runtime
  * Runtime Manager agent


When you add a server to a unicast cluster, all existing servers in the cluster are restarted.   
---  
## Prerequisites
  * At least one server is configured.
  * The cluster is created.


## Add Servers to a Cluster
  1. From Anypoint Platform, select **Runtime Manager**.
  2. Select **Servers** in the left menu.
  3. Click **Cluster** in the **Type** column to display the details pane:
Figure 1. The arrow shows the **Add Server** button in the details pane.
  4. Click **Add Server**.
Servers that are already in a server group or cluster don’t appear in the list of available servers.
  5. In the list, select the servers to add to the cluster, and click **Add Servers**.


The servers no longer appear in the **Servers** list. To see the list of servers in the cluster, click the cluster name.
## See Also
  * Multicast vs Unicast Clusters
  * Add Servers to Runtime Manager
Upgrading and Migrating Salesforce Connector to 11.x | MuleSoft Documentation
# Upgrading and Migrating Salesforce Connector to 11.x
Upgrade Anypoint Connector for Salesforce (Salesforce Connector) from version 10.x to version 11.x.
## Supported Upgrade Paths
From Version | To Version  
---|---  
## Changes
### 11.1
  * Salesforce Connector now supports Salesforce API v62.0 and v63.0.


### 11.0
This release contains the following changes:
  * The **OAuth Client Credentials** connection type is added.
  * The **Subscribe Channel Listener** source is removed. Use the **Replay Channel Listener** source instead by using the `ONLY_NEW` replay option.
  * The **Subscribe Topic Listener** source is removed. Use the **Replay Topic Listener** source instead by using the `ONLY_NEW` replay option.
  * The deprecated **Query Result Stream** operation is removed. Use both of these operations instead:
    * The **Query Result List** operation to return a list of result IDs for a specific batch.
    * The **Query Result Stream by Id** operation to return an InputStream with the query results for a specific result ID of a submitted BatchInfo.


## Upgrade Prerequisites
Before you perform the upgrade, you must:
  1. Create a backup of your files, data, and configuration in case you need to restore to the previous version.
  2. Install Salesforce Connector 11.x to replace the Salesforce operations that were previously included in Salesforce Connector 10.x.


## Upgrade Steps
Follow these steps to perform the upgrade from Salesforce Connector v10.x to Salesforce Connector v11.x:
  1. In Anypoint Studio, create a Mule project.
  2. In the Mule Palette view, click **Search in Exchange**.
  3. In the **Add Dependencies to Project** window, enter `Salesforce` in the search field.
  4. In the **Available modules** section, select **Salesforce Connector - Mule 4** and click **Add**.
  5. Click **Finish**.
  6. Verify that the `salesforce-connector` dependency version is `11.x.x` in the `pom.xml` file, where `x.x` is the minor release and patch version number. For example, if you are upgrading to v11.0, the dependency version in the `pom.xml` file should be `11.0.0`.


Studio upgrades the connector automatically.
## Verify the Upgrade
After you install the latest version of the connector, follow these steps to verify the upgrade:
  1. In Studio, verify that there are no errors in the **Problems** or **Console** views.
  2. Check the project `pom.xml` file and verify that there are no problems.
  3. Test the connection and verify that the operations work.


## Troubleshooting
If there are problems with caching the parameters and caching the metadata, try restarting Studio.
## Revert the Upgrade
If it is necessary to revert to the previous version of Salesforce Connector, change the `salesforce-connector` dependency version in the project’s `pom.xml` file to the previous version.
You must update the project’s `pom.xml` file in Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
try | MuleSoft Documentation
# try
## try<T>(delegate: () -> T): TryResult<T>
Evaluates the delegate function and returns an object with `success: true` and `result` if the delegate function succeeds, or an object with `success: false` and `error` if the delegate function throws an exception.
The `orElseTry` and `orElse` functions will also continue processing if the `try` function fails. See the `orElseTry` and `orElse` documentation for more complete examples of handling failing `try` function expressions.
Note: Instead of using the `orElseTry` and `orElse` functions, based on the output of the `try` function, you can add conditional logic to execute when the result is `success: true` or `success: false`.
### Parameters
Name | Description  
---|---  
The function to evaluate.  
### Example
This example calls the `try` function using the `randomNumber` function as argument. The function `randomNumber` generates a random number and calls `fail` if the number is greater than 0.5. The declaration of this function is in the script’s header.
#### Source
```
%dw 2.0
import try, fail from dw::Runtime
output application/json
fun randomNumber() =
if(random() > 0.5)
 fail("This function is failing")
 else
 "OK"
---
try(() -> randomNumber())
```

#### Output
When `randomNumber` fails, the output is:
```
{
 "success": false,
 "error": {
  "kind": "UserException",
  "message": "This function is failing",
  "location": "Unknown location",
  "stack": [
   "fail (anonymous:0:0)",
   "myFunction (anonymous:1:114)",
   "main (anonymous:1:179)"
  ]
 }
}
```

When `randomNumber` succeeds, the output is:
```
{
 "success": true,
 "result": "OK"
}
```
substring | MuleSoft Documentation
# substring
## substring(text: String, from: Number, until: Number): String
Returns a substring that spans from the character at the specified `from` index to the last character before the `until` index.
The characters in the substring satisfy the condition `from <= indexOf(string) < until`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The string, treated as an array of characters.  
The lowest index to include from the character array.  
The lowest index to exclude from the character array.  
### Example
This example returns the substring with characters at indices `1` through `4` in the input string.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
var text = "hello world!"
---
substring(text, 1, 5)
```

## substring(text: Null, from: Any, until: Any): Null
Helper function that enables `substring` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
AS2 Connector 6.3 | MuleSoft Documentation
# AS2 Connector 6.3
Mule runtime engine (Mule) supports the AS2 protocol through Anypoint Connector for AS2 (AS2 Connector).
AS2 Connector enables trading partners to transmit and receive AS2 messages with EDI-X12, EDIFACT, XML, or binary payloads, for example:
  * Send messages, signed or unsigned, over HTTP or HTTPS, using the AS2 protocol
  * Receive messages over HTTP or HTTPS, using the AS2 protocol
  * Receive asynchronous MDN for sent messages


For compatibility information and fixed issues, see the AS2 Connector Release Notes.
For a major or minor release, see Upgrading and Migrating.
## Before You Begin
To use this connector, you must be familiar with:
  * The AS2 target resource
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * How to create a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have access to:
  * Credentials to access the AS2 target resource
  * Anypoint Platform
  * Anypoint Studio version 7.6 or later


## Common Use Cases for the Connector
Common use cases for AS2 Connector include the following:
  * Send with sync MDN


Sends a message through HTTP or HTTPS using the AS2 protocol requesting the partner for a synchronous MDN (receipt)
  * Send with async MDN


Sends a message through HTTP or HTTPS using the AS2 protocol requesting the partner for an asynchronous MDN (receipt)
  * Listener


Source that receives messages via HTTP or HTTPS using the AS2 protocol
  * MDN Listener


Source that receives asynchronous MDN receipts via HTTP or HTTPS using the AS2 protocol
  * Non repudiation Listener


Source that receives a signed copy of a receipt or a message for persistent non-repudiation storage
## Non-Repudiation Storage of AS2 Messages and MDNs
If needed, you can configure non-repudiation storage for your AS2 operations to support regulatory or compliance requirements.
Only signed messages and MDNs are eligible for non-repudiation.
The following AS2 Connector sources and operations support the non-repudiation feature:
  * AS2 Send Sync operation
  * AS2 Send Async operation
  * AS2 Listener source
  * AS2 MDN Listener source


### Before You Begin for Non-Repudiation Storage
To enable non-repudiation of a message in AS2 Connector, you must implement and configure a separate Mule flow that acts as a non-repudiation flow:
  * The non-repudiation flow must have access to the signed MIME message that is passed to it, along with appropriate non-repudiation specific attributes.
  * This non-repudiation-specific Mule flow is responsible for receiving, storing, and acting upon the messages and attributes it receives.
  * The name of this non-repudiation flow must be configured on an appropriate listener or operation that has non-repudiation storage enabled.


## Next Step
After you complete the prerequisites, you are ready to create an app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Keystrokes to Web Element | MuleSoft Documentation
# Keystrokes to Web Element
Use this _Web Automation_ object to enter alphanumeric characters into fields on a website or within a web application.
## Properties
**Input text** The text that will be entered in the given element. Can use script and environment variables.
## Inbound Variables
**Element XPath**
**Window Title**]
## Outbound Variables
The action step _Keystrokes to Element_ possesses no outbound variables.
## Wizard
_Keystrokes to Element_ enables you to fill in any field on a website, web application, or form that accepts content. You can manually define a keystroke sequence you want to use by typing into the _Input Text_ field.
All the different possibilities for creating an _Input Text_ can be combined into a single sequence.
Display a Typed Fault | MuleSoft Documentation
# Display a Typed Fault
Make the `ListInventory` operation display the typed fault. The tshirt2.wsdl file includes the **TshirtFault** typed fault, which is mapped to the WSDL operations:
  * `OrderTshirt`
  * `ListInventory`
  * `TrackOrder`


APIkit for SOAP supports the following types of SOAP faults:
  * Soap Fault 1.1
  * Soap Fault 1.2


You can select either type by using any WSDL file, even for files that do not contain typed faults.
  1. In Anypoint Studio, search for **fault** in the command palette.
Multiple `SOAP Fault` components can appear.
  2. Drag `SOAP Fault` to the `ListInventory:api-config` flow.
If **Operation Unavailable** message appears, cancel the operation and select another `SOAP Fault` component.
  3. Repeat these steps until you find a version match.
  4. In the properties editor, in **Module Configuration** , select `soapkit-config`.
  5. In **Operation** , select `ListInventory`.
  6. In **Fault** , select `Fault`.
  7. Save the properties.
  8. Select the `Transform Message` component.
  9. Modify the DataWeave code as follows:
```
%dw 2.0
output application/xml
ns ns0 http://mulesoft.org/tshirt-service
ns soap http://schemas.xmlsoap.org/soap/envelope/
---
{
 soap#Fault: {
  faultcode: "soap:Server",
  faultstring: "The error details",
  detail: {
   ns0#TshirtFault: {
    errorStuff: 500
   }
  }
 }
}
```

  10. Save the project and run it again.
Using SoapUI, run the `ListInventory` operation.
The client returns the following envelope instead of the default fault:
```
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
   <soap:Fault>
     <faultcode>soap:Server</faultcode>
     <faultstring>The error details</faultstring>
     <detail>
      <ns0:TshirtFault xmlns:ns0="http://mulesoft.org/tshirt-service">
        <errorStuff>500</errorStuff>
      </ns0:TshirtFault>
     </detail>
   </soap:Fault>
  </soap:Body>
</soap:Envelope>
```



## See Also
  *
Flex Gateway Reference Architecture | MuleSoft Documentation
# Flex Gateway Reference Architecture
The following architecture diagrams explain Flex Gateway concepts and deployments:
  * Flex Gateway Deployment Models
  * Integration Use Cases
    * Use Case 1: Organization-Owned API Exposed to an Organization-Owned API Consumer
    * Use Case 2: Organization-Owned API Exposed to a Non-Organization-Owned API Consumer
    * Use Case 3: Non-Organization-Owned API Exposed to an Organization-Owned API Consumer
    * Use Case 4: Non-Organization-Owned API Exposed to a Non-Organization-Owned API Consumer
  * Flex Gateway Multiple Region Deployments
  * Shared Storage Models
IBM MQ Tuning For Performance | MuleSoft Documentation
# IBM MQ Tuning For Performance
Performance can be a significant factor when processing many messages, which means that you probably want to check the following configurations to ensure you get the most out of the IBM MQ connector.
## Don’t Disable Connections Reuse
Connections are expensive to create, so it’s important to reuse them as much as possible.
  * By default, the IBM MQ connector uses an aggressive `caching-strategy` that reuses as many consumers and producers as possible. We recommend that you keep this configuration untouched since any modification can reduce the performance of your application.
  * Disabling connections caching reduces the performance of your application.


## Increasing Concurrent Messages Processing
A good way to improve the performance of your application is to increase the number of concurrent consumers that receive messages from the same destination. This can be done easily in the IBM MQ connector by configuring the `numberOfConsumers` parameter.
Out of the box, the `listener` uses four consumers concurrently at the same destination, but you can increase this number to a value that better fits your needs:
```
<ibm-mq:listener config-ref="config"
   destination="#[vars.destination]"
   numberOfConsumers="20"/>
```

Increasing the `numberOfConsumers` is the easiest way to improve the throughput of your listeners.   
---  
## Optimize Your Configuration For Clusters
For applications running in clusters, keep in mind the concept of **primary node** and how the connector behaves. When running in a cluster, the IBM MQ `listener` default behavior is to receive messages only at the primary node, no matter what kind of destination you are consuming from.
In case of consuming messages from a queue, change this configuration to receive messages in all the nodes of the cluster, not just the primary.
This can be done with the `primaryNodeOnly` parameter:
```
<ibm-mq:listener config-ref="config"
   destination="${inputQueue}"
   primaryNodeOnly="false"/>
```

Consuming messages from a topic is a bit different, since the default behavior of receiving messages only in the primary node is the most common use case, given that it avoids processing the same message multiple times across the cluster.
If you are using the JMS 2.0 shared subscriptions mechanism, then you want to change the cluster configuration to consume from all the nodes, again setting `primaryNodeOnly` to `false`:
```
<ibm-mq:listener config-ref="JMS_20_config"
   destination="${inputTopic}"
   primaryNodeOnly="false">
   <ibm-mq:consumer-type>
     <ibm-mq:topic-consumer
     shared="true"
     subscriptionName="clusteredEventListener"/>
   </ibm-mq:consumer-type>
 </ibm-mq:listener>
```

When listening from a queue in a cluster, change the `primaryNodeOnly` configuration to `false`.   
---  
When listening from a topic in a cluster, not using the `primaryNodeOnly` configuration causes the cluster to process the same message more than once unless shared-subscriptions is used.   
---  
## See Also
  * To Consume Messages
  * Using Topic Subscriptions
Pass Functions as Arguments | MuleSoft Documentation
# Pass Functions as Arguments
This DataWeave example defines a base function in the header that receives two arguments: a function and an element to apply it on. The base function the applies the received function onto the keys of the received element and also to every one of its child elements recursively. In this case, the function sent sets all keys to lower case.
The example uses the following:
  * A custom function that is applied recursively, ie: it calls itself for each child in the element it receives originally.
  * `mapObject` to sort through each child of the element.
  * `lower` from the Strings library to make every Key in the input lower case.
  * `is` to check if the passed element is of type `Object` (and therefore has children).
  * `if` and `else` to only have the function call itself when a condition is met, and to otherwise end the recursive loop for that branch.


DataWeave Script:
```
%dw 2.0
import * from dw::core::Strings
output application/xml
fun applyToKeys(element, func) =
  if (element is Object)
    element mapObject (value, key) -> {
    (func(key)) : applyToKeys( value, func)
    }
  else element
---
applyToKeys(payload, (key) -> lower(key))
```

Input XML Payload:
```
<CATALOG>
 <CD>
  <TITLE>Empire Burlesque</TITLE>
  <ARTIST>Bob Dylan</ARTIST>
  <COUNTRY>USA</COUNTRY>
  <COMPANY>Columbia</COMPANY>
  <PRICE>10.90</PRICE>
  <YEAR>1985</YEAR>
 </CD>
 <CD>
  <TITLE>Hide your heart</TITLE>
  <ARTIST>Bonnie Tyler</ARTIST>
  <COUNTRY>UK</COUNTRY>
  <COMPANY>CBS Records</COMPANY>
  <PRICE>9.90</PRICE>
  <YEAR>1988</YEAR>
 </CD>
</CATALOG>
```

Output XML:
```
<?xml version='1.0' encoding='US-ASCII'?>
<catalog>
 <cd>
  <title>Empire Burlesque</title>
  <artist>Bob Dylan</artist>
  <country>USA</country>
  <company>Columbia</company>
  <price>10.90</price>
  <year>1985</year>
 </cd>
 <cd>
  <title>Hide your heart</title>
  <artist>Bonnie Tyler</artist>
  <country>UK</country>
  <company>CBS Records</company>
  <price>9.90</price>
  <year>1988</year>
 </cd>
</catalog>
```

## Related Examples
  * Define a Custom Addition Function
  * Dynamically Map Based On a Definition
  * Define a Function that Flattens Data in a List
  * Conditionally Reduce a List through a Function


## See Also
  * DataWeave Selectors
  *
Azure Key Vault Properties Provider 2.1 | MuleSoft Documentation
# Azure Key Vault Properties Provider 2.1
Azure Key Vault Properties Provider is a configuration that enables you to retrieve your secrets from a secure Azure cloud service before your Mule app runs.
For information about compatibility and fixed issues, refer to the Azure Key Vault Properties Provider Release Notes.
## Before You Begin
To use this properties provider, you must be familiar with:
  * The Azure Key Vault API
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * How to create a Mule app using Anypoint Studio


Before creating an app, you must have:
  * Mule Enterprise Edition
  * Credentials to access the Azure Key Vault target resource
  * Anypoint Platform
  * Anypoint Studio version 7.3.5 or later


## Common Use Cases for the Properties Provider
With Azure Key Vault Properties Provider, secrets can be retrieved in the pre-runtime phase, which means secrets are populated before the Mule app is deployed.
## Connection Types
Connectors can use the Azure Key Vault Properties Provider in their configuration. In the configuration, use the `${azure-key-vault-properties-provider::secret::yourSecret}` structure to retrieve a secret from Azure Key Vault. Here is an example:
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Azure Key Vault Properties Provider Reference
  * MuleSoft Help Center