BassemE/mulesoft-documentation-embeddings huggingface dataset:
APIkit Overview | MuleSoft Documentation
# APIkit Overview
APIkit is a toolkit that simplifies the development of API-led applications for Mule developers. It scaffolds applications from a given specification, validates input parameters, and creates MUnit test suites. APIkit has a module for each supported web-service type:
  * APIkit for AsyncAPI supports AsyncAPI APIs.
  * APIkit for GraphQL supports GraphQL APIs.
  * APIkit for OData V2 and APIkit for OData V4 support OData APIs.
  * APIkit for REST supports RAML and OAS APIs.
  * APIkit for SOAP supports SOAP APIs.


With APIkit, incoming requests are intelligently routed to the appropriate endpoints based on the defined API contracts. This routing mechanism simplifies request handling, improves performance, and ensures that requests are processed by the correct API resources.
Although each module works with a family of web services, all modules share common usage patterns. So if you’re a Mule developer who works with SOAP APIs, you can work with GraphQL, RAML, OData, or OAS APIs.
## Features
  * APIkit generates the structure of a Mule application based on a supported API specification.
  * APIkit includes sources and operations that perform complex input validations according to the requirements in the API specification.
  * The APIkit for REST module includes an API console that enables you to experiment with the API project as you develop it.
  * Some APIkit modules include extensions for Anypoint Studio and Anypoint Code Builder for enhancing your editing experience in the supported development environments.


## Before You Begin Using APIkit
You must have access to Anypoint Studio or Anypoint Code Builder to scaffold a supported API specification with APIkit.
## APIkit Versions
APIkit works as a module with Mule runtime version 4. Documentation for the Mule 3 implementation of APIkit is available here. If you use APIkit on Mule 3, the module version matches the runtime version.
By default, Studio includes the APIkit for REST and APIkit for SOAP modules. If you need the GraphQL or OData modules, follow the installation instructions in each section.
## See Also
  * APIkit Compatibility
  * APIkit for AsyncAPI
  *   * APIkit for OData V2
  * APIkit for OData V4
  *   *
Downloading Monitors | MuleSoft Documentation
# Downloading Monitors
You can download a monitor and modify it on your computer. Then, you can either run the monitor by using the BAT CLI or upload the monitor into the online interface for API Functional Monitoring.
If you are new to writing monitors manually, you can download monitors, see how they are structured, and view the content of the files. The knowledge you gain can help you write your own monitors.
## Download a Monitor
  1. Select the monitor to download.
  2. Click the monitor to enter the monitor detail page.
  3. Click **More** () > **Download Monitor** to download a monitor as BAT source.
The ZIP file is downloaded with the following naming convention:
`<your Anypoint Platform group ID>_<the name of the monitor>_<the test version>.zip`
takeWhile | MuleSoft Documentation
# takeWhile
## takeWhile<T>(array: Array<T>, condition: (item: T) -> Boolean): Array<T>
Selects elements from the array while the condition is met but stops the selection process when it reaches an element that fails to satisfy the condition.
To select all elements that meet the condition, use the `filter` function.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The array of elements.  
`condition` | The condition (or expression) used to match an element in the array.  
### Example
This example iterates over the elements in the array and selects only those with an index that is `<= 1` and stops selecting elements when it reaches one that is greater than `2`. Notice that it does not select the second `1` because of the `2` that precedes it in the array. The function outputs the result into an array.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
output application/json
var arr = [0,1,2,1]
---
arr takeWhile $ <= 1
```

#### Output
## takeWhile(array: Null, condition: (item: Nothing) -> Any): Null
Helper function that enables `takeWhile` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
remove | MuleSoft Documentation
# remove
## remove(text: String, toRemove: String): String
Removes all occurrences of a specified pattern from a string.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The text to remove from.  
The pattern to remove.  
### Example
This example shows how the `remove` can be used to remove some unwanted properties.
#### Source
```
%dw 2.0
import remove from dw::core::Strings
output application/json
---
"lazyness purity state higher-order stateful" remove "state"
```

#### Output
```
"lazyness purity higher-order ful"
```

## remove(text: Null, toRemove: Any): Null
Helper function that enables `remove` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
indexWhere | MuleSoft Documentation
# indexWhere
## indexWhere<T>(array: Array<T>, condition: (item: T) -> Boolean): Number
Returns the index of the first occurrence of an element that matches a condition within the array. If no element matches the condition, the function returns `-1`.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The array of elements.  
`condition` | The condition (or expression) used to match an element in the array.  
### Example
This example returns the index of the value from the input array that matches the condition in the lambda expression, `(item) → item startsWith "Jul"`.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
output application/json
var users = ["Mariano", "Leandro", "Julian"]
---
users indexWhere (item) -> item startsWith "Jul"
```

## indexWhere(array: Null, condition: (item: Nothing) -> Any): Null
Helper function that enables `indexWhere` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Configuring Private Spaces | MuleSoft Documentation
# Configuring Private Spaces
After creating the private space, private network, and connections to external networks, you can configure the private space by:
  * Configure SSL Endpoints and Certificates
  * Configuring Domains and Certificates (TLS Context) for a Private Space
  * Configuring Firewall Rules to Manage Traffic to and from a Private Space
  * Associating Business Groups and Environments with a Private Space
  * Configuring Advanced Private Space Settings


## See Also
  * Gathering Required Setup Information
  * Creating Private Spaces
  * Creating VPN Connections
  * Creating Transit Gateway Attachments
  * Managing Private Spaces
Salesforce Composite Connector 2.8 | MuleSoft Documentation
# Salesforce Composite Connector 2.8
Anypoint Connector for Salesforce Composite enables you to work with the Salesforce Batch and SObject Tree APIs. The connector exposes convenient methods for preparing subordinate requests, executing them in one batch, and parsing the results.
Salesforce Composite Connector also enables you to create SObject trees by using the **Create sobject tree** operation, which is separate from the batch operations.
This connector provides DataSense for execution and to:
  * Prepare subordinate requests and then parse the responses
  * Create SObject trees


For compatibility information and fixed issues, see Salesforce Composite Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Salesforce Composite API
  * 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:
  * Credentials to access the Salesforce Composite target resource
  * Anypoint Studio version 7.0 or later


## Authentication Types
Salesforce Composite Connector connections use the following authentication types:
  * OAuth v2.0
  * OAuth JWT
  * OAuth SAML
  * OAuth Username and Password


For information about configuring these authentication types, see Using Anypoint Studio to Configure Salesforce Composite Connector.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Identifying APIs to Govern | MuleSoft Documentation
# Identifying APIs to Govern
APIs that meet the filter criteria in API Governance profiles become _governed APIs_. Identify the APIs to govern before creating your governance profiles to help ensure that:
  * You’re governing only the APIs that you want to govern.
  * API owners are ready for governance before they start receiving conformance notifications.


## Add Tags and Categories to APIs in Exchange
To identify sets of APIs to govern, apply tags and categories to the API assets in Exchange. You can then select tags and categories as filter criteria when you create your governance profiles.
  * To add asset tags, see Add and Remove Asset Tags in Exchange.
  * To add categories, see Add and Remove Categories in Exchange.


## Select and Add Tags in Governance Profiles
When you create or update a profile, you can filter the list of tags to find and select any not initially shown on the page. You can also add tag names in governance profiles if you have not yet added those tags to APIs in Exchange.
To select and add tags in profiles:
  1. When creating or updating a profile, navigate to the **Define Filter Criteria** page.
  2. Expand the **General > Tags** section.
The **Tags** section lists the most frequently used tags by default.
  3. Start typing a tag name in the search field to filter the list.
  4. If you don’t see a tag you want to use, type a tag name in the search field and press enter to add the tag.


## See Also
  * Applying Governance Rulesets to Specified APIs
  * API Governance Overview
Uploading Monitors | MuleSoft Documentation
# Uploading Monitors
You can upload a suite of tests that you have written and want to run as a monitor, viewing the results the information displays in the **Functional Monitoring** section of Anypoint Monitoring. When you create monitors by writing them, you can create more complex test cases by using features such as the DataWeave expression language and context variables for saving values between calls to endpoints.
## Before You Begin
  * Ensure that your user ID has the Monitoring Center User permission. An administrator for your organization can grant you this permission in Anypoint Access Management.
  * Write a suite of tests in the BDD test-writing language. For information about writing tests, see API Functional Monitoring with BAT CLI.
  * Determine the frequency at which you would like the monitor to endpoints in the test suite. The shortest interval is every fifteen minutes. You can also choose to run the monitor hourly, daily, weekly, or monthly. The schedule begins immediately after you upload the monitor. After you upload the monitor, you can create another schedule that is more detailed, if you prefer.
  * Determine which execution location you would like to run the monitor in.
  * If you have more than one configuration file in your test suite, determine which you plan to use for the monitor.


## Upload a Monitor
To create a monitor by uploading a test suite:
  1. In the **Functional Monitoring** section of Anypoint Monitoring, click **Upload Monitor**.
  2. Select the folder that contains your test suite.
For details on file structure and file requirements, see Example of a Test Suite.
  3. Click **Upload Monitor**.
  4. Click **Next**.
The **Monitor Detail** page opens.
  5. In the **Last executions** list, you can view the test result and how long the test ran.


## What to Do Next
You can view a list of monitor schedules in the schedules table. You can also disable and enable schedules.
The last executions table and the average times chart enable you to determine:
  * Whether the endpoint returned the expected code, as indicated by **PASSED** or **FAILED**
  * Statistics about the execution of the endpoint test


As your monitor continues to run at the scheduled intervals, the statistics in this table are updated, as well as the graph.
## See Also
  * API Functional Monitoring with BAT CLI
Troubleshooting Microsoft Azure Setup | MuleSoft Documentation
# Troubleshooting Microsoft Azure Setup
If you have issues configuring your Azure account with Mail Session (Outlook with OAuth), follow these troubleshooting steps to ensure your app is properly registered and configured:
  1. Register an App in Azure
  2. Create a Client Secret for the App
  3. Verify the Settings
  4. Add Permissions to the App


## Register an App in Azure
  1. Navigate to https://portal.azure.com/ and log in with your Azure account.
  2. Open the **App Registrations** page and create a new registration.
     * Select the supported account types.
     * Provide a Redirect URI.
For the configuration to work, you must specify a valid redirect URL, for example: `http://localhost:49453/`.


For additional instructions about registering apps in Azure, see Azure: Register a web application.
## Create a Client Secret for the App
After registering an app in Azure, the app’s setting page opens.
  1. Open the **Certificates & Secrets** page.
  2. Create a new client secret.
After creating the secret, ensure you copy its **Value** as this is the only time you can see it. After you leave this page, the secret is no longer accessible.   
---  


For additional instructions about creating client secrets, see Azure: Create a client secret.
In some cases, authentication might not work if you have more than one secret defined or use the 24 month expiration cycle. When your authentication in RPA Builder doesn’t work, try deleting all client secrets in your Azure app and adding a new client secret with an expiration cycle of 6 months.
## Verify the Settings
After registering the app and creating a client secret, open the app’s **Overview** page and ensure you have:
  * One secret under **Client Credentials**
  * One **Redirect URI**


If you created a Single-tenant app, locate the tenant ID for further use in the Mail Session (Outlook with OAuth) configuration.
Depending on the account type you selected when registering your app (Single or Multi tenant), the **OAuth Host** you configure in Mail Session (Outlook with OAuth) changes:
  * Multitenant: Specify `https://login.microsoftonline.com/common/oauth2/v2.0/` as the **OAuth Host** URL.
  * Single tenant: Specify `https://login.microsoftonline.com/{{YOUR_TENANT_ID}}/oauth2/v2.0/` as the **OAuth Host** URL.


## Add Permissions to the App
After registering your app and creating its client secret, configure permission settings:
  1. Open **API Permissions** in the side bar.
  2. Click **Add a Permission** and select **Microsoft Graph**.
  3. Select **Delegated Permissions** and add the following permissions from the **OpenId permissions** category:
     * `offline_access`
     * `profile`
  4. Select the appropriate permissions and protocols depending on your workflow needs:
     * Category `Mail`
     * Category `IMAP`
     * Category `EWS`
     * Category `POP`
     * Category `SMTP`
If you don’t know the permissions and protocols that apply to your case, select all of them.


## See Also
  *   * Azure Tutorial: Register a web application in Azure Active Directory B2C
Manage API Specs and Fragments | MuleSoft Documentation
# Manage API Specs and Fragments
Use API Designer for managing your API Specifications and API fragments.
With API Designer, you can:
  *   *   *   *   * API Specification for MuleSoft Connectivity Ecosystem
Repeatable vs. Non-Repeatable Streaming | MuleSoft Documentation
# Repeatable vs. Non-Repeatable Streaming
Understanding streaming strategies and choosing the one that best suits your use case is key to maximizing flow performance:
  * A non-repeatable stream (read payload only once) or
  * A repeatable stream (read payload more than once)


## Non-Repeatable Streaming
The non-repeatable strategy disables repeatable streams. If your use case requires reading the payload only once, use the `non-repeatable-stream` parameter in the connector. See the following example:
```
<file:read path="exampleFile.json">
 <non-repeatable-stream />
</file:read>
```

## Repeatable Streaming
Alternatively, if your use case requires reading the payload multiple times or concurrently, you can choose between the following strategies:
  * File-store streaming
  * In-memory streaming


### File-Store Repeatable Stream
When using the file-store repeatable stream strategy, customize the buffer size `inMemorySize` to your use case to optimize performance:
  * Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process because it requires additional memory.
  * Configure a smaller buffer size to decrease memory load at the expense of response time.


The following example sets a specific buffer size for a file-store repeatable stream for a file that is approximately 1 MB:
```
<file:read path="bigFile.json">
 <repeatable-file-store-stream
  inMemorySize="1"
  bufferUnit="MB"/>
</file:read>
```

Always run performance tests to find the optimal buffer size for your specific use case.
### In-Memory Repeatable Stream
When using the in-memory repeatable stream strategy, to manage larger or smaller files, customize the buffer by setting:
  * `initialBufferSize` The initial size
  * `bufferSizeIncrement` The rate at which the buffer increases.
  * `maxInMemorySize` The maximum buffer size.
  * `bufferUnit` The unit of measurement for the buffer size value.


Adjusting the in-memory buffer size (defaults to 512KB) based on your payload size and the expected concurrency.
The following example configures an in-memory repeatable stream with an initial size of 512 KB, which grows at a rate of 256 KB and allows up to 2000 KB (2 MB) of content in memory:
```
<file:read path="exampleFile.json">
 <repeatable-in-memory-stream
  initialBufferSize="512"
  bufferSizeIncrement="256"
  maxInMemorySize="2000"
  bufferUnit="KB"/>
</file:read>
```

Always run performance tests to find the optimal buffer size for your specific use case.
## See Also
  * Streaming in Mule Apps
everyCharacter | MuleSoft Documentation
# everyCharacter
## everyCharacter(text: String, condition: (character: String) -> Boolean): Boolean
Checks whether a condition is valid for _every_ character in a string.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The string to check.  
`condition` | Expression that iterates through the characters in the string that it checks and returns a Boolean value.  
### Example
This example determines whether a string is composed of only digits and spaces.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
---
"12 34 56" everyCharacter $ == " " or isNumeric($)
```

## everyCharacter(text: Null, condition: (character: Nothing) -> Any): true
Helper function that enables `everyCharacter` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Anypoint Flex Gateway Policy Development Kit (PDK) Release Notes | MuleSoft Documentation
# Anypoint Flex Gateway Policy Development Kit (PDK) Release Notes
Anypoint Flex Gateway Policy Development Kit (PDK) is a software development kit that enables you to develop Flex Gateway custom policies with ease.
PDK provides instructions to guide you through the policy development lifecycle, from implementing your Rust source code to releasing your policy on Exchange. Like included policies, you can apply custom policies to Flex Gateway running in Connected Mode by using API Manager or to Flex Gateway running in Local Mode by using YAML configuration files.
The following release notes are provided for PDK:
  * Anypoint Flex Gateway Policy Development Kit (PDK) Release Notes


## See Also
  * Flex Gateway Policy Development Kit (PDK) Overview
  * Flex Gateway Overview
Select Web Element | MuleSoft Documentation
# Select Web Element
Use this _Web Automation_ object to select an option from a list box or a drop-down box.
## Properties
  * **Select Index**
The index of the option to be selected. Only applicable if _Selection Method_ is _Index_.
  * **Select Text**
The text of the option to be selected. Only applicable if _Selection Method_ is _Text_.
  * **Select Value**
The value of the option to be selected. Only applicable if _Selection Method_ is _Value_.
  * **Selection Method**
Decide which method should be used to identify the option which should be selected from the list or drop-down box. This can either be _Index_ , _Text_ , or _Value_.


## Inbound Variables
  * **Element XPath**
  * **Window Title**


## Outbound Variables
The action step _Select Web Element_ possesses no outbound variables.
## Wizard
Use _Select Web Element_ to select an element inside a list or drop-down menu in a website or web application.
If the element you want to select has an underlying hyperlink, use _Click Element_ instead.
When you use the _Browser Wizard_ to select the drop-down menu that contains the element to use, all current options display in the **Available Options** field. After selecting an option, you can choose the method to identify it:
  * **Value** : The standard selection. On an average website, this is usually the value that changes the least.
  * **Text** : The text that shows in the picklist. Product names or similar values are easy to select in text form.
  * **Index** : The index might be imprecise, particularly on dynamic websites. Use **Index** only if the selected element is of secondary importance.
When using Internet Explorer, selecting an option by index takes longer than with other browsers.


You can use Pin variables to specify the value for the selection method.
acos | MuleSoft Documentation
# acos
## acos(angle: Number): Number | NaN
Returns an arc cosine value that can range from `0.0` through pi.
If the absolute value of the input is greater than `1`, the result is `null`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
Number to convert into it arc cosine value.  
### Example
This example shows how `acos` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::util::Math
output application/json
---
{
 "acos0": acos(0),
 "acos13": acos(0.13),
 "acos-1": acos(-1),
 "acos1": acos(1),
 "acos1.1": acos(1.1)
}
```

#### Output
```
{
  "acos0": 1.5707963267948966,
  "acos13": 1.440427347091751,
  "acos-1": 3.141592653589793,
  "acos1": 0.0,
  "acos1.1": null
 }
```
isLowerCase | MuleSoft Documentation
# isLowerCase
## isLowerCase(text: String): Boolean
Checks if the `text` contains only lowercase characters.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
### Example
This example shows how `isLowerCase` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import isLowerCase from dw::core::Strings
output application/json
---
{
 "a": isLowerCase(null),
 "b": isLowerCase(""),
 "c": isLowerCase(" "),
 "d": isLowerCase("abc"),
 "e": isLowerCase("aBC"),
 "f": isLowerCase("a c"),
 "g": isLowerCase("a1c"),
 "h": isLowerCase("a/c")
}
```

#### Output
```
{
 "a": false,
 "b": false,
 "c": false,
 "d": true,
 "e": false,
 "f": false,
 "g": false,
 "h": false
}
```

## isLowerCase(text: Null): Boolean
Helper function that enables `isLowerCase` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._
Troubleshooting Configuration and Deployment-Related Errors | MuleSoft Documentation
# Troubleshooting Configuration and Deployment-Related Errors
If you encounter errors as you set up your partners and message flows, the messages and solutions described here can help you resolve your issue.
Extending Your Network to Anypoint Platform with Private Spaces | MuleSoft Documentation
# Extending Your Network to Anypoint Platform with Private Spaces
## Before You Begin
  * Assign permissions.
  * Gather required setup information.


## Workflow
  1. Create the private space.
  2. Create the private network.
    1. Test the private network by deploying an app.
    2. Configure internal DNS servers, if necessary.
  3. Create a connection to an external network.
     * Create a VPN connection.
     * Connect to a transit gateway.
  4. Customize the private space:
    1. Configure domains and certificates (TLS context) for the private space.
    2. Configure firewall rules to manage traffic to the private space.
    3. Associate environments and business groups with the private space.
    4. Configure advanced settings, including HTTP request handling and ingress load balancer log levels.


## See Also
  * Creating Private Spaces
  * Configuring Private Spaces
Important Notifications | MuleSoft Documentation
# Important Notifications
Use these sources to stay informed about new releases and downtime for Anypoint API Community Manager.
## Release Announcements
Upgrades are applied automatically to Anypoint API Community Manager versions 2.0 and later.
Details about new releases are announced in the API Community Manager release notes.
For further information, contact your MuleSoft customer success representative.
## Downtime
MuleSoft and Salesforce report and monitor platform downtime at http://trust.mulesoft.com and http://trust.salesforce.com.
## See Also
Configuring Replicas for Flex Gateway in Local Mode | MuleSoft Documentation
# Configuring Replicas for Flex Gateway in Local Mode
Add a Flex Replica as a Linux Service |  Add a Flex Replica in a Docker Container  
---|---  
## Flex Replicas
A Flex Replica is an instance of Flex Gateway. Setting up your gateway layer with multiple Flex Gateway replicas enables the APIs deployed on Flex Gateway to serve more traffic.
When using Flex Gateway to manage APIs in production, configure more than one Flex Replica to avoid a single point of failure. Running multiple Flex Replicas also increases performance if your API service receives a significant amount of traffic.
## Before You Begin
Before getting started, ensure you have completed the following tasks:
  * Install a Flex Gateway
  * Register and Run in Local Mode


## Add a Flex Replica as a Linux Service
Adding a Flex Replica as a Linux Service includes the following tasks:
  * Copy and paste the registration file created during registration to your Linux machine or VM.
  * Run the Flex Gateway start command.


### Copy the Registration File
Copy the `registration.yaml` file to the following location on your Linux machine or VM:
  * `/usr/local/share/mulesoft/flex-gateway/conf.d`


### Start Commands
Start Flex Gateway with the following command:
```
sudo systemctl start flex-gateway
```

Verify that the Flex Gateway service is running successfully:
```
systemctl list-units flex-gateway*
```

If `flex-gateway.service` has a status of `active`, Flex Gateway is successfully running.
```
 UNIT               LOAD  ACTIVE SUB   DESCRIPTION
 flex-gateway.service       loaded active running Application
```

## Add a Flex Replica in a Docker Container
To add a Flex Replica in a Docker Container you must run the Flex Gateway start command using the same `registration.yaml` file created during registration. If you are running the container locally, you will also need to use a different port.
```
docker run --rm \
-v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \
-p 8080:8080 \
mulesoft/flex-gateway
```

Specify an optional name you want to assign to your Flex Replica by including the following: `-e FLEX_NAME=<name-for-flex-replica> \`.   
---
DataWeave (dw) Format | MuleSoft Documentation
# DataWeave (dw) Format
MIME type: `application/dw`
The DataWeave (dw) format is the canonical format for all transformations. This format can help you understand how input data is interpreted before it is transformed to a new format.
This format is intended to help you debug the results of DataWeave transformations. It is significantly slower than other formats. It is not recommended to be used in production applications because it can impact the performance.  
---  
## Example: Express XML in the DataWeave (dw) Format
The following example shows how to transform XML input to the DataWeave (dw) format.
### Input
The example uses the following XML snippet as input.
```
<employees>
 <employee>
  <firstname>Mariano</firstname>
  <lastname>DeAchaval</lastname>
 </employee>
 <employee>
  <firstname>Leandro</firstname>
  <lastname>Shokida</lastname>
 </employee>
</employees>
```

#### Output
Output: in DataWeave Format
```
{
 employees: {
  employee: {
   firstname: "Mariano",
   lastname: "DeAchaval"
  },
  employee: {
   firstname: "Leandro",
   lastname: "Shokida"
  }
 }
} as Object {encoding: "UTF-8", mimeType: "text/xml"}
```

## Configuration Properties
DataWeave supports the following configuration properties for this format.
### Reader Properties
This format accepts properties that provide instructions for reading input data.
Parameter | Type | Default | Description  
---|---|---|---  
`externalResources` |  Enables the `readUrl` to read external entities. Valid values are `true` or `false`.  
`javaModule` |  Enables Java module functions to load. Valid values are `true` or `false`.  
Handles only data and not other types of content, such as functions, when set to `true`. The DataWeave parser runs faster in the `onlyData` mode. Valid values are `true` or `false`.  
`privileges` |  Accepts a comma-separated list of privileges to use in the format, such as `'Resources,Properties'`.  
### Writer Properties
This format accepts properties that provide instructions for writing output data.
Parameter | Type | Default | Description  
---|---|---|---  
`bufferSize` |  Size of the buffer writer, in bytes. The value must be greater than `8`.  
Generates the output as a data stream when set to `true`, and defers the script’s execution until the generated content is consumed. Valid values are `true` or `false`.  
`ignoreSchema` |  Ignores the schema when set to `true`. Valid values are `true` or `false`.  
String to use for indenting.  
`maxCollectionSize` |  Maximum number of elements allowed in an array or an object. `-1` indicates no limitation.  
Handles only data and not other types of content, such as functions, when set to `true`. The DataWeave parser runs faster in the `onlyData` mode. Valid values are `true` or `false`.  
## Supported MIME Types
This format supports the following MIME types.
fromHex | MuleSoft Documentation
# fromHex
## fromHex(hexString: String): Binary
Transforms a hexadecimal string into a binary.
### Parameters
Name | Description  
---|---  
`hexString` | A hexadecimal string to transform.  
### Example
This example transforms a hexadecimal string to "Mule". To make the resulting type clear, it outputs data in the `application/dw` format.
#### Source
```
%dw 2.0
import * from dw::core::Binaries
output application/dw
---
{ "hexToBinary": fromHex("4D756C65") }
```

#### Output
```
{
  hexToBinary: "TXVsZQ==" as Binary {base: "64"}
}
```
Box Connector 5.0 | MuleSoft Documentation
# Box Connector 5.0
Box is an online file sharing and content management service for businesses. Anypoint Connector for Box (Box Connector) is a RAML-based connector that provides synchronization of data and automation of processes between Box and third party CRMs, CMS, mobile, and social applications. Because this is a RAML-based connector, it only uses REST calls to interact with the Box 2.0 API and supports only a subset of available API services.
## Before You Begin
Before creating an app, you must have access to the Box target resource and Anypoint Platform. You must also understand how to create a Mule app using Anypoint Studio.
You should be familiar with the use of the Box 2.0 API, Mule, Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and global elements.
To use this connector you need the following:
  * A developer account or other valid Box instance.
  * MuleSoft Enterprise License and necessary entitlements.


## Next Step
After you complete the prerequisites, you are ready to create an app with Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Box Connector on Exchange
  * MuleSoft Help Center
Salesforce Marketing Cloud REST Connector 1.1 | MuleSoft Documentation
# Salesforce Marketing Cloud REST Connector 1.1
Anypoint Connector for Salesforce Marketing Cloud REST (Salesforce Marketing Cloud REST Connector) enables you to integrate with the Salesforce Marketing Cloud marketing platform. This connector exposes operations provided by the Salesforce Marketing Cloud REST API.
For information about compatibility and fixed issues, refer to the Salesforce Marketing Cloud REST Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Salesforce Marketing Cloud REST 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 Salesforce Marketing Cloud REST target resource
  * Anypoint Platform
  * Anypoint Studio version 7.3.5 or later


## Connection Types
Salesforce Marketing Cloud REST connections use the OAuth Client Credentials authentication type, which enables a client to use its own credentials.
## 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
  * Salesforce Marketing Cloud REST Connector Reference
  * MuleSoft Help Center
fromBase64 | MuleSoft Documentation
# fromBase64
## fromBase64(base64String: String): Binary
Transforms a Base64 string into a binary value.
### Parameters
Name | Description  
---|---  
`base64String` | The Base64 string to transform.  
### Example
This example takes a Base64 encoded string and transforms it into a binary value. This example assumes that the `payload` contains the Base64 string generated from an image in example toBase64. The output of this function is a binary value that represents the image generated in example toBase64.
#### Source
```
%dw 2.0
import * from dw::core::Binaries
output application/octet-stream
---
fromBase64(payload)
```
Read from Excel File | MuleSoft Documentation
# Read from Excel File
Use the _Read from Excel File_ action step to read the contents of an Excel file. The result will be saved as a string or an array, which you can then use as an Outbound Variable in subsequent action steps.
The _Read from Excel File_ action step can only be used inside an Excel Session. Specify the source file in the Excel Session.
## Properties
**Excel Operation Settings**
  * **Column**
Specifies the column to read. You can enter letters or numbers in this field. If you enter a number, this will correspond to the number of the column in the Excel file. For example, instead of A for column A, you can enter a 1 for column A, a 2 for column B (instead of the letter B), and so on.
  * **Range**
Specifies the read mode to use:
    * **Cell**
Reads text from a specific cell and outputs the result as a string.
    * Reads text from a complete row and outputs the result as an array.
    * **Column**
Reads text from a complete column and outputs the result as an array.
  * Specifies the cell or row number to read.
  * **Sheet name**
Name of the spreadsheet. Under Properties you can only enter the name directly, unlike in the Wizard.


**Troubleshooting settings**
  * **Disable recalculation of date formulas**
Disables the recalculation of cell values formatted as DateTime to prevent RPA Builder from becoming unresponsive while it finishes calculating formulas that contain many dependencies.


## Inbound Variables
**Sheet name** Name of the spreadsheet.
**Column** This is where you enter the column that is to be read. You can enter letters or numbers in this field. If you enter a number, this will correspond to the number of the column in the Excel file.
**Row** This is where you enter the cell or row number that should be read.
## Outbound Variables
**Read from Excel File.Result** This variable is output as a string. The result will only be shown to you if you have selected the _Cell_ mode.
If you have selected _Row_ or _Column_ mode, an error message will be displayed and the Workflow cannot be executed.
**Read from Excel File.ResultAsArray** This variable will be output as an array if you have selected Column or Row as the mode.
**Read from Excel File.HasContent** (Bool) This is how you check whether a specific cell, row or column has content. If there is content, the result will be _True_ and if there is no content the result will be _False_. If in the case of rows or columns only a single cell is populated, the result is _True_.
## Wizard
The **Sheet name** field is for selecting the spreadsheet from which text should be read. You can type directly into the input field, select an existing sheet from the drop-down list or connect with a Pin Variable. The drop-down lists contains all the sheets saved within the Excel file.
In **Excel Mode** you specify via the drop-down list whether to read a cell, a row or an entire column. You can enter letters or numbers as a value or connect with a Pin Variable.
isNothingType | MuleSoft Documentation
# isNothingType
## isNothingType(t: Type): Boolean
Returns `true` if the input is the Nothing type.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The type to check.  
### Example
This example shows how `isNothingType` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::core::Types
type ANothing = Nothing
output application/json
---
{
  a: isNothingType(ANothing),
  b: isNothingType(Nothing),
  c: isNothingType(String),
}
```

#### Output
```
{
 "a": true,
 "b": true,
 "c": false
}
```
Handling User Tasks | MuleSoft Documentation
# Handling User Tasks
User tasks are elements of a process model, which cannot be processed fully automatically by a bot, instead requiring the support of a human.
Examples of such tasks include the input of data that could not be read automatically, or decisions that must be reviewed by humans for legal reasons.
If, during execution of a process, the bot comes across a user task, it shows the task to all assigned users. As soon as an employee has completed processing the user task, the bot resumes its work automatically with the next process step.
## Before You Begin
  * User tasks are configured in RPA Builder and show up during execution of the process.
  * The user assignment is done while the user creates the process run configuration.


## Claim a User Tasks
Claim a user task to reserve processing of the user task for yourself. The user task is then moved to your personal task list in the **My User Tasks** view.
  1. In the **Team Tasks** view of the **My RPA** module, click **Claim Task** in the row of the task you want to process.


## Process a User Task
Open a user task and review or change its data to continue the process. After you complete the task, the bot carries on.
  1. In the **My User Tasks** view of the **My RPA** module, click **Open Task** in the row of the task you want to process.
  2. Review the data.
  3. Input or change data if necessary.
  4. Click **Finish**.
Verifying SAML Information | MuleSoft Documentation
# Verifying SAML Information
During verification of SAML information, if you determine that information must be changed, sign in to the MuleSoft Support Portal and submit a request.
  1. In Anypoint Platform, click Access Management > External Identity.
  2. From Identity Management, select SAML 2.0.
Your SAML 2.0 configuration appears.
  3. Verify that the group_attribute value is set to the correct attribute name.
In the following example of a SAML assertion, the group_attribute is "memberOf":
```
<saml:Attribute NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" Name="memberOf">
 <saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">cn=jira-users,ou=groups,dc=muleforge,dc=org</saml:AttributeValue>
 <saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">cn=confluence-users,ou=groups,dc=muleforge,dc=org</saml:AttributeValue>
 <saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">cn=mule-community,ou=groups,dc=muleforge,dc=org</saml:AttributeValue>
 <saml:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">cn=SR-User,ou=Groups,dc=muleforge,dc=org</saml:AttributeValue>
</saml:Attribute>
```



## See Also
MuleSoft Support Portal
Tokenization Service Configurations | MuleSoft Documentation
# Tokenization Service Configurations
The way you configure and use the tokenization service depends on your Mule implementation.
## Apply a Tokenization Policy to the API Gateway
You can apply a tokenization policy to configure the API gateway capability of Mule 4 to tokenize or detokenize request and response data sent between the Anypoint Runtime Fabric inbound load balancer and the Mule app.
See Apply a Tokenization Policy to the API Gateway
## Expose Tokenization as a Service to Mule Apps
When extra data processing is required, a Mule application can add business logic to send tokenization and detokenization requests directly to the tokenization service as part of its processing.
See Expose Tokenization as a Service Directly to Mule Applications
Simple Security Manager Policy | MuleSoft Documentation
# Simple Security Manager Policy
The Simple Security Manager policy lets you configure a security manager with a username and password that you can define at the policy level.
## Prerequisites
This document assumes that you are an API Versions Owner for the API version that you want to manage, or that you are a member of the Organization Administrators role.
## How Does This Policy Work?
This policy acts as a simple security manager to be used by policies which require one (such as Basic Authentication policy). It validates only one username and password combination. Usually used for testing/demonstrations purposes.
When setting up this policy, you need to send requests to your APIs using a basic authentication mechanism specifying the username and password that you previously configured.
## Policy Configuration
Element | Description  
---|---  
The username that your simple security manager policy uses to authenticate your requests.  
The password that your simple security manager policy uses to authenticate your requests.  
## See Also
  * LDAP Security Manager
Redis Connector 5.4 XML and Maven Support | MuleSoft Documentation
# Redis Connector 5.4 XML and Maven Support
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 install 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/redis
http://www.mulesoft.org/schema/mule/redis/current/mule-redis.xsd">
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<mule xmlns:redis="http://www.mulesoft.org/schema/mule/redis"
	xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:spring="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-current.xsd
	http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.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/tracking
	http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
	http://www.mulesoft.org/schema/mule/redis
	http://www.mulesoft.org/schema/mule/redis/current/mule-redis.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>com.mulesoft.connectors</groupId>
 <artifactId>mule-redis-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 `redis`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## Next
After completing your namespace and `pom.xml` file, you can try the Redis Examples.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Debugging Deployed Custom Policies | MuleSoft Documentation
# Debugging Deployed Custom Policies
Errors that are not present in the PDK debugging playground or PDK’s integration might be present when the policy is applied to an API instance in a production environment.
To use debug logs in a production environment, see Troubleshooting Self-Managed Gateway with Debug Logs.
For more information about monitoring Flex Gateway, see Monitoring Flex Gateway.
## See Also
  * Debugging Custom Policies with the PDK Debugging Playground
  * Writing Integration Tests
Setting Up Runtime Fabric | MuleSoft Documentation
# Setting Up Runtime Fabric
The following topics help you install, configure, uninstall, and upgrade Anypoint Runtime Fabric.
  * Preparing your VM/Bare Metal Cluster for Runtime Fabric Installation Ensure that the VM/Bare metal cluster underlying infrastructure meets the necessary hardware and networking requirements to install Runtime Fabric effectively.
  * Configuring Network Configure ports and hostnames correctly before installing Runtime Fabric.
  * Installing Runtime Fabric Install Runtime Fabric using `rtfctl`, Helm, as a Kubernetes (K8s) operator, or install multiple instances of Runtime Fabric.
  * Configuring Runtime Fabric Configure network connections, ingress, Red Hat OpenShift routes, persistence gateway, proxies, and associate business groups and environments. Additionally, you can use `rtfctl` to configure Runtime Fabric.
  * Uninstalling Runtime Fabric Unistall Runtime Fabric using `rtfctl`, Helm, or on Red Hat OpenShift.
  * Upgrading Runtime Fabric Upgrade Runtime Fabric using `rtfctl`, Helm, or as a Kubernetes (K8s) operator.


## See Also
  * Managing Runtime Fabric
  * Hardening Runtime Fabric
substringBeforeLast | MuleSoft Documentation
# substringBeforeLast
## substringBeforeLast(text: String, separator: String): String
Gets the substring before the last occurrence of a separator. The separator is not returned.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
`separator` | String to search for.  
### Example
This example shows how `substringBeforeLast` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
 "a": substringBeforeLast(null, "'"),
 "b": substringBeforeLast("", "-"),
 "c": substringBeforeLast("abc", "b"),
 "d": substringBeforeLast("abcba", "b"),
 "e": substringBeforeLast("abc", "d"),
 "f": substringBeforeLast("abc", "")
}
```

#### Output
```
{
 "a": null,
 "b": "",
 "c": "a",
 "d": "abc",
 "e": "",
 "f": "ab"
}
```

## substringBeforeLast(text: Null, separator: String): Null
Helper function that enables `substringBeforeLast` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._