BassemE/mulesoft-documentation-embeddings huggingface dataset:
JSON Module XML and Maven Support | MuleSoft Documentation
# JSON Module 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/json
http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json"
	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/json
	http://www.mulesoft.org/schema/mule/json/current/mule-json.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.modules</groupId>
 <artifactId>mule-json-module</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 `json module`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Promote API Instances in API Groups | MuleSoft Documentation
# Promote API Instances in API Groups
You can promote an API Group instance from one environment to another, for example, sandbox to production. When you promote an API Group instance, the source environment of the instance remains unchanged. However, the destination environment changes by creating the API Group instance that is being promoted.
The API instances of the promoted API Group instance might differ from the original group instance, but the definition (related assets) remains the same.
## Task Prerequisites
Before you begin, ensure that you have:
  * Obtained the API Group Administrator permissions to be able to promote an API Group instance
  * Verify that the APIs in the API Group instance that you want to promote are already present in the destination environment
For example, if the API Group instance that you want to promote contains the Facebook API, the destination environment must already have the Facebook API in that environment type.


To promote an API Group instance:
  1. Navigate to **Anypoint Platform** > **API Manager**.
  2. Click **API Groups** > **Promote from environment**.
  3. From the **Source Environment** list, select the environment of the API you want to promote.
  4. From the **API Group** list, select the API Group to which the API instance belongs.
  5. From the **API Group version** list, select the version of the API Group to which the instance belongs.
  6. From the **API Group instance** list, select the API Group instance that you want to promote.
  7. Optionally, select the **Import default limits from existent SLA Tiers** checkbox if you want to include the SLA tiers when promoting from source to destination environment.
Note that only the default limits of every tier is promoted.
  8. Click **Promote**.
CLI Commands for API Governance | MuleSoft Documentation
# CLI Commands for API Governance
You can use Anypoint CLI commands to automate your API Governance processes and work with custom rulesets.
Command | Description  
---|---  
|  Uploads a custom ruleset asset along with its documentation to Exchange (publishes an asset)  
governance:api:evaluate |  Evaluates filter criteria to determine which rulesets apply to APIs that meet that criteria  
governance:api:inspect |  Inspects an API specification and lists its schemas  
governance:api:validate |  Validates an API specification against a specified governance ruleset  
|  Creates the documentation file for a governance ruleset definition  
governance:profile:create |  Creates a governance profile  
governance:profile:delete |  Deletes a governance profile  
governance:profile:info |  Lists information for a specific governance profile ID  
governance:profile:list |  Lists all governance profiles for an organization  
governance:profile:update |  Updates a governance profile  
governance:ruleset:clone |  Clones a governance ruleset and applies specified updates to rules  
governance:ruleset:info |  Lists ruleset rules  
governance:ruleset:init |  Initializes a governance ruleset definition based on a data schema  
governance:ruleset:validate |  Validates a governance ruleset specification’s format  
## Install the Anypoint Platform CLI
If you plan to use the API Governance CLI commands, install Anypoint Platform CLI where you run your commands. The Anypoint CLI installation includes the API Governance plugin. For detailed installation instructions, including prerequisite software requirements, see Installing Anypoint CLI 4.x.
## Permissions for Anypoint CLI Governance Commands
Anypoint CLI commands that access functionality in Anypoint Platform require adequate permissions to execute successfully.
The `governance` commands require the following permissions:
  * None:
Any commands that run locally without accessing Anypoint Platform, such as `ruleset validate`, `ruleset document`, and `api validate`
  * Governance Administrator:
Commands that update API Governance entities, such as `profile create`, `profile update`, and `profile delete`
  * Governance Viewer:
Commands that list API Governance information only, such as `api inspect` and `profile list`


## Ruleset Development CLI
You can also use an open-source CLI, `ruleset-development-cli`, to help you create custom rulesets. See Create Rulesets Using the Ruleset Development CLI.
## See Also
  * Getting Started with Anypoint API Governance
  * Installing Anypoint CLI 4.x
Mailchimp Marketing Connector | MuleSoft Documentation
# Mailchimp Marketing Connector
Anypoint Connector for Mailchimp Marketing (Mailchimp Marketing Connector) enables you to integrate your applications with the Mailchimp Marketing data and functionality. This connector exposes operations provided by the Mailchimp Marketing API.
For information about compatibility and fixed issues, refer to the Mailchimp Marketing Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Mailchimp Marketing 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 Mailchimp Marketing target resource
  * Anypoint Platform
  * Anypoint Studio version 7.3.5 or later


## Common Use Cases for the Connector
Some common use cases for Mailchimp Marketing Connector include:
  * Creating and sending campaigns
  * Adding, updating, and removing subscribers to and from lists
  * Monitoring subscriber and unsubscriber counts and campaign email open rates


## Connection Types
Mailchimp Marketing Connector uses the following authentication methods:
  * API Key Connection Provider, which is used to access protected applications without specifying a password.
  * OAuth Authorization Code Connection Provider, which is used to access protected applications with an access token.


## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Mailchimp Marketing Connector Reference
  * MuleSoft Help Center
Mule App Deployments Kubernetes Permissions on Runtime Fabric | MuleSoft Documentation
# Mule App Deployments Kubernetes Permissions on Runtime Fabric
Mule apps deployed on the Runtime Fabric platform do not access the underlying Kubernetes API server. By default, Mule app deployments do not have RBAC configurations (`Role` and `Rolebindings`).
However, if the Mule app use case requires K8s (Kubernetes) API access, you can override this behavior by enabling the `automountserviceaccounttoken` via customization CRD (custom resource definition) and attach a `Role` (customer-owned) with a `Rolebinding` (customer-owned) to the service account that Runtime Fabric core software creates per deployment. Refer to Customizing Mule App Kubernetes Resources.
## See Also
  * Runtime Fabric Control Plane Permissions
  * Enabling RTFCTL Kubernetes Permissions
  * Configuring Kubernetes for Runtime Fabric
isLocalDateTimeType | MuleSoft Documentation
# isLocalDateTimeType
## isLocalDateTimeType(t: Type): Boolean
Returns `true` if the input is the LocalDateTime type.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The type to check.  
### Example
This example shows how `isLocalDateTimeType` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::core::Types
type ALocalDateTime = LocalDateTime
output application/json
---
{
  a: isLocalDateTimeType(ALocalDateTime),
  b: isLocalDateTimeType(LocalDateTime),
  c: isLocalDateTimeType(String),
}
```

#### Output
```
{
 "a": true,
 "b": true,
 "c": false
}
```
Release Notes | MuleSoft Documentation
# Release Notes
**September 19, 2023**
### New use case
This release introduces the Trade Promotion Optimization use case, which integrates predictive baseline data from CRM Analytics into Hyperforce to optimize trade promotions. Optimizing trade promotions enables data-driven insights to maximize promotion effectiveness, aids in designing targeted promotions that align with consumer behavior, and facilitates accurate ROI calculations by assessing market risks.
### Updates to the Trade Promotion Effectiveness Use Case
This release updates the Trade Promotion Effectiveness use case with full and incremental load, which helps visualize your promotions in one integrated platform with pre-built assets that integrate Business Intelligence Tools (BI Tools), such as CRM Analytics, into a TPM platform like Salesforce Consumer Goods Cloud.
**June 2, 2023**
### Updates to the Trade Promotion Effectiveness Use Case
This release includes updates to the Trade Promotion Effectiveness use case, which helps visualize your promotions in one integrated platform with pre-built assets that integrate Business Intelligence Tools (BI Tools), such as CRM Analytics, into a TPM platform like Salesforce Consumer Goods Cloud.
## v3.0
30 January 2023
### New use case
This release includes the Trade promotion effectiveness use case, which helps visualize your promotions in one integrated platform with pre-built assets that integrate Business Intelligence Tools (BI Tools), such as CRM Analytics, into a TPM platform like Salesforce Consumer Goods Cloud.
## v2.0
25 October 2022
### New use case
This release includes the Retail Execution use case, which unlocks shelf data to enable perfect retail execution with pre-built assets and lets retailers access store audit data from image recognition software, like Trax, and integrate smoothly into a Retail Execution platform, such as Salesforce Consumer Goods Cloud, to monitor at shelf performance in one platform.
## v1.1
17 September 2022
### Updates to the Product and Account Integration with Hierarchies
This release includes updates to the Product and Account Integration with Hierarchies use case, which synchronizes relevant product, customer, demand planning, and pricing information from ERP and PIM systems and easily consolidates this information into Trade Promotion Management (TPM) platforms, like Salesforce Consumer Goods Cloud, in real time for informed promotional planning.
## v1.0
18 July 2022
### New use case
This release includes the Product and Account Integration with Hierarchies use case, which synchronizes relevant product, customer, demand planning, and pricing information from ERP and PIM systems and easily consolidates this information into Trade Promotion Management (TPM) platforms, like Salesforce Consumer Goods Cloud, for informed promotional planning.
## See Also
  * MuleSoft Accelerator for Consumer Goods
Tutorial: Create an Automation from Start to Finish | MuleSoft Documentation
# Tutorial: Create an Automation from Start to Finish
MuleSoft Robotic Process Automation (RPA) enables you to automate workflows that contain time-consuming manual tasks and integrate them with your MuleSoft Composer flows.
During this tutorial, you create a simple automation project that accesses the MuleSoft website, subscribes to the newsletter, uses optical character recognition (OCR) to confirm that the process finishes successfully, and then you configure a Composer flow to execute the automated process.
Follow these steps to complete the end-to-end automation journey:
  * Step 1. Prerequisites for Creating an Automation
  * Step 2. Evaluate a Process for Automation
  * Step 3. Create the Automation Project
  * Step 4. Design the BPMN Diagram for the Automation
  * Step 5: Build the Automation from the BPMN diagram
  * Step 6: Test the Automation
  * Step 7: Publish the Automation to Exchange
  * Step 8: Integrate the Automation with Composer Flows
  * Step 9: Monitor the Automation


After you’ve experienced the end-to-end journey, use the model you created to plan your next automation projects.
## See Also
  *
Runtime Fabric Core Software Kubernetes Permissions | MuleSoft Documentation
# Runtime Fabric Core Software Kubernetes Permissions
The following table lists the Kubernetes access permissions required by the Runtime Fabric agent. These access permissions are part of the Runtime Fabric helm chart and are automatically applied during the installation or upgrade.
You can’t extend or modify any of these core software access permissions. Instead, create and apply the `ClusterRole` and `Rolebindings` for the Runtime Fabric Authorized namespaces use case. Refer to Configuring Authorized Namespaces in Runtime Fabric.   
---  
Namespace | API Groups | Kubernetes Resources | Verbs  
---|---|---|---  
<rtf-namespace> | extensions, apps | deployments, deployments/scale, daemonsets, replicasets  
pods, pods/log, pods/portforward, pods/exec, configmaps, secrets, services, namespaces, nodes, serviceaccounts, resourcequotas, events, limitranges  
jobs, cronjobs  
extensions  
networking.k8s.io | networkpolicies  
rbac.authorization.k8s.io | rolebindings, clusterroles, clusterrolebindings, roles  
extensions,networking.k8s.io | ingresses,networkpolicies  
rtf.mulesoft.com | persistencegateways, kubernetestemplates  
autoscaling | horizontalpodautoscalers  
## See Also
  * Enabling RTFCTL Kubernetes Permissions
  * Mule App Deployments Kubernetes Permissions on Runtime Fabric
leftJoin | MuleSoft Documentation
# leftJoin
## leftJoin<L <: Object, R <: Object>(left: Array<L>, right: Array<R>, leftCriteria: (leftValue: L) -> String, rightCriteria: (rightValue: R) -> String): Array<{ l: L, r?: R }>
Joins two arrays of objects by a given ID criteria.
`leftJoin` returns an array all the `left` items, merged by ID with any right items that meet the joining criteria.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The left-side array of objects.  
The right-side array of objects.  
`leftCriteria` | The criteria used to extract the ID for the left collection.  
`rightCriteria` | The criteria used to extract the ID for the right collection.  
### Example
This example shows how join behaves. Notice that it returns all objects from the left-side array (`left`) but only joins items from the right-side array (`right`) if the values of the left-side `user.id` and right-side `product.ownerId` match.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
var users = [{id: "1", name:"Mariano"},{id: "2", name:"Leandro"},{id: "3", name:"Julian"},{id: "5", name:"Julian"}]
var products = [{ownerId: "1", name:"DataWeave"},{ownerId: "1", name:"BAT"}, {ownerId: "3", name:"DataSense"}, {ownerId: "4", name:"SmartConnectors"}]
output application/json
---
leftJoin(users, products, (user) -> user.id, (product) -> product.ownerId)
```

#### Output
```
[
 {
  "l": {
   "id": "1",
   "name": "Mariano"
  },
  "r": {
   "ownerId": "1",
   "name": "DataWeave"
  }
 },
 {
  "l": {
   "id": "1",
   "name": "Mariano"
  },
  "r": {
   "ownerId": "1",
   "name": "BAT"
  }
 },
 {
  "l": {
   "id": "2",
   "name": "Leandro"
  }
 },
 {
  "l": {
   "id": "3",
   "name": "Julian"
  },
  "r": {
   "ownerId": "3",
   "name": "DataSense"
  }
 },
 {
  "l": {
   "id": "5",
   "name": "Julian"
  }
 }
]
```
Saving Searches | MuleSoft Documentation
# Saving Searches
As an Exchange administrator, you can save searches that your users can click to access assets within a business group.
While users can view and click the searches, only an Exchange administrator can save, rename, or delete the saved searches.
  1. Change to the business group where you want to add saved searches.
  2. Specify a search in the search field.
  3. Click **Save this search**.
  4. In the Save Search window, specify the name for the search, and save the search name.
  5. Select a **Save as** option.
  6. Click **Save**. The saved searches appear in the left navigation bar of the Assets page under the Organization Searches heading.
  7. To rename the search, under **My searches** in the left navigation bar, click the three dots menu next to the search name and select **Rename**.
  8. Enter a new name followed by pressing the Enter or Return key on your keyboard.
  9. To delete the search, under **My searches** in the left navigation bar, click the three dots menu next to the search name and select **Delete**.
SFTP Connector Examples | MuleSoft Documentation
# SFTP Connector Examples
To fully benefit from using Anypoint Connector for SFTP (SFTP Connector), see the following examples of configuring the connector operations:
  * Read a File Configure the **Read** operation to read a file at any point in the flow.
  * Write a File Configure the **Write** operation to write content into the given path on demand.
  * List Files Configure the **List** operation to list the files and folders in the configured directory path.
  * Copy and Move Files Configure the **Copy** and **Move** operations to copy or move files or directories on demand.
  * Create a Directory Configure the **Create Directory** operation to create a directory of a given name.
  * Trigger a Flow for a New Created or Updated File Configure the **On New or Updated File** source to trigger a flow for a new created or modified file.
  * Connect to an SFTP Server Configure the SFTP global configuration element to connect to an SFTP server, or to connect to an SFTP server through a proxy.
  * Connect to SFTP Servers Dynamically Configure SFTP Connector to connect dynamically to multiple servers.
  * Disable pooling in SFTP Configuration  Disable connection pooling in SFTP Connector configuration to make sure no connection is active if there is nothing to transfer.
  * Configure Preferred Authentication  Configure the preferred authentication for the SFTP Connection.
  * Configure Security Parameters of SSH Connection Override default security configuration of SSH Connection.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
API Functional Monitoring Release Notes | MuleSoft Documentation
# API Functional Monitoring Release Notes
The following release notes are provided for API Functional Monitoring:
  * API Functional Monitoring (AFM) Release Notes


## See Also
  * API Functional Monitoring Overview
WebSockets Reconnection | MuleSoft Documentation
# WebSockets Reconnection
WebSockets are based on persistent and stateful connections. A connection can abnormally close in the lapse between when it was established and its use in an operation due to factors like idle timeouts, network conditions, and more.
Inbound sockets cannot be automatically reconnected because the remote system must resend the connection request for the connections to be reestablished.
For outbound sockets however, a reconnection policy can be used to re-establish the connection in case it drops.
When your Mule app tries to use a WebSocket that has been abnormally closed, for example to send a message to the socket, reconnection is re-established by replaying the same HTTP request that originally established the outbound socket. After which, the operation is automatically retried.
The following example shows how to send a reconnection policy using a `<websocket:send>` operation so that reconnection re-attempts once every second up to 5 times in case the connection is dropped:
```
<websocket:send socketId="#[vars.socketId]" config-ref="ws">
  <reconnect count="5" frequency="1000"/>
  <websocket:content>Hello World!</websocket:content>
</websocket:send>
```

## See Also
  * MuleSoft Help Center
  * WebSockets Connector Overview
  * Connector Configuration
Copy and Move Files with the FTP Connector Example | MuleSoft Documentation
# Copy and Move Files with the FTP Connector Example
Anypoint Connector for FTP (FTP Connector) provides **Copy** and **Move** operations that enable you to copy and move files or directories on demand.
While SFTP has a native concept of copying and moving, FTP does not. FTP Connector simulates these operations by downloading file content and writing it to a new location, using concurrent streams that start writing and reading at the same time. Because these operations create significant network overhead, use them wisely.
## Configure the Copy Operation in Studio
To add and configure the **Copy** operation in Studio, follow these steps:
  1. In the **Mule Palette** view, search for `ftp` and select the **Copy** operation.
  2. Drag the **Copy** operation onto the Studio canvas.
  3. In the **General** tab of the operation configuration screen, click the plus sign (**+**) next to the **Connector configuration** field to access the global element configuration fields.
  4. Specify the connection information and click **OK**.
  5. Set **Source path** to the path of the file to copy, for example, `source.txt`.
  6. Set **Target path** to the directory path into which to copy the file, for example, `backup`.
  7. Set **Rename to** to rename the file as part of the operation, for example, `renamed.txt`. This field must be a filename, not a path. If this attribute is not provided, the original filename is used.


In the Configuration XML editor, the `<ftp:copy>` configuration looks like this:
```
<ftp:copy sourcePath="source.txt" targetPath="backup"
 overwrite="true|false" createParentDirectories="true|false"
 renameTo="renamed.txt"/>
```

## Configure the Move Operation in Studio
To add and configure the **Move** operation in Studio, follow these steps:
  1. In the **Mule Palette** view, search for `ftp` and select the **Move** operation.
  2. Drag the **Move** operation onto the Studio canvas.
  3. In the **General** tab of the operation configuration screen, click the plus sign (**+**) next to the **Connector configuration** field to access the global element configuration fields.
  4. Specify the connection information and click **OK**.
  5. Set **Source path** to the path of the file to move, for example, `source.txt`.
  6. Set **Target path** to the directory path into which to move the file, for example, `backup`.
  7. Set **Rename to** to rename the file as part of the operation, for example, `renamed.txt`. This field must be a filename, not a path. If this attribute is not provided, the original filename is used.


In the **Configuration XML** editor, the `<ftp:move>` configuration looks like this:
```
<ftp:move sourcePath="source.txt" targetPath="backup"
 overwrite="true|false" createParentDirectories="true|false"
 renameTo="renamed.txt"/>
```

## See Also
  * FTP Connector Examples
  * MuleSoft Help Center
A2A Agent Card Policy | MuleSoft Documentation
# A2A Agent Card Policy
**Policy Name** | A2A Agent Card  
---|---  
Rewrites the Agent Card URL to match the public URL of the gateway  
**First Flex Gateway version available**  
**Returned Status Codes**  
This policy supports Agent2Agent Protocol (A2A) versions v0.2.3 and earlier. To learn more about A2A versions, see A2A Releases.   
---  
## Summary
The A2A Agent Card Policy rewrites the URL in the A2A Agent Card responses so that the exposed URL points to the public endpoint of the Flex Gateway A2A server instance rather than directly to backend services. This ensures that all client requests are routed through Flex Gateway, enabling it to enforce security and access controls, while preventing direct access to backend resources.
## Configuring Policy Parameters
### Flex Gateway Local Mode
The A2A Agent Card policy isn’t supported in Local Mode.
### Managed Flex Gateway and Flex Gateway Connected Mode
When you apply the policy to your API instance from the UI, the following parameters are displayed:
Element | Description  
---|---  
Consumer URL |  The consumer URL of the agent’s A2A service where JSON-RPC requests are sent. If the consumer URL isn’t set, the server instance’s public endpoint is used.  
The path where the agent presents the card.
findDataFormatDescriptorByMime | MuleSoft Documentation
# findDataFormatDescriptorByMime
## findDataFormatDescriptorByMime(mime: dw::module::Mime::MimeType): DataFormatDescriptor | Null
Returns the `DataFormatDescriptor` based on the `dw::module::Mime::MimeType` specified or `null` if there is no `DataFormatDescriptor` for the given `MimeType`.
_Experimental:_ This function is an experimental feature that is subject to change or removal from future versions of DataWeave.
_Introduced in DataWeave version 2.7.0._
### Parameters
Name | Type | Description  
---|---|---  
`dw::module::Mime::MimeType` | The MIME type value to search.  
### Example
This example searches for a JSON `DataFormatDescriptor` and an unknown `DataFormatDescriptor`.
#### Source
```
%dw 2.0
import * from dw::Runtime
output application/json
var jsonDF = findDataFormatDescriptorByMime({'type': "*", subtype: "json", parameters: {}})
var unknownDF = findDataFormatDescriptorByMime({'type': "*", subtype: "*", parameters: {}})
fun simplify(df: DataFormatDescriptor | Null) = df match {
 case d is DataFormatDescriptor -> { name: d.name, defaultMimeType: d.defaultMimeType }
 case is Null -> { name: "unknown", defaultMimeType: "unknown" }
}
---
{
 json: simplify(jsonDF),
 unknown: simplify(unknownDF)
}
```

#### Output
```
{
 "json": {
  "name": "json",
  "defaultMimeType": "application/json"
 },
 "unknown": {
  "name": "unknown",
  "defaultMimeType": "unknown"
 }
}
```
Variables in Mule Apps | MuleSoft Documentation
# Variables in Mule Apps
Variables are used to store per-event values for use within a flow of a Mule app. The stored data can be any supported data type, such as an object, number, or string. It is also possible to store the current message (using the `message` keyword), the current message payload (using the `payload` keyword) or just the current message attributes (using the `attributes` keyword). You can even use a DataWeave expression as the value. However, the keyword `vars` (for example, `vars.someOtherVar`) is not allowed.
You can create, or update, variables in these ways:
  * Using the Set Variable component.
  * Using a Target Variable from within an operation, such as the Read operation to the File connector or the Store operation to the Database connector.
  * Using the DataWeave Transform Component (EE-Only)
  * Using Scripting Component (in scripting module)


You can also delete/remove:
  * Using the Remove Variable component.


After creating a variable, you can access and use it within the scope of a Mule flow where you created it, which includes any flows that are joined with it through a Flow Ref component.
  * `vars`: Keyword for accessing a variable, for example, through a DataWeave expression in a Mule component, such as the Logger, or from an Input or Output parameter of an operation. If the name of your variable is `myVar`, you can access it like this: `vars.myVar`


Note that a variable in the Mule event is different from variables defined in a DataWeave script, which are local to the script and not accessible outside of it.
## See Also
  *   * Set Variable Transformer
  * Flow Reference Component
  * Enrich Data with Target Variables
  * DataWeave Language
take | MuleSoft Documentation
# take
## take<T>(array: Array<T>, n: Number): Array<T>
Selects the first `n` elements. It returns an empty array when `n <= 0` and the original array when `n > sizeOf(array)`.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The array of elements.  
The number of elements to select.  
### Example
This example outputs an array that contains the values of first two elements of the input array.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
var users = ["Mariano", "Leandro", "Julian"]
output application/json
---
take(users, 2)
```

#### Output
```
[
 "Mariano",
 "Leandro"
]
```

## take(array: Null, n: Any): Null
Helper function that enables `take` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
matches | MuleSoft Documentation
# matches
## matches(text: String, matcher: Regex): Boolean
Checks if an expression matches the entire input string.
For use cases where you need to output or conditionally process the matched value, see Pattern Matching in DataWeave.
### Parameters
Name | Description  
---|---  
The input string.  
A Java regular expression for matching characters in the string.  
### Example
This example indicates whether the regular expression matches the input text. Note that you can also use the `matches(text,matcher)` notation (for example, `matches("admin123", /a.*\d+/)`).
#### Source
```
%dw 2.0
output application/json
---
[ ("admin123" matches /a.*\d+/), ("admin123" matches /^b.+/) ]
```

#### Output
```
[ true, false ]
```

## matches(text: Null, matcher: Any): false
Helper function that enables `matches` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
EU Control Plane Overview | MuleSoft Documentation
# EU Control Plane Overview
MuleSoft hosts a version of the Anypoint Platform control plane entirely within the EU (Frankfurt or Dublin data centers). This enables you to deploy and manage your APIs, applications, and related data entirely within the European Union. This includes data and metadata about your MuleSoft implementation.
In addition to the EU control plane, deployment targets for MuleSoft managed runtimes are also hosted in the EU data center. Having both the control and runtime planes entirely within the EU enables you to more effectively meet emerging regulatory requirements.
## See Also
  * Anypoint Platform - EU Control Plane, December 15 2017 Release Notes
  * To Access the EU Control Plane
JSON Module | MuleSoft Documentation
# JSON Module
JSON Module v2.5
The JSON module provides extra functionality for processing JSON documents. Although DataWeave is the tool that Mule uses to access data in JSON documents, this module provides extra functionality that falls outside of DataWeave’s scope, like schema validation.
Release Notes: JSON Module Release Notes Exchange: JSON Module
## See Also
  * ValidateDocuments against a JSON Schema with the JSON Module
  * JSON Module Reference
  * MuleSoft Help Center
Stopwatch Collection | MuleSoft Documentation
# Stopwatch Collection
The Stopwatch Collection action step enables you to collect all timer values from the _Stopwatch_ and the _General Timer_ Actions Steps configured in an Activity Workflow.
Because all Stopwatch values are determined at the end of the workflow, you can only place this action step in the Workflow Finalization section.
## Properties
  * **Json Labels**
    * **Reached Label**
The label for the Stopwatch Reached State in the output JSON. Maximum length: 50 characters.
    * **Timer Label**
The label for the Stopwatch Name in the output JSON. Maximum length: 50 characters.
    * **Touch Time Label**
The label for the touch time in the output JSON. The touch time is a timestamp from the last time the checkpoint was touched. Maximum length: 50 characters.
    * **Value Label**
The label for the Stopwatch Value in the output JSON. Maximum length: 50 characters.


The properties panel does not validate the maximum label length. Ensure that you validate JSON labels and output by using the Wizard.   
---  
## Inbound Variables
This action step contains no inbound variables.
## Outbound Variables
  * **Stopwatch Timer Collection**
The collection of captured stopwatch values in a JSON list, represented as a String.


## Wizard
  * **Settings for JSON labels**
    * **Timer Label**
The label for the Stopwatch Name in the output JSON.
    * **Reached Label**
The label for the Stopwatch Reached State in the output JSON.
    * **Value Label**
The label for the Stopwatch Value in the output JSON.
    * **Touch Time Label**
The label for the touch time in the output JSON. The touch time is a timestamp from the last time the checkpoint was touched. Maximum length: 50 characters.


The **Preview JSON Output** section shows a preview of the resulting JSON based on the configured Stopwatch action steps in the Workflow.
## See Also
  *   * Workflow Finalization
toLocalTime | MuleSoft Documentation
# toLocalTime
## toLocalTime(str: String, formatters: Array<Formatter>): LocalTime
Transforms a `String` value into a `LocalTime` value using the first `Formatter` that matches with the given value to transform.
_Introduced in DataWeave version 2.5.0._
### Parameters
Name | Type | Description  
---|---|---  
The `String` value to transform into a `LocalTime` value.  
`formatters` | Array<Formatter> | The `array` of formatting to use on the `LocalTime` value.  
### Example
This example shows how `toLocalTime` behaves with different inputs. It produces output in the `application/dw` format.
#### Source
```
%dw 2.0
import * from dw::util::Coercions
import * from dw::Runtime
output application/dw
---
{
 a: toLocalTime("23:57:59", [{format: "HH:mm:ss.n"}, {format: "HH:mm:ss"}]),
 b: try(() -> toLocalTime("23:57:59", [{format: "HH:mm:ss.n"}])).error.message
}
```

#### Output
```
{
 a: |23:57:59| as LocalTime {format: "HH:mm:ss"},
 b: "Could not find a valid formatter for '23:57:59'"
}
```

## toLocalTime(str: String, format: String | Null = null, locale: String | Null = null): LocalTime
Transforms a `String` value into a `LocalTime` value and accepts a format and locale.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The `String` value to transform into a `LocalTime` value.  
The formatting to use on the `LocalTime` value. A `null` value has no effect on the `LocalTime` value. This parameter accepts Java character patterns based on ISO-8601. A `LocalTime` value, such as `22:15:30.000000`, has the format `HH:mm:ss.n`.  
Optional ISO 3166 country code to use, such as `US`, `AR`, or `ES`. A `null` or absent value uses your JVM default.  
### Example
This example shows how `toLocalTime` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::util::Coercions
output application/json
---
{
  toLocalTimeEx: toLocalTime("23:57:59"),
  toLocalTimeEx2: toLocalTime("13:44:12.283","HH:mm:ss.n")
}
```

#### Output
```
{
 "toLocalTimeEx": "23:57:59",
 "toLocalTimeEx2": "13:44:12.283"
}
```
API Manager Release Notes | MuleSoft Documentation
# API Manager Release Notes
API Manager automatically updates to the latest version available; you don’t need to perform any tasks to move to the new version.
The following release notes are provided for API Manager:
  * API Manager 2.x Release Notes
  * API Manager Policies Release Notes
  * API Manager Proxy Release Notes
  * API Gateway Extensions Release Notes


To take advantage of all new features, improvements, and bug fixes, ensure that you are using the latest version of your runtime.
The following release notes are provided for your runtime:
  * Flex Gateway Release Notes
  * Mule Runtime Release Notes
Create Custom Server Properties (Hybrid) | MuleSoft Documentation
# Create Custom Server Properties (Hybrid)
Private Cloud Edition 
Runtime Manager enables you to define and configure server properties. These properties are defined as key-value pairs and are used by the JVM where the server is running. For example, you can set a property called `ENV=qa` that enables you to specify the environment of the server.
Server properties are stored in the `$MULE_HOME/conf/wrapper.conf` file on the system where Mule is installed.
Application properties defined in the `mule-app.properties` file override server properties specified in Runtime Manager. Application properties defined in Runtime Manager override application properties in `mule-app.properties`.
To specify server properties:
  1. From Anypoint Platform, select **Runtime Manager**.
  2. Click the **Servers** tab.
  3. Click the **Type** column to display the details pane.
  4. Click **Manage Server** , **Manage Group** , or **Manage Cluster**.
  5. On the **Settings** page, click the **Properties** tab:
Figure 1. The arrow shows the **Properties** tab on the **Settings** page.
  6. Enter the name of the property in the **Key** field.
  7. Enter the value of the property in the **Value** field.
  8. Click **Save**.


After creating a custom property, restart the server to apply the new property to the Mule configuration.
## See Also
  * Manage Properties for Applications On-Premises
  * View Server Properties
  * Shut Down, Restart, or Delete a Server
Box 5.3 XML and Maven Support | MuleSoft Documentation
# Box 5.3 XML and Maven Support
If you manually code a Mule application in XML either from the Studio XML editor or a text editor, you must perform the following actions to get access to a connector:
  1. Add the namespace for the connector to your XML flow.
  2. Add dependency information to your Maven `pom.xml` file.


In the Studio visual editor, when you drag a connector from the palette to the canvas, Studio automatically populates the XML code with the connector namespace and schema location.
## Add a Namespace for the Connector
Paste the following code inside the `mule` tag in the header of your XML configuration:
```
http://www.mulesoft.org/schema/mule/mule-box-connector
http://www.mulesoft.org/schema/mule/box-connector/current/mule-mule-box-connector.xsd
```

This example shows how the namespace statements are placed in the mule XML block:
```
<mule xmlns:mule-box-connector="http://www.mulesoft.org/schema/mule/mule-box-connector"
	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/mule-box-connector
	http://www.mulesoft.org/schema/mule/box-connector/current/mule-mule-box-connector.xsd">
```

## Add a POM File Dependency
The pom.xml Maven file generated by Anypoint Studio contains dependencies for a Mule app. When you code a Mule app manually, include this XML snippet in your pom.xml file to enable access to the connector.
```
<dependency>
 <groupId>com.mulesoft.connectors</groupId>
 <artifactId>mule-box-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, access the connector in Anypoint Exchange and click **Dependency Snippets**.
## Next
Now that you have read about XML support, you can try out the Box Examples Examples.
## See Also
MuleSoft Help Center
WSS Module | MuleSoft Documentation
# WSS Module
Anypoint WSS module enables you to process and validate an inbound SOAP request against a given Web Service Security (WSS) extension configuration to, for example, validate the request’s signature, perform an LDAP authentication, or decrypt the inbound message. The WSS module also enables you to sign your response by adding a WSS header to it, or to encrypt your outbound message.
For information about compatibility and fixed issues, see WSS Module Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The WSS module’s 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 access to:
  * The WSS module target resource
  * Anypoint Platform
  * Anypoint Studio version 7.x or later
  * Web Services Security (WSS) extension for SOAP


## Common Use Cases For the Connector
The WSS module enables you to validate WSS headers in inbound SOAP requests to your application to:
  * Decrypt a SOAP envelope according to the encryption information
  * Validate a signature
  * Verify the freshness of the message using `timestamp` information
  * Verify the `Username` and `Password` credentials of `UsernameToken`
  * Verify the `LDAP` credentials of `UsernameToken`
  * Determine whether `UsernameToken` is expired
  * Determine whether a SAML assertion expired
  * Verify the signature of a SAML assertion.
  * Verify that a SAML assertion has a specific confirmation method.


Using the WSS module, you can also add WSS headers to your outbound SOAP response to:
  * Encrypt some or all of your SOAP message content
  * Sign your SOAP message


See the WSS Module Examples section for detailed examples.
## Audience
  * New user
To create your Mule app, see:
    * Studio Configuration to help extend your understanding of WSS module.
    * Examples, with use case information for the connector
  * Advanced user
Read the following:
    * XML and Maven Support
    * Examples, with use case information for the 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
  *   * MuleSoft Help Center
some | MuleSoft Documentation
# some
## some<T>(list: Array<T>, condition: (T) -> Boolean): Boolean
Returns `true` if at least one element in the array matches the specified condition.
The function stops iterating after the first element that matches the condition is found.
### Parameters
Name | Description  
---|---  
The input array.  
`condition` | A condition (or expression) used to match elements in the array.  
### Example
This example applies a variety of expressions to elements of several input arrays. The `$` in the condition is the default parameter for the current element of the array that the condition evaluates. Note that you can replace the default `$` parameter with a lambda expression that contains a named parameter for the current array element.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
output application/json
---
{ "results" : [
  "ok" : [
   [1,2,3] some (($ mod 2) == 0),
   [1,2,3] some ((nextNum) -> (nextNum mod 2) == 0),
   [1,2,3] some (($ mod 2) == 1),
   [1,2,3,4,5,6,7,8] some (log('should stop at 2 ==', $) == 2),
   [1,2,3] some ($ == 1),
   [1,1,1] some ($ == 1),
   [1] some ($ == 1)
  ],
  "err" : [
   [1,2,3] some ($ == 100),
   [1] some ($ == 2)
  ]
 ]
}
```

#### Output
```
{
  "results": [
   {
    "ok": [ true, true, true, true, true, true, true ]
   },
   {
    "err": [ false, false ]
   }
  ]
 }
```

## some(list: Null, condition: (Nothing) -> Any): Boolean
Helper function that enables `some` to work with a `null` value.
_Introduced in DataWeave version 2.3.0._
Stream Idle Timeout Policy | MuleSoft Documentation
# Stream Idle Timeout Policy
**Policy Name** | Stream Idle Timeout  
---|---  
Sets the maximum duration a stream can remain idle without receiving a request or response  
Quality of Service  
**First Flex Gateway version available**  
**Returned Status Codes** | 504 - Stream timeout  
## Summary
The Stream Idle Timeout policy sets a maximum duration for which a stream can remain idle without receiving any data, either inbound from the client to Flex Gateway or outbound from Flex Gateway to the upstream service. The policy prevents idle connections from consuming resources unnecessarily. The timeout period starts at the last activity on the stream, whether the activity is a request or a response.
By default, all Flex Gateway API instances have a stream timeout of 300 seconds. Apply the policy to override the default timeout.
## Configuring Policy Parameters
### Flex Gateway Local Mode
In Local Mode, you apply the policy to your API via declarative configuration files. Refer to the following policy definition and table of parameters:
```
- policyRef:
  name: stream-idle-timeout-flex
 config:
  timeout: number // REQUIRED
```

Parameter | Required or Optional | Default Value | Description  
---|---|---|---  
Time in seconds before Flex Gateway closes the connection.  
#### Resource Configuration Example
```
- policyRef:
  name: stream-idle-timeout-flex
 config:
  timeout: 3
```

### Managed Flex Gateway and Flex Gateway Connected Mode
When you apply the policy to your API instance from the UI, the following parameters are displayed:
Element | Description | Required  
---|---|---  
Stream idle timeout |  Time in seconds before Flex Gateway closes the connection.