BassemE/mulesoft-documentation-embeddings huggingface dataset:
Amazon DynamoDB XML and Maven Support | MuleSoft Documentation
# Amazon DynamoDB 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.
You can avoid this manual process by using Studio. 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/dynamodb
http://www.mulesoft.org/schema/mule/dynamodb/current/mule-dynamodb.xsd
```

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

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by 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 this connector:
```
<dependency>
 <groupId>com.mulesoft.connectors</groupId>
 <artifactId>mule-amazon-dynamodb-connector</artifactId>
 <version>n.n.n</version>
 <classifier>mule-plugin</classifier>
</dependency>
```

Replace `n.n.n` 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 `amazon dynamodb`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## Next Step
After creating your namespace and `pom.xml` file, you can try the Examples.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Credit Card Formats | MuleSoft Documentation
# Credit Card Formats
Tokenization replaces original card data with tokenized data according to the way you configure the credit card data domain when you create a tokenization format.
## Customize Credit Card Formats
You can use the built-in credit card formats, or customize them.
  1. Select **Use custom credit card formats** , and click **Add Format**. You can also click **Edit** next to an existing credit card format to change the format.
  2. In the **Add Credit Card Format** dialog, enter the information for the customized fields, then click **Done**.


Field | Description  
---|---  
Name of the card customization.  
Start Prefix | Digits the card prefix starts with, for example `51`.  
End Prefix | Digits the card number prefix range ends with, for example, `55`. Using the example values of 51 for the start prefix and 55 for the end prefix means that cards beginning with 51 through 55 are valid.  
Luhn Check Digit | Select the **Include** checkbox if you want to verify the card conforms to the Luhn standard. All formats must have **Check Digit** set to **Luhn** or **None**. A separate format is required if you need some for luhn and some for none.  
Number of Digits | Enter the total number of digits the card number should have.  
### Customize the Fields
  1. Click **Credit Card Formats**.
  2. Select **Use custom credit card formats**.
  3. Click **Edit**.
  4. In the **Edit Credit Card Format** dialog, make your changes, then click **Done**.
  5. Click **Save** in the **Create Format** page.
Disconnecting the Portal | MuleSoft Documentation
# Disconnecting the Portal
Anypoint can only connect to one Salesforce organization; only one API portal can be created for that organization. Portal administrators can disconnect a portal when a portal is no longer needed or when you want to create a new portal with the same Salesforce organization.
Disconnecting your API portal removes artifacts from the API Experience Hub database and unlinks Anypoint to your Salesforce organization so that you can create another API portal.
To create a new API portal, you must disconnect the current API portal from your Salesforce organization. This process unlinks Anypoint to your Salesforce organization. You can then link your Anypoint account to a new Salesforce organization.
To disconnect:
  1. From the **Manage your API portal** page, click **Settings**.
  2. Click **Disconnect Salesforce Org**.
  3. To disconnect, click **Disconnect Salesforce Org** from the message.


## See Also
  * Connecting to Salesforce
daysBetween | MuleSoft Documentation
# daysBetween
## daysBetween(from: Date, to: Date): Number
Returns the number of days between two dates.
### Parameters
Name | Description  
---|---  
From date (a `Date` type).  
To date (a `Date` type). Note that if the `to` date is _earlier_ than the `from` date, the function returns a negative number equal to the number of days between the two dates.  
### Example
This example returns the number of days between the specified dates.
#### Source
```
%dw 2.0
output application/json
---
{ days : daysBetween('2016-10-01T23:57:59-03:00', '2017-10-01T23:57:59-03:00') }
```

#### Output
```
{ "days" : 365 }
```
About Loading a Static Resource | MuleSoft Documentation
# About Loading a Static Resource
You can configure the HTTP connector to load a static resource, such as your home page or a script. You set the path and file name of a resource to load. You optionally set the name of another file in the same directory as the resource to use in case of failure.
## See Also
  * To Load a Static Resource
  * HTTP Connector XML Reference
  * HTTP Connector Reference
Exclusive Optionals | MuleSoft Documentation
# Exclusive Optionals
When you are developing a module that provides several ways of configuring the same thing, but only one of them should be used, you might need to set the following rule:
  * From a given set of parameters, only one shall be used at any time.


You use `@ExclusiveOptionals` to enforce this restriction.
## @ExclusiveOptionals
The `@ExclusiveOptionals` annotation can only be used on types that are used as a `@ParameterGroup` (see Parameters for details).
Example
```
@ExclusiveOptionals
public class ExclusiveOptionalsExample {
  @Parameter
  private String requiredParameter;
  @Parameter
  @Optional
  private String optionalParameter;
  @Parameter
  @Optional
  private String anotherOptionalParameter;
}
```

As the name of the annotation implies, the exclusivity restriction only applies to the optional parameters. So, setting `requiredParameter` at the same time as `optionalParameter` or `anotherOptionalParameter` is allowed, but setting `optionalParameter` and `anotherOptionalParameter` at the same time causes an error to be thrown.
Tip: You can have as many parameters as you want inside an object that is annotated with `@ExclusiveOptionals`, but only one optional parameter is allowed to be set at any time.
## Enforcing At Least One Parameter
There can be cases where exactly one (but no more than one) of the optional parameters must be set. You can configure this requirement by using `@ExclusiveOptionals(isOneRequired = true)`, for example:
```
@ExclusiveOptionals(isOneRequired = true)
public class OneRequiredExample {
  @Parameter
  private String requiredParameter;
  @Parameter
  @Optional
  private String optionalParameter;
  @Parameter
  @Optional
  private String anotherOptionalParameter;
}
```

So, an error is thrown if you set `requiredParameter` but do not set one of the optional parameters: `optionalParameter` or `anotherOptionalParameter`.
Intercom Connector 1.0 | MuleSoft Documentation
# Intercom Connector 1.0
Anypoint Connector for Intercom (Intercom Connector) synchronizes data and automates business processes between Google Sheets and third-party applications, either on-premises or in the cloud.
Intercom is an enterprise-grade messaging platform to help customers easily learn about the company’s products and contact the service and support teams, via a conversational chatlike interface.
For compatibility information and fixed issues, see the Intercom Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Intercom APIs
  * 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 target resource
  * Anypoint Studio version 7.3.5 or later


## Common Use Cases for the Connector
Automate powerful business processes by integrating Intercom with other IT tools and systems in your enterprise such as messaging, CRM, ITSM and other enterprise systems. Possibilities include:
  * Qualify customer leads efficiently by automating a flow where any time a new customer reaches out via Intercom’s chat functionality, a new lead or opportunity is created in Salesforce for a sales representative follow-up.
  * Enhance customer experience by notifying the relevant teams (such as customer support, product) via Slack or MS Teams instantly any time a customer reaches out with an issue via Intercom’s chat.
  * Keep all your teams in sync with the most recent and relevant information around a customer synced across Intercom and your other IT systems via bi-directional sync automation. This can be your case data within your customer support system, your new leads data in your CRM system, or issue data in your ITSM system.


## Authentication Types
Intercom Connector connections use the following authentication methods:
  * OAuth 2.0
  * Unsecure connection provider


## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  *   * MuleSoft Help Center
Deleting Monitors | MuleSoft Documentation
# Deleting Monitors
Although you can easily delete unnecessary monitors, there is no cost in keeping them.
## Before You Begin
Ensure that your user ID has the following permission set in Access Management:
  * **Exchange > Exchange Administrator**


See Manage Permissions.
## Delete a Monitor
Delete a monitor either from the homepage or from its detail page.
To delete a monitor from the homepage:
  1. Hover over the test to delete.
  2. Click **Delete** ().
  3. In the **Delete Monitor** dialog, click **Delete**.


To delete a monitor from its detail page:
  1. Select the monitor that you want to delete.
  2. Click the monitor.
  3. Click **More** () > **Delete Monitor**.
  4. In the **Delete Monitor** dialog, click **Delete**.
The monitor and its schedules are deleted. The workers provisioned for the schedules are also deleted, and their consumed resources are made available to other workers.
Troubleshoot Access Management | MuleSoft Documentation
# Troubleshoot Access Management
These tips provide information on what to do if you encounter issues.
## Problems with Accessing Anypoint Platform
### Signin Credentials are Not Recognized
If your credentials aren’t recognized when you sign in to Anypoint Platform, try the following:
  * Check that you are using the correct URL to sign in to your organization.
If your organization uses an external identity management system, your signin URL is **anypoint.mulesoft.com/accounts/login/_yourOrganizationDomain_**.
  * Verify that you are using the correct username and password for the account.
  * If your organization isn’t using an external identity management system and your signin credentials aren’t working, reset your password or ask your Organization Administrator if your account is still active.


### Access Management Invitation Link Returns an Error
If you click the link in your invitation and an error is returned, your invitation may have expired or been rescinded. Please contact your Organization Administrator for a new invitation.
## OpenID Connect Client Management
### Error received when you try to update a client application
If you receive an `There was an error while talking to CoreServices` when you try to update a client application under OpenID Connect management, this is because updates of clients created through this integration are not currently supported.
See Configure OpenID Connect Client Management
### Error Received When Doing a Redirect
When a redirect to the OpenID Connect Provider occurs, you receive an `Invalid Scopes error`.
Cause: This can happen if the `openid`, `profile`, and `email` scopes aren’t supported by the auto-registered client.
Solution: Add the `openid`, `profile`, and `email` scopes to the client manually.
Work with Multipart Data | MuleSoft Documentation
# Work with Multipart Data
The following example iterates over a multipart payload and extracts data from each part.
The example uses the following functions:
  * `read` (in the script’s header) reads the multipart content from a `multi` variable that sets the boundary to `34b21`.
  * `mapObject` iterates over the parts in the multipart data returned by `read` and returns the index and `name` key of each part within a JSON object.


DataWeave Script:
```
%dw 2.0
output application/json
var multi = '--34b21
Content-Disposition: form-data; name="text"
Content-Type: text/plain
Book
--34b21
Content-Disposition: form-data; name="file1"; filename="a.json"
Content-Type: application/json
{
 "title": "Java 8 in Action",
 "author": "Mario Fusco",
 "year": 2014
}
--34b21
Content-Disposition: form-data; name="file2"; filename="a.html"
Content-Type: text/html
<!DOCTYPE html>
<title>
 Available for download!
</title>
--34b21--'
var parsed = read(multi, "multipart/form-data", {boundary:'34b21'})
---
parsed.parts mapObject ((value, key, index) -> {(index): key})
```

Output:
```
{
 "0": "text",
 "1": "file1",
 "2": "file2"
}
```

For additional examples, see Multipart Format (Form Data) examples and functions referenced in Multipart (dw::module::Multipart).
## See Also
  * DataWeave Selectors
  *
Migrating the Anypoint Enterprise Security (AES) features | MuleSoft Documentation
# Migrating the Anypoint Enterprise Security (AES) features
In Mule 4, the Anypoint Enterprise Security module was split into different modules:
  * Cryptography Module replaces the Mule 3 Encryption and Signature modules
  * Secure Configuration Properties Module replaces the Mule 3 Secure Property Placeholder
  * Validation Module incorporated functionality from the Mule 3 Filters Module
  * OAuth2 Provider replaces the Mule 3 OAuth2 Provider


Please refer to the above modules documentation for information on how to migrate to Mule 4.
Modifying Monitors | MuleSoft Documentation
# Modifying Monitors
You can modify monitors in API Functional Monitoring, which includes the options to edit the monitor as text fields or to edit the monitor as BAT source. Additionally you can download the monitor as BAT source, edit the monitor in your text editor of choice, and then upload the monitor. You can modify a monitor from either the homepage or the monitor’s detail page.
## Before You Begin
Ensure that you have the following permissions set in Access Management:
  * **Anypoint Monitoring > Viewer** or **Anypoint Monitoring > Administrator**
  * **Exchange > Exchange Administrator** or **Exchange > Exchange Contributor**


An Anypoint Platform administrator for your organization grants permission. See Manage Permissions.
## Modify a Monitor from the Home Page
To modify a monitor from the homepage:
  1. Hover over the name of the monitor you want to modify.


## Modify a Monitor from its Details Page
To modify a monitor from its detail page:
  1. Select the monitor that you want to modify.
  2. Click **More** () next to the monitor name.
  3. Click **Edit Monitor**.


You can edit the endpoints' **Validate SSL Certificate** toggle setting, methods, URLs, optional headers, and assertions. See Creating Monitors for more detail on the fields.
Click **Switch to code editor** to edit the monitor as BAT source. For more details, see BDD Test-Writing Syntax Reference.
## See Also
  *   * Downloading Monitors
  *
MuleSoft Accelerator for Retail | MuleSoft Documentation
# MuleSoft Accelerator for Retail
MuleSoft Accelerator for Retail empowers retail IT teams to unlock data from systems including ERP, CRM, MDM, commerce, and marketing to activate digital projects faster. Retail IT teams can take advantage of pre-built APIs, connectors, implementation templates, and reference architecture to create customer 360 profiles.
## Use Cases
The following use cases are supported by the MuleSoft Accelerator for Retail:
  * Customer profile sync - The Customer profile sync use case enables retail developers to create a customer 360 view by unlocking customer data from disparate systems.
  * Sales order sync - The Sales order sync use case enables retail developers to create and update sales orders across relevant applications.
  * Product sync - The Product sync use case enables retail developers to update product details in Salsify across relevant applications.
  * Real-time inventory management - The Real-time inventory management use case enables customers to make an informed decision of their online purchase based on real-time inventory of a product in nearby stores.
  * Deliver relevancy with CDP - The Deliver relevancy with CDP use case enables retail developers to combine customer profile data in a standardized format.
  * POS Integration - The Point of Sale (POS) Integration use case enables retail developers to leverage pre-built integrations to connect order and loyalty data from POS systems to Salesforce Loyalty Management and Data Cloud.


## See Also
  *   *   *   * MuleSoft Accelerator for Retail on Exchange
isBinaryType | MuleSoft Documentation
# isBinaryType
## isBinaryType(t: Type): Boolean
Returns `true` if the input is the Binary type.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The type to check.  
### Example
This example shows how `isBinaryType` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::core::Types
type ABinary = Binary
output application/json
---
{
  a: isBinaryType(ABinary),
  b: isBinaryType(Binary),
  c: isBinaryType(String),
}
```

#### Output
```
{
 "a": true,
 "b": true,
 "c": false
}
```
Troubleshooting OAuth Module | MuleSoft Documentation
# Troubleshooting OAuth Module
To troubleshoot OAuth module, become familiar with the information about enabling verbose logging and interpreting commonly throw messages.
## Enable Verbose Logging
To get a better understanding of why an application’s interaction with OAuth module is failing, temporarily enable verbose logging for the module.
Remember to always disable the enhanced verbosity after troubleshooting, because it affects your Mule application performance.
To enable verbose logging in the configuration file:
  1. Access Anypoint Studio and navigate to the **Package Explorer** view.
  2. Open your application’s project name.
  3. Open the `src/main/resources` folder.
  4. Open the `log4j2.xml` file inside the folder.
  5. Add an `<AsyncLogger>` tag inside the `<Loggers>` tag:
```
			<Loggers>
				...
				<AsyncLogger name="org.mule.extension.oauth2" level="DEBUG"/>
				...
			</Loggers>
```

  6. Save your application changes.
  7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**.


## Understand Common Throws
Here is a list of common thrown messages and how to interpret them:
  * HTTP:SECURITY
```
Occurs when there is an error related to an HTTP request.
```



## See Also
  * MuleSoft Help Center
  *
Hadoop (HDFS) Connector | MuleSoft Documentation
# Hadoop (HDFS) Connector
Hadoop (HDFS) Connector Version 6.0
Anypoint Connector for Hadoop (HDFS) works as a bidirectional gateway between Mule applications and Apache Hadoop Distributed File System (HDFS). You can use the Hadoop (HDFS) Connector to poll the content of a file at a configurable rate or interval, or to manipulate data in an HDFS server.
For information about compatibility and fixed issues, see Hadoop (HDFS) Connector Release Notes
## Before You Begin
To use this connector, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements in a Mule flow
  * Global elements
  * How to create a Mule app using Anypoint Studio


Before creating an app, you must have:
  * Access to the Hadoop (HDFS) target resource and Anypoint Platform
  * Anypoint Studio version 7.0 or later
  * A running instance of Hadoop Distributed File System (HDFS)


## Connection Authentication Types
Hadoop (HDFS) Connector supports the following connection authentication types:
  * Kerberos This connection type uses the Kerberos principal as the username. The keytab path you specify obtains a ticket-granting ticket (TGT) from the authorization server.
  * Simple This connection type passes the name of the node that contains the file system you want to connect to as the default name key.


## Next Step
After you complete the prerequisites and experiment with templates and examples, you are ready to create an app with Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Hadoop (HDFS) Connector on Exchange
  * MuleSoft Help Center
Activating a Composer Flow | MuleSoft Documentation
# Activating a Composer Flow
After you build and test a flow in a sandbox environment, connect your flow to a production environment. After testing your flow in the production environment, you can activate it.
To activate your flow:
  1. In Composer, find the flow you want to activate in the flows list. Your flow status is listed as **Inactive**.
  2. Click the flow name to open it.
  3. Click **Edit**.
  4. Click **Activate**.


Composer notifies you when the flow is activated.
## See Also
  * Mulesoft Composer: Overview
  * MuleSoft Composer: Getting Started
  * Composer Connector Reference
  * Knowledge Articles
Downgrading Runtime Fabric Versions | MuleSoft Documentation
# Downgrading Runtime Fabric Versions
If you need to downgrade Runtime Fabric version 2.6.x, you must downgrade the version by patching Runtime Fabric to a lower version.
For Runtime Fabrics installed using `rtfctl`, use the following PATCH request to specify the agent version to be downgraded:
```
curl -X PATCH -H 'Authorization: Bearer xxx' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' \
https://anypoint.mulesoft.com/runtimefabric/api/organizations/<org id>/fabrics/<rtf id> --data-binary '{"version":"x.x.x"}'
```

For Runtime Fabrics installed using Helm, use the following Helm command:
```
helm upgrade --install runtime-fabric rtf/rtf-agent -f values.yaml -n <rtf-namespace> --version x.x.x
```

If you use AM log forwarding, you must additionally perform the following steps:
  1. Enable daemon-set log forwarding by calling the following API (bearer token required):
```
curl -X PATCH -H 'Authorization: Bearer <bearer-token-here>' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' \
https://anypoint.mulesoft.com/runtimefabric/api/organizations/<orgId>/fabrics/<fabricId>/logforwarding/appScoped?enabled=false
```

  2. Optionally, if am-log-forwarder daemon-set is not up and running, start the service by using either any of these options:
     * In the Anypoint Monitoring UI (**RuntimeFabrics -→ Fabric -→ LogForwarding**), check **Show logs in Anypoint Monitoring**.
     * or send an API request:
```
curl -X PATCH -H 'Authorization: Bearer <bearer-token-here>' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' \
https://anypoint.mulesoft.com/runtimefabric/api/organizations/<orgId>/fabrics/<fabricId>/logforwarding -d '{"anypointMonitoring": true}'
```



Mule apps redeployed while Runtime Fabric agent version was 2.6.x must be redeployed to reduce the resource allocation per the downgraded rtf-agent version.   
---
Developing Custom Policies | MuleSoft Documentation
# Developing Custom Policies
After installing the Prerequisites, you can develop custom policies by using Flex Gateway Policy Development Kit (PDK).
The custom policy lifecycle consists of all the steps of developing a custom policy that occur in PDK. The following steps do not include steps that occur outside of PDK, such as applying a policy, which is the same for all Flex Gateway policies.
After you create a new project, you might iteratively complete some steps. For example, while writing the policy’s source code, you might need to return to add additional parameters, or you might need to recompile the policy after debugging the source code.
To create a custom policy with PDK, follow these steps:
  1. Create a new project.
  2. Define a schema definition.
Modify the `definition/gcl.yaml` file to define metadata and configuration parameters for your custom policy.
  3. Configure custom policy features in Rust.
Use the rust code examples to implement your custom logic in the `src/lib.rs` file.
  4. Compile your custom policy.
Compiling your policy creates the `WebAssembly` binary file and configuration files necessary to upload your policy to Exchange and deploy it to a Flex Gateway.
  5. Debug Your Policy with the PDK Debugging Playground.
Use the playground provided with PDK to debug the functionality of your custom policy locally.
  6. Write Integration Tests.
Write intergration tests to ensure your custom policy is compatible with your other services and to ensure that each new policy version does not introduce regression errors.
  7. Publish your policy on Exchange.
Publish your policy on Exchange to distribute a beta version of your policy for testing with your Flex Gateway configuration. To deploy a policy to Flex Gateway, see step 9.
  8. Release your policy on Exchange.
Release your policy on Exchange to distribute a production-ready policy.
  9. Deploy your custom policy to a production environment by applying it to an API instance deployed on Flex Gateway.
  10. Configure a new version of this API instance by returning to step 2.
someEntry | MuleSoft Documentation
# someEntry
## someEntry(obj: Object, condition: (value: Any, key: Key) -> Boolean): Boolean
Returns `true` if at least one entry in the object matches the specified condition.
The function stops iterating after the first element that matches the condition is found.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The object to evaluate.  
`condition` | The condition to use when evaluating elements in the object.  
### Example
This example shows how the `someEntry` behaves with different inputs.
#### Source
```
%dw 2.0
import someEntry from dw::core::Objects
output application/json
---
{
  a: {} someEntry (value, key) -> value is String,
  b: {a: "", b: "123"} someEntry (value, key) -> value is String,
  c: {a: "", b: 123} someEntry (value, key) -> value is String,
  d: {a: "", b: 123} someEntry (value, key) -> key as String == "a",
  e: {a: ""} someEntry (value, key) -> key as String == "b",
  f: null someEntry (value, key) -> key as String == "a"
}
```

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

## someEntry(obj: Null, condition: (value: Nothing, key: Nothing) -> Boolean): Boolean
Helper function that enables `someEntry` to work with a `null` value.
_Introduced in DataWeave version 2.3.0._
fromHex | MuleSoft Documentation
# fromHex
## fromHex(hexText: String): Number
Transforms a hexadecimal number into decimal number.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The hexadecimal number represented in a `String`.  
### Example
This example shows how the `toBinary` behaves with different inputs.
#### Source
```
%dw 2.0
import fromHex from dw::core::Numbers
output application/json
---
{
  a: fromHex("-1"),
  b: fromHex("3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000"),
  c: fromHex(0),
  d: fromHex(null),
  e: fromHex("f"),
}
```

#### Output
```
{
 "a": -1,
 "b": 100000000000000000000000000000000000000000000000000000000000000,
 "c": 0,
 "d": null,
 "e": 15
}
```

## fromHex(hexText: Null): Null
Helper function that enables `fromHex` to work with null value.
_Introduced in DataWeave version 2.2.0._
Response Timeout Policy | MuleSoft Documentation
# Response Timeout Policy
**Policy Name** | Response Timeout  
---|---  
Sets the maximum duration that Flex Gateway waits for a response from an upstream service  
Quality of Service  
**First Flex Gateway version available**  
**Returned Status Codes** | 504 - Upstream request timeout  
## Summary
The Response Timeout policy enables you to set the maximum duration that Flex Gateway waits for a response from an upstream service. The timeout time starts at the last request sent by Flex Gateway.
By default, all Flex Gateway API instances have a response timeout of 15 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: response-timeout-flex
 config:
  timeout: number // REQUIRED
```

Parameter | Required or Optional | Default Value | Description  
---|---|---|---  
Time in seconds Flex Gateway waits for the response.  
#### Resource Configuration Example
```
- policyRef:
  name: response-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  
---|---|---  
Response timeout |  Time in seconds Flex Gateway waits for the response.
Java Version Support | MuleSoft Documentation
# Java Version Support
Specify the Java compatibility of your custom module. In Mule 4.6.0 and later, custom modules that do not specify the Java compatibility are assumed to be compatible with Java 8 and Java 11 only. If your custom module is compatible with a more recent Java version, you must specify the Java compatibility to include that version.
Communicating the Java compatibility of your custom module also ensures:
  * Safe upgrades
Users can determine whether their Mule applications can safely upgrade to run on a given Java version, ensuring a smooth transition and avoiding potential issues.
  * User experience
Providing clear information about Java compatibility enhances the user experience, especially for Anypoint Exchange users who rely on this information for selecting modules.


## Specify Java Compatibility
To specify Java compatibility of your custom module:
  1. Generate metadata to specify Java compatibility of your custom module by adding or upgrading the custom module `mule-sdk-api` dependency to the latest version, for example:
```
<dependency>
  <groupId>org.mule.sdk</groupId>
  <artifactId>mule-sdk-api</artifactId>
  <version>0.11.0</version>
</dependency>
```

  2. Add the `@JavaVersionSupport` annotation in the same class as the `@Extension` annotation and include the supported Java versions as values, for example:
```
@Extension(name = "Database")
@Operations(...)
@JavaVersionSupport({JavaVersion.JAVA_8, JavaVersion.JAVA_11, JavaVersion.JAVA_17})
public class DatabaseConnector {
..
}
```



If the `mule-modules-parent` version is earlier than 1.9.0, all code, including third-party dependencies, **must** be compiled for Java 8, and you must use Java 8 to build the connector.   
---  
You can mark your custom module as compatible with a single Java version only; however, you must ensure that no adoption or backward compatibility issues exist.
When you deploy a Mule app, Mule verifies that all modules in the Mule app are compatible with the Java version. If Mule finds an incompatibility, Mule throws an error and the application does not deploy.
If your code is compatible with a given Java version but you do not declare that compatibility, you can still get a successful test run (only when running a test on Java 8).
## See Also
  * Upgrading Java for Custom Connectors (Customers)
  * Upgrading Java for Custom Connectors (Partners)
  *
words | MuleSoft Documentation
# words
## words(text: String): Array<String>
Returns an array of words from a string.
Separators between words include blank spaces, new lines, and tabs.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The string to split into words.  
### Example
This example divides a string by the `words` it contains. An `\n` represents a line break, and `\t` represents a tab.
#### Source
```
%dw 2.0
import words from dw::core::Strings
output application/json
---
words("hello world\nhere\t\t\tdata-weave")
```

#### Output
```
["hello", "world", "here", "data-weave"]
```

## words(text: Null): Null
Helper function that enables `words` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Troubleshooting Mule Runtime Engine Registration | MuleSoft Documentation
# Troubleshooting Mule Runtime Engine Registration
If you encounter a Mule runtime engine (Mule) registration error when creating a server in Runtime Manager, configure Mule to trust the TLS certificates you are using.
To do so:
  1. Get the public certificate for Anypoint Platform Private Cloud Edition (Anypoint Platform PCE).
  2. Add the certificate to the truststore of the JVM you are using for Mule.


Using the following example, set `$ANYPOINT_DNS` to your DNS for Anypoint Platform PCE. Replace the keystore location and password for your JVM truststore.
```
$ keytool -printcert -sslserver $ANYPOINT_DNS:443 -rfc > /tmp/PCE_Certificate.cer
$ keytool -importcert -alias anypoint.my-company -keystore <path to keystore> -storepass changeit -file /tmp/PCE_Certificate.cer
```

For more information about the CA certificate truststore, see your JVM vendor’s documentation: Oracle documentation.
## See Also
  * Managing Anypoint Platform PCE
Add and Subtract Time | MuleSoft Documentation
# Add and Subtract Time
This DataWeave example shows multiple addition and subtraction operations that deal with date and time types.
The examples use:
  * `as` function to coerce a String to Period type
  * `P<date>T<time>` for the Period data type, which provides designators for years, months, days, hours, minutes, and seconds For example, `|P2Y9M1D|` refers to a period of two years, nine months, and one day, and `|PT5H4M3S|` indicates a time period of five hours, four minutes, and three seconds.


DataWeave Script:
```
%dw 2.0
output application/json
var numberOfDays = 3
---
{
 oneDayBefore: |2019-10-01T23:57:59Z| - |P1D|,
 threeDaysBefore: |2019-10-01T23:57:59Z| - ("P$(numberOfDays)D" as Period),
 a: |2019-10-01| - |P1Y|,
 b: |P1Y| - |2019-10-01|,
 c: |2019-10-01T23:57:59Z| - |P1Y|,
 d: |2019-10-01T23:57:59Z| + |P1Y|,
 e: |2019-10-01T23:57:59| - |P1Y|,
 f: |PT9M| - |23:59:56|,
 g: |23:59:56| + |PT9M|,
 h: |23:59:56-03:00| - |PT9M|,
 u: |23:59:56-03:00| - |22:59:56-03:00|,
 j: |23:59:56-03:00| - |22:59:56-00:00|,
 k: |2019-10-01T23:57:59| - |P2Y9M1D| - |PT57M59S| + |PT2H|,
 l: |23:59:56| - |22:59:56|,
 o: |2019-10-01| - |2018-09-23|,
 p: |2019-10-01T23:57:59Z| - |2018-10-01T23:57:59Z|,
 q: |2019-10-01T23:57:59| - |2018-10-01T23:57:59|
}
```

Output JSON:
```
{
 "oneDayBefore": "2019-09-30T23:57:59Z",
 "threeDaysBefore": "2019-09-28T23:57:59Z",
 "a": "2018-10-01",
 "b": "2018-10-01",
 "c": "2018-10-01T23:57:59Z",
 "d": "2020-10-01T23:57:59Z",
 "e": "2018-10-01T23:57:59",
 "f": "23:50:56",
 "g": "00:08:56",
 "h": "23:50:56-03:00",
 "u": "PT1H",
 "j": "PT4H",
 "k": "2017-01-01T01:00:00",
 "l": "PT1H",
 "o": "PT8952H",
 "p": "PT8760H",
 "q": "PT8760H"
}
```

Note that the behavior of `o: |2019-10-01| - |2018-09-23|` changed in Mule 4.3.0. DataWeave 2.3.0, which is supported by Mule 4.3.0, returns `"o": "PT8952H"`. DataWeave 2.2.0, which is supported by Mule 4.2.0, returns `"o": "P1Y8D"`. To restore the 2.2.0 behavior, you can set the `-M-Dcom.mulesoft.dw.date_minus_back_compatibility=true`. However, the setting does not affect the Preview window in Studio. For guidance with this setting in Studio and on-prem deployments, see System Properties. For CloudHub deployments, see Manage Properties for Applications on CloudHub.
## See Also
  *   *   * DataWeave Selectors
  *
Server Groups | MuleSoft Documentation
# Server Groups
Private Cloud Edition 
A server group is a set of servers that act as a single deployment target for applications so that you don’t have to deploy applications to each server individually.
Deploying applications to servers in server groups provides redundancy so you can restore applications more seamlessly and quickly, with less downtime.
Unlike clusters, application instances in a server group run in isolation from the application instances running on the other servers in the group. If you experience concurrency issues with server groups, consider grouping servers in clusters.
## Requirements and Restrictions
  * All servers in a server group must be running the same versions of:
    * Mule runtime engine
    * Runtime Manager agent
  * You can create a server group with servers with the Running or the Disconnected status, but these can’t be in the same group as servers with the Created status.
  * You can create a server group with servers with the Created status.
  * To add a server on which existing applications are currently running to a server group, first stop and delete the applications from the server.


## See Also
  *   * Add Servers to Runtime Manager
  * Create Server Groups
  * Add Servers to a Server Group
  * High Availability and Disaster Recovery
  *   * Concurrency Issues Solved by Clusters
Publishing Document Actions | MuleSoft Documentation
# Publishing Document Actions
You can build an automated pipeline for document processing by integrating your published document actions with RPA, Mule applications, and other systems. Publishing a document action makes it discoverable in RPA and available in Anypoint Exchange as an API that you can call.
## Document Action Versioning
You can use document action versioning to avoid breaking existing integrations when you modify a published document action. IDP follows semantic versioning but only increases the minor version number when you republish a document action.
For example, when you publish a document action for the first time, IDP sets the version to `1.0.0`. If you modify this document action later and republish it, IDP sets the version number to `1.1.0`, and so on.
Consider this behavior when publishing document actions and ensure you call the desired version of the published document action in your integrations.
## Before You Begin
Ensure you have any of the following Anypoint permissions: 

Manage Actions
    
Gives a user complete access to IDP and assigns reviewer permission by default for every document action. 

Build Actions
    
Enables a user to create, edit, publish, and execute document actions and assign reviewers to the actions.
## Publish a Document Action
To publish a document action:
  1. Open the document in edit mode either by:
     * Creating a new document action.
     * Opening an existing document action in view mode and clicking **Open in Builder**.
  2. Click **Publish**.
  3. Verify the name and version of the asset and click **Publish**.
  4. Wait for the confirmation message and click **Close**.


## See Also
  * Reviewing Processed Documents
  * Analyzing Documents Using Pre-Built Schemas
  * Processing Documents and Retrieving Results With the API
  * Processing Documents and Retrieving Results With RPA
CIM Subject Areas | MuleSoft Documentation
# CIM Subject Areas
The model content is organized into domains, or Subject Areas, which represent major business concepts. Each Subject Area defines one or more Entity Groups, which in turn consist of a related collection of Entities. Each Entity has a set of Attributes defining the unique characteristics of the Entity.
## Supported Subject Areas
CIM supports the following subject areas, each of which includes an Entity Relationship Diagram (ERD). See Diagram Conventions for the conventions used in the diagrams.
Name | Description  
---|---  
Entities related to finances, such as payments and payment methods.  
Entities related to the fulfillment of goods and services, such as shipments.  
Entities related to the marketing and promotion of goods and services, such as individuals, customers, and suppliers.  
Entities related to actual goods and services, such as products and catalogs.  
Entities related to the selling of goods and services, such as sales orders and channels.  
Entities related to technical resources and artifacts.  
## Diagram Conventions
The diagrams included in each subject group show the entities and relationships defined within that group. Relationships to entities defined in other subject areas are also provided for context. The following table summarizes the conventions used to indicate the status of each entity.
Symbol | Entity Status | Description  
---|---|---  
Defined Group Entity | An entity in the current group that has a concrete definition.  
Undefined Group Entity | An entity belonging to the current group that does not have a concrete definition.  
Defined External Entity | An entity defined in a different entity group or subject area.  
Undefined External Entity | An entity belonging to a different group or subject area that has not been defined.  
## See Also
  *   * CIM Design Elements
  *
levenshteinDistance | MuleSoft Documentation
# levenshteinDistance
## levenshteinDistance(a: String, b: String): Number
Returns the Levenshtein distance (or edit distance) between two strings.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The first string.  
The second string.  
### Example
This example shows how `levenshteinDistance` behaves with different strings.
#### Source
```
%dw 2.0
import levenshteinDistance from dw::core::Strings
output application/json
---
"kitten" levenshteinDistance "sitting"
```
Processing Documents and Retrieving Results With RPA | MuleSoft Documentation
# Processing Documents and Retrieving Results With RPA
You can execute your published document actions with MuleSoft RPA by using the Submit Document to MuleSoft IDP and Retrieve Results from MuleSoft IDP action steps in your automation projects. After you publish a document action to Anypoint Exchange, it becomes available for consumption in RPA. You must create a connected app and obtain the access token before you can use the IDP action steps in RPA.
If you aren’t using RPA to execute your document actions, configure and call the IDP API, as described in Processing Documents and Retrieving Results With the API.
## Before You Begin
Ensure you have the following Anypoint permissions: 

Execute Published Actions
    
Enables a user to execute a published document action and retrieve the results of the execution.
## Create a Connected App
To communicate with the IDP API, create a connected app with the following details:
  * Type: `App acts on its own behalf (client credentials)`
  * Scopes: `Execute Published Actions`


After you create the connected app, copy its **ID** and **Secret** for further use.
For more information, see Secure API Integration with Connected Apps.
## Execute the Published Document Actions
To execute the published document actions, use the Submit Document to MuleSoft IDP action step in RPA. This action step enables you to browse through your published document actions and execute them by providing an Execution ID and the path to the file to process. Use the Execution ID when configuring the Retrieve Results from MuleSoft IDP action step to pull the results from the execution.
When you query a published document action, IDP uses the model selected in each prompt to extract the data for the corresponding field.
The Submit Document to MuleSoft IDP action step executes document actions by impersonating a user in your organization. Therefore, you must use authentication credentials of a user that has the Execute Published Actions permission in Anypoint Platform.
See Submit Document to MuleSoft IDP for configuration details.
## Retrieve the Results of the Execution
To retrieve the results of a document action execution, use the Retrieve Results from MuleSoft IDP action step in RPA. This action step enables you to query the results of a document action execution by providing an Execution ID that you used before in the corresponding Submit Document to MuleSoft IDP execution.
When you query a published document action, IDP uses the model selected in each prompt to extract the data for the corresponding field.
See Retrieve Results from MuleSoft IDP for configuration details.
## See Also
  * Analyzing Documents Using Pre-Built Schemas
  * Publishing Document Actions
Microsoft OneDrive Connector 1.0 | MuleSoft Documentation
# Microsoft OneDrive Connector 1.0
Anypoint Connector for Microsoft OneDrive (OneDrive Connector) enables you to access Microsoft Graph APIs to provide a unified programmability model that you can use to access the tremendous amount of data in Microsoft 365, Windows 10, and Enterprise Mobility + Security.
For compatibility information and fixed issues, see the Microsoft OneDrive Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * Microsoft Graph API 1.0
  * 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 target resource
  * Anypoint Studio version 7.3.5 or later


## Common Use Cases for the Connector
Some common use cases for OneDrive Connector include:
  * Sales Operations
    * When a sales contract comes in through the Salesforce CRM system, upload the contract to OneDrive and collaboratively review the contract with the Deal Desk. You can assign approval tasks to notify the contract owner when a contract is approved or rejected.
    * When a new budget proposal or customer invoice is generated, upload the documents to OneDrive and collaborate with the accounting team for their review. You can assign tasks to notify the invoice owner when an invoice is approved or rejected.
    * When an opportunity is closed (won), create a folder structure in OneDrive based on a predefined template.
  * Employee onboarding and offboarding
    * When new employees start their jobs, existing resources can be shared with them via OneDrive.
    * Create a new folder in OneDrive and share it with the new employee so they can upload documents to it.
    * After an employee leaves the company, all documents used or uploaded can be moved or deleted (GDPR).
  * Health care Share sensitive patient data with the departments that are allowed to access the information by using OneDrive to share the files, and allow access to the relevant parties.


## Authentication Types
OneDrive Connector uses the following authentication methods:
  * OAuth 2.0 authorization code grant connection type, which is used in applications that are installed on a device to gain access to protected resources.
  * OAuth 2.0 client credentials grant, which uses the identity of the application to access web-hosted resources.


## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Microsoft OneDrive Connector Reference
  * MuleSoft Help Center