BassemE/mulesoft-documentation-embeddings huggingface dataset:
Run Vulnerability Assessment and Penetration Tests | MuleSoft Documentation
# Run Vulnerability Assessment and Penetration Tests
If your company security policies require that you perform vulnerability and penetration testing against Anypoint Platform, you can commence testing without notifying Salesforce beforehand.
All assessments must be performed in accordance with the Security Assessment Agreement.
## Run Penetration and Vulnerability Tests
Because penetration testing can interfere with other tenants, MuleSoft allows penetration testing on your workers but not on other Anypoint Platform services.
Salesforce does not address vulnerabilities found with custom development. You must validate and fix any findings with your custom development.   
---  
### Prerequisites
Before initiating penetration testing:
  * Assign a security resource at your company to review and validate findings from the tests.


### Steps
  1. Run the penetration tests.
The Security Assessment Agreement includes restrictions and requirements for testing.
  2. Have your security resource use the following documents to identify common false positives and security issues related to settings:
     *      *   3. If your assessment generates vulnerability findings, complete validation for any automated finding. Send all outstanding validated security vulnerability findings to security@salesforce.com.
Include the following information in your email:
     * Confirmation number for your Security Assessment approved by Salesforce
     * Summary of all findings and the associated severity level of each finding
     * Detailed assessment report that notes each finding
     * Steps to reproduce the vulnerability
     * All applicable HTTP requests and responses
     * Explanation of why the example is considered a finding


### Reporting Security Vulnerabilities
To report security vulnerability findings, follow the Security Vulnerability Finding Submittal Guide. Security vulnerability reports that do not follow the required steps are rejected.
Salesforce does not address any security vulnerabilities in the following categories:
  * Scan output from automated vulnerability scanning tools without a valid proof of concept
  * Security bugs without valid proof of concept
  * Vulnerabilities identified in old or deprecated versions of Mule runtime engine
  * Vulnerabilities introduced via code customization made by your company
  * Known security issues that don’t pose any risk


## See Also
  * CloudHub 2.0 Overview
  * Deploying Apps to CloudHub 2.0
  * Managing Apps Deployed to CloudHub 2.0
  *
Dynamic Ports | MuleSoft Documentation
# Dynamic Ports
Anypoint Code Builder 
Anypoint Studio 
The Dynamic Ports global element allows you to bind a free port to a property. It searches for a free port available and can be narrowed to a specific range.
For example, a dynamic port would look something like this:
```
<munit:dynamic-port propertyName="a.dynamic.port"/>
```

And it can be used in the http configuration:
```
<http:request-config name="httpRequestConfig">
  <http:request-connection host="localhost" port="${a.dynamic.port}"/>
</http:request-config>
```

Additionally you can set min and max values from where to get the port:
```
<munit:dynamic-port propertyName="a.dynamic.port" min="6000" max="7000"/>
```

## See Also
  * Dynamic Directories
  * Storage Event Processors
MuleSoft IDP | MuleSoft Documentation
# MuleSoft IDP
Execute your MuleSoft IDP document actions from RPA to process documents and consume the results.
Before you use these action steps, ensure you have created and published _document actions_ in MuleSoft IDP. Then, you can use the MuleSoft IDP action steps to submit documents for processing and retrieve the results of the execution by providing the generated Execution ID.
Calls to IDP from RPA Builder consume automation credits per page processed in addition to the bot minutes consumed by the RPA process. See Automation Credits Usage and Rates for conversion rates and usage details.
  * Retrieve Results from MuleSoft IDP
Retrieve the results of an IDP document action execution.
Before you can query the results, you must run the Submit Document to MuleSoft IDP action step to trigger the execution of said document action.
  * Submit Document to MuleSoft IDP
Submit a document to MuleSoft IDP and execute a published document action to process the document.
Use the returned Execution ID to query the results later using the Retrieve Results from MuleSoft IDP action step.


## See Also
  *   * Getting Started with Document Processing
OAuth 2.0 Policy Prerequisites | MuleSoft Documentation
# OAuth 2.0 Policy Prerequisites
Prerequisites for using an OAuth 2.0 policy are:
  * Having the necessary permissions for creating or managing APIs
  * Applying the policy to the API instance so the associated resource is protected
  * Having a client application created in API Platform and registered to the API instance
  * Having an OAuth 2.0 Provider to issue a token based on the client application credentials and capable of validating it
    * If you are using a Mule OAuth 2.0 Provider, your runtime must also be correctly configured with the organization credentials
  * [API instance RAML-based] A Security Scheme should be specified in the RAML if you would like to use API Console with OAuth dance capabilities.


If a resource is protected by an OAuth token enforcement policy, an OAuth token will be required to be specified in all requests sent to the protected resource either as a query parameter or an authorization header. The following table summarizes this usage:
Places to include Token | Example | Notes  
---|---|---  
Query parameter |  `?access_token=123` |  Included as part of the URI  
Authorization header |  `Authorization:Bearer 123` |  The header consists of a key:value pair, where Authorization is the key and the value is composed as follows: `"Bearer" + <space> + <token, for example, 123>`  
If the API instance is RAML-based, declare the protected resources as protected by OAuth in order for the API Console to be aware of the policy being applied.
Declaring the resource to be protected by the OAuth Token Enforcement policy in your RAML/OAS definition, does not imply that the policy is actually applied.   
---  
Within the RAML securitySchemes definition, you include URIs for the authorization and access token.
Also, add the securedBy node after the method name of the resource and method you want to secure.
```
#%RAML 1.0
title: Interop Testing
version: v1.0
baseUri: http://127.0.0.1:8081/api
...
securitySchemes:
 oauth_2_0:
    description: |
      Mule OAuth 2.0.
    type: OAuth 2.0
    describedBy:
      headers:
        Authorization:
          description: |
           Used to send a valid OAuth 2 access token. Do not use
           with the "access_token" query string parameter.
          type: string
      queryParameters:
        access_token:
          description: |
           Used to send a valid OAuth 2 access token. Do not use together with
           the "Authorization" header
          type: string
      responses:
        401:
          description: |
            Bad or expired token.
        403:
          description: |
            Bad OAuth request.
    settings:
     authorizationUri: http://0.0.0.0:8081/authorize
     accessTokenUri: http://0.0.0.0:8081/access-token
     authorizationGrants: [authorization_code, password, client_credentials, implicit]
...
/users:
 get:
  securedBy: [oauth_2_0]
```

## See Also
  *
Rename Folder | MuleSoft Documentation
# Rename Folder
Renames an existing folder.
## Properties
  * **Common**
See Common Properties for a description.
  * **Folder Operations Settings**
    * **Directory Path**
Path to the directory that contains the folder to rename.
    * **New folder name**
The new name for the folder.


## Inbound Variables
  * **New folder name**
  * **Directory Path**


## Outbound Variables
  * **Is renamed**
  * **Directory Path**


## See Also
  *
DocuSign Connector 1.1 XML and Maven Support | MuleSoft Documentation
# DocuSign Connector 1.1 XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio:
  * If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
  * If you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location and 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/docusign
http://www.mulesoft.org/schema/mule/docusign/current/mule-docusign.xsd
```

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

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. When you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector:
```
<dependency>
 <groupId>com.mulesoft.connectors</groupId>
 <artifactId>mule4-docusign-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 `docusign`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Basic Authentication: Simple Policy | MuleSoft Documentation
# Basic Authentication: Simple Policy
**Policy Name** | Basic Authentication: Simple  
---|---  
Allows access based on the basic authorization mechanism, with a single user-password  
Security  
**First Mule version available**  
**Returned Status Codes** | 400 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.2  
401 - Unauthorized or invalid client application credentials in HTTP or RAML APIs  
500 - Unauthorized or invalid client application credentials in WSDL API using SOAP 1.1  
## Summary
The Basic Authentication: Simple policy protects an API by forcing applications to provide a username and password when making requests.
The policy follows basic HTTP authentication standards.
When an error is encountered, the policy returns an "WWW-Authenticate" HTTP header field.
## Configuring Policy Parameters
### Mule Gateway
When you apply the Basic Authentication: Simple policy to an API, a request to that API must contain the following header:
```
Authorization: Basic <username:password>
```

The `username:password` value must be a base64-encoded string. For example on a Mac OS X or Linux system, the username and password requirement is implemented as:
`echo -n '<Client Id>:<Client Secret>' | base64`
Set Default Values with DataWeave | MuleSoft Documentation
# Set Default Values with DataWeave
Use one of the following methods to set default values when a payload value is absent or when the value is `null`:
  * Using the `default` keyword
  * Setting the default in an `if-else` or `else-if` statement
  * Using `else` when pattern matching


## Example of Using the Keyword default to Set a Default Value
Consider an application that expects a JSON input with fields `id` and `name` to do a transformation. You can configure default values for these fields in case the fields are not present, or their value is `null`. For example:
DataWeave Script:
```
%dw 2.0
output application/json
---
{
 "userId": payload.id default "0000",
 "userName": payload.name default "Undefined"
}
```

If the application receives a JSON message with values set for the `id` and `name` fields, then the DataWeave transformation matches field `id` to `userId` and field `name` to `userName`.
Input JSON Payload:
```
{
 "id": "123",
 "name": "Max the Mule"
}
```

Output JSON:
```
{
 "userId": "123",
 "userName": "Max the Mule"
}
```

However, if the application receives a JSON message without the expected fields, or the fields have `null` values, then the transformation uses the configured default values for fields `userId` and `userName`.
Input JSON Payload:
```
{
 "id": null
}
```

Output JSON:
```
{
 "userId": "0000",
 "userName": "Undefined"
}
```

## Example of Using if-else and else-if Statements to Set Default Values
Another method for providing a default value is using if-else and else-if.
The following example sets `United States` as the default value for `userLocation` if it is not present, or its value is `null`, in the JSON input message:
DataWeave Script:
```
%dw 2.0
output application/json
---
if (payload.location != null) {
	"userLocation" : payload.location
} else {
	"userLocation" : "United States"
}
```

If the application receives a JSON message with a value set for the `location` field, then the DataWeave transformation matches field `location` to `userLocation`.
Input JSON Payload:
```
{
 "location": "Argentina"
}
```

Output JSON:
```
{
 "userLocation": "Argentina"
}
```

However, if the application receives a JSON message without the expected field, or the field is `null`, then the transformation uses the configured default value for field `userLocation`.
Input JSON Payload:
Output JSON:
```
{
 "userLocation": "United States"
}
```

## Example of Using Matching Patterns to Set Default Values
In pattern-matching scripts, DataWeave `case` statements end with an `else` expression that can serve as the default to return if all preceding `case` expressions return `false`.
DataWeave Script:
```
%dw 2.0
var myVar = "someString"
output application/json
---
myVar match {
  case myVarOne if (myVar == "some") -> ("some" ++ "is myVar")
  case myVarOne if (myVar == "strings") -> ("strings" ++ "is myVar")
  else -> myVar ++ " is myVar"
}
```

Output JSON:
```
"someString is myVar"
```
Using RTFCTL for Deployed Mule Apps to Runtime Fabric | MuleSoft Documentation
# Using RTFCTL for Deployed Mule Apps to Runtime Fabric
You can manage deployed Mule apps to Runtime Fabric using the `rtfctl` command line tool.
  * Managing Mule Apps Deployed to Runtime Fabric Use the `rtfctl delete`, `describe`, `disk`, `memory`, `package`, `restart`, `heapdump`, and `threaddump` commands to manage Mule apps deployed to Runtime Fabric.
  * Protecting Mule App Property Values Use the `rtfctl apply`, `get`, and `delete` commands to protect Mule app property values.


## See Also
  *   * Using RTFCTL for Runtime Fabric
The Result Object | MuleSoft Documentation
# The Result Object
The `Result` object represents the result of a component’s execution. It is used for cases in which the component not only needs to return a value to be set on the message payload but also will specify message attributes and/or a mime type.
The class has two generic types, one for the type of the value that goes into the payload and another for the type of the returned message attributes.
For example, consider an oversimplified `read` operation from the File connector. This operation sets the payload to an `InputStream` with the file’s content. It also sets the attributes to a `FileAttributes` object that contains information, such as file name, size, timestamp, permissions, and so on.
```
public Result<InputStream, FileAttributes> read(String path) { **(1)**
 InputStream content = getContent(path);
 FileAttributes attributes = getAttributes(path);
 return Result.<InputStream, FileAttributes>builder() **(2)**
    .output(content) **(3)**
    .attributes(attributes) **(4)**
    .build(); **(5)**
}
```

The operation returns a `Result<InputStream, FileAttributes>`. This tells the runtime that the operation returns an `InputStream` as payload and `FileAttributes` as attributes.  
---  
Once it obtains the result values, it uses `Result.builder()` to create a new instance. Note that this is strongly typed, so you need to specify the generics when creating the builder.  
The `output(Object)` method in the builder is used to set the payload.  
The `attributes(Object)` is used to set the attributes.  
The example calls the `build()` method and returns the created `Result`.  
## Setting the Mime Type
The `Result` object can be used to set the output `mimeType`. Building on the previous example, the operation here makes a best guess about the file’s `mimeType` based on its file extension:
```
public Result<InputStream, FileAttributes> read(String path) {
 InputStream content = getContent(path);
 FileAttributes attributes = getAttributes(path);
 MediaType guessedMediaType = MediaType.ANY;
 if (path.endsWith(".json")) {
  guessedMediaType = MediaType.APPLICATION_JSON;
 } else if (path.endsWith("*.xml")) {
  guessedMediaType = MediaType.APPLICATION_XML;
 } else if (path.endsWith("*.bin")) {
  guessedMediaType = MediaType.BINARY;
 }
 return Result.<InputStream, FileAttributes>builder()
    .output(content)
    .attributes(attributes)
    .mediaType(guessedMediaType)
    .build();
}
```

In the example above, the `MediaType` class is not the `@MediaType` annotation but Mule API’s `org.mule.runtime.api.metadata.MediaType`.   
---  
## Void Attributes
For a use case where you want to set the payload and the `mimeType` but do not want to set attributes, you use the `<Void>` type, for example:
```
public Result<InputStream, Void> read(String path) {
 InputStream content = getContent(path);
 return Result.<InputStream, Void>builder()
    .output(content)
    .mediaType(bestGuessMediaType(path))
    .build();
}
```
isTimeZoneType | MuleSoft Documentation
# isTimeZoneType
## isTimeZoneType(t: Type): Boolean
Returns `true` if the input is the TimeZone type.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The type to check.  
### Example
This example shows how `isTimeZoneType` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::core::Types
type ATimeZone = TimeZone
output application/json
---
{
  a: isTimeZoneType(ATimeZone),
  b: isTimeZoneType(TimeZone),
  c: isTimeZoneType(String),
}
```

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

#### Output
```
{
 "a": true,
 "b": true,
 "c": false
}
```
Scaffold a Template for an MUnit Test from an API Specification | MuleSoft Documentation
# Scaffold a Template for an MUnit Test from an API Specification
You can use APIkit to automatically generate an empty structure for an MUnit test suite based on your API specification.
Because your Mule project is generated using APIkit, you can use APIkit to automatically scaffold an empty MUnit test suite, based on the endpoints described in your API specification. Scaffolding does not generate the test itself, but generates a tool to help you start writing the test.
To create this empty test suite:
  1. Locate and right-click the APIkit router in your project.
  2. Select **Create Test Suite for Project From API Specification**.
isBlank | MuleSoft Documentation
# isBlank
## isBlank(text: String | Null): Boolean
Returns `true` if the given string is empty (`""`), completely composed of whitespaces, or `null`. Otherwise, the function returns `false`.
### Parameters
Name | Description  
---|---  
An input string to evaluate.  
### Example
This example indicates whether the given values are blank. It also uses the `not` and `!` operators to check that a value is not blank. The `!` operator is supported starting in Dataweave 2.2.0. Use `!` only in Mule 4.2 and later versions.
#### Source
```
%dw 2.0
output application/json
var someString = "something"
var nullString = null
---
{
 // checking if the string is blank
 "emptyString" : isBlank(""),
 "stringWithSpaces" : isBlank("   "),
 "textString" : isBlank(someString),
 "somePayloadValue" : isBlank(payload.nonExistingValue),
 "nullString" : isBlank(nullString),
 // checking if the string is not blank
 "notEmptyTextString" : not isBlank(" 1234"),
 "notEmptyTextStringTwo" : ! isBlank("")
}
```

#### Output
```
{
 "emptyString": true,
 "stringWithSpaces": true,
 "textString": false,
 "somePayloadValue": true,
 "nullString": true,
 "notEmptyTextString": true,
 "notEmptyTextStringTwo": false
}
```
CIM Finance Subject Area | MuleSoft Documentation
# CIM Finance Subject Area
Activities to trace financial information in the company. For example, payment, invoice and expense report.
## Model Diagrams
The following diagrams show the entities and relationships in this subject area, organized by entity group.
## Implementation
## See Also
  *   * CIM Design Elements
  *   *
Azure Service Bus Management 1.0 XML and Maven Support | MuleSoft Documentation
# Azure Service Bus Management 1.0 XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio.
If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
When you 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/azure-service-bus-management
http://www.mulesoft.org/schema/mule/azure-service-bus-management/current/mule-aure-service-bus-management.xsd
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<mule xmlns:<connector>="http://www.mulesoft.org/schema/mule/<connector>"
	xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:file="http://www.mulesoft.org/schema/mule/file"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
	http://www.mulesoft.org/schema/mule/core/current/mule.xsd
	http://www.mulesoft.org/schema/mule/file
	http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
	http://www.mulesoft.org/schema/mule/http
	http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
	http://www.mulesoft.org/schema/mule/ee/core
	http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
	http://www.mulesoft.org/schema/mule/azure-service-bus-management
	http://www.mulesoft.org/schema/mule/azure-service-bus-management/current/mule-aure-service-bus-management.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>azure-service-bus-management</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 `azure service bus management`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## Next Step
After completing your namespace and `pom.xml` file, you can try the examples.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Folder Operations | MuleSoft Documentation
# Folder Operations
Folder Operations enable you to interact with the folders of the file system where your automation is running.
  * Checks if a folder exists in the configured directory path.
  * Copies a source folder to the target directory.
  * Creates an empty folder in the configured directory path.
  * Deletes a folder and all its content.
  * Renames an existing folder.
X12 EDI Connector 2.17 | MuleSoft Documentation
# X12 EDI Connector 2.17
Support Category: Premium
Anypoint Connector for X12 EDI (X12 EDI Connector) enables you to convert X12 messages to and from DataWeave-compatible representations by using lists and maps. All of the schema definitions you need for supported X12 standard transaction sets are included. For complete information about schemas, see X12 EDI Schema Language Reference.
Many Health Insurance Portability and Accountability Act (HIPAA) document versions are also supported, as listed separately in the Supported HIPAA Versions. For more information about HIPAA usage, refer to Connector HIPAA Standards.
## Prerequisites
To use this connector, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have:
  * Purchased a MuleSoft license for X12 EDI Connector.
Contact your Account Representative about purchasing a license.
  * Anypoint Studio 7.0 or later


X12 EDI Connector supports files of up to 15 MB in size, and the memory requirement is approximately 40 to 1. For example, a 1 MB file requires up to 40 MB of memory to process, so it’s important to consider this memory requirement in conjunction with your Transactions Per Second (TPS) needs for large X12 files. This is not an exact figure; the value varies according to the complexity of the mapping instructions.   
---  
## Exchange Templates and Examples
Anypoint Exchange provides templates that you can use as starting points for your apps and examples that illustrate a complete solution.
### X12 EDI Connector Templates in Exchange
X12 EDI Connector templates provide starting points that help you:
  * Map application messages to outbound X12 transactions 
  * Map inbound X12 transactions to the application message format
  * Set up your Partner Manager content storage


### X12 EDI Connector Examples in Exchange
X12 EDI Connector examples in Exchange enable you to:
  * Customize an X12 EDI schema for B2B integrations
  * Transform outbound purchase order XML messages to X12 850 transactions
  * Transform inbound X12 850 transactions to JSON purchase orders
  * Transform outbound XML messages into X12 purchase orders, inbound X12 purchase orders into JSON, and generate a functional acknowledgement
  * Implement an end-to-end order to cash workflow from the perspective of a seller
  * Implement an end-to-end B2B procure to pay workflow from the perspective of a buyer


## Next Step
After you complete the prerequisites, you are ready to create your own app and configure the connector using Anypoint Studio.
## See Also
Introduction to Anypoint Connectors
Use Exchange to Discover Connectors, Templates, and Examples
MuleSoft Help Center
Upgrade Self-Managed Flex Gateway | MuleSoft Documentation
# Upgrade Self-Managed Flex Gateway
You can upgrade Flex Gateway as a Linux service, in a Docker container, or in a Kubernetes cluster.
Upgrade as a Linux Service |  Upgrade in a Docker Container |  Upgrade in a Kubernetes Cluster  
---|---|---  
## Upgrade as a Linux Service
Flex Gateway is distributed as a standard package. Use the following steps to upgrade or downgrade Flex Gateway to either a specific version or the latest version.
To upgrade or downgrade Flex Gateway as a Linux Service:
  1. Update the list of available packages:
```
sudo apt update
```

To list the available versions, run:
```
apt list -a flex-gateway
```

  2. Update Flex Gateway:
     * To the latest version:
```
sudo apt --only-upgrade -y install flex-gateway
```

     * To a specific version:
```
sudo apt --only-upgrade -y install flex-gateway=<version>
```

     * To a downgrade version:
```
sudo apt --only-upgrade -y --allow-downgrades install flex-gateway=<version>
```

  3. Restart the services:
```
sudo systemctl restart flex-gateway
```



## Upgrade in a Docker Container
The docker containers are not updated, if a new version is needed then a new container with the new image version should be created to replace the outdated one.
The new versions of the images will be available in mulesoft/flex-gateway.
## Upgrade in a Kubernetes Cluster
  1. Update charts with the respective chart repositories:
  2. Upgrade the release to a new version of the Helm chart by executing the following command, replacing example information with your own:
```
helm upgrade -n <namespace> <release_name> flex-gateway/flex-gateway --wait
```
substringBy | MuleSoft Documentation
# substringBy
## substringBy(text: String, predicate: (character: String, index: Number) -> Boolean): Array<String>
Splits a string at each character where the `predicate` expression returns `true`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The string to split. The string is treated as an array of characters.  
`predicate` | Expression that tests each character and returns a Boolean value. The expression can iterate over each character and index of the string.  
### Example
This example splits a string where any of the specified characters (`"~"`, `"="`, or `"_"`) are present.
#### Source
```
%dw 2.0
import substringBy from dw::core::Strings
output application/json
---
"hello~world=here_data-weave" substringBy $ == "~" or $ == "=" or $ == "_"
```

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

## substringBy(text: Null, predicate: (character: Nothing, index: Nothing) -> Any): Null
Helper function that enables `substringBy` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Queuing Process Sessions | MuleSoft Documentation
# Queuing Process Sessions
When more process configurations are deployed than sessions are available, RPA Manager must decide the order in which the processes are executed.
You set the priority of a process configuration by assigning it a number between 1 and 200. The smaller the number, the higher the priority.
RPA Manager inserts the deployed configurations in the session queue, as soon they are started.
Test configurations and invocable run configurations automatically have the highest priority.
The processes are executed in the following order:
  1. Invocable process configurations
  2. Test configurations
  3. Production configurations in ascending order of their assigned priority numbers


If two or more configurations have the same priority, the ones deployed first are executed first.
## View the Queue
View the currently processed, waiting, and future process runs in the **Session Queues** view.
  1. Open the **Session Queues** view of the **Process Monitoring** module.
  2. Select the time interval for the future processes and click **Apply**.


## See Also
  * Deploying Automations
  *   *
Web Automation | MuleSoft Documentation
# Web Automation
_Web Automation_ action steps are designed specifically to automate browsers and web-based applications. In contrast to the regular action steps, these do not just simulate user operations, but are also able to handle and control objects within a web-based application. This features can be used in any website or application that runs in a browser.
  * Use this Web Automation object to verify if a website or web application element was loaded properly and how long this took.
  * This Web Automation object is used to clear the content of fields on a website or in a web application.
  * Use this element to simulate mouse input on a website element.
  * The action step Close Web Session enables you to close a web session.
  * Common Properties (Web Automation)
The Web Automation action steps share the Common Properties.
  * This Web Automation object allows you to confirm or dismiss JavaScript Alert Boxes, and enter text in JavaScript input boxes.
  * The Get Element Text action step reads the innerText of an element.
  * Keystrokes to Web Element
Use this Web Automation object to enter alphanumeric characters into fields on a website or within a web application.
  * This Web Automation object allows you to perform navigation operations, such as going backwards or forward in the navigation history or refreshing the current webpage.
  * Use this Web Automation object to select an option from a list box or a drop-down box.
  * This Web Automation object allows you to submit a form on a webpage.
  * Using the Browser Wizard
The Browser Wizard can be used inside Web Automation action step wizards.
  * Use a Web Session to open a Chrome browser window in which all the Web Automation elements contained therein interact.
  * Web Session (Firefox) Use a Web Session to open a Firefox browser window in which all the Web Automation elements contained therein interact.
  * Web Session (MS Edge) Use a Web Session to open an Edge browser window in which all the Web Automation elements contained therein interact.
  * The Website Load Time action step measures the time taken to load a website and the websites that it references.
Upstream Idle Timeout Policy | MuleSoft Documentation
# Upstream Idle Timeout Policy
**Policy Name** | Stream Idle Timeout  
---|---  
Sets the maximum idle duration for a stream between the Flex Gateway and an upstream service  
Quality of Service  
**First Flex Gateway version available**  
**Returned Status Codes** | 504 - Upstream request timeout  
## Summary
The Upstream Idle Timeout policy lets you set a maximum idle duration between requests for a stream between Flex Gateway and the upstream service. By applying the policy, you prevent idle connections from consuming resources while simultaneously allowing persistent connections to remain open. The timeout starts at the last request.
By default, all Flex Gateway API instances have an upstream idle timeout of 60 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: idle-timeout-flex
 config:
  timeout: number // REQUIRED
```

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

### Managed Flex Gateway and Flex Gateway Connected Mode
When you apply the policy to your API instance from the UI, the following parameters are displayed:
Element | Description | Required  
---|---|---  
Upstream idle timeout |  Time in seconds before Flex Gateway closes the connection.
NetSuite Connector 11.7 | MuleSoft Documentation
# NetSuite Connector 11.7
Anypoint Connector for NetSuite (NetSuite Connector) synchronizes data and automates business processes between NetSuite and third-party applications, either on-premises or in the cloud. NetSuite provides cloud-based business management software that helps companies manage core business processes, ERP financials, CRM, e-commerce, inventory, and more.
NetSuite Connector provides the following features:
  * SOAP-based integration
NetSuite Connector 11.0 and later does not support REST-based operations.
  * Generation of NetSuite business objects
  * Different authentication levels
  * Error-handling support


For compatibility information and fixed issues, see the NetSuite Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The NetSuite 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 NetSuite Web Services
  * Anypoint Studio version 7.3.3 or later


## Common Use Cases for the Connector
  * Quote-to-Cash
Improve cash flow, remove manual order entries, and minimize order errors by leveraging realtime integrations to connect and synchronize data about your customer’s intent to buy from your CRM application, such as Salesforce, into its realization of revenue in NetSuite ERP.
  * Invoice-to-Reconciliation
Automate your Accounts Receivable (A/R) process by automatically applying bank payments against invoices in NetSuite for real-time A/R processing. Streamline accounts payable by automating payment file transfers between NetSuite and your banks.
  * Hire-to-Retire
Build a single view of your employees with realtime synchronization of employee information between Netsuite and your Human Capital Management (HCM) services, such as Workday, Oracle HCM, PeopleSoft, and so on. Automatically trigger employee onboarding processes such as ordering computer equipment, uniforms, system access setup, and so on, while reversing the process upon retirement.


## Authentication types
NetSuite connections use token-based authentication, which uses either a consumer key and token ID or secret pairs to authenticate.
For information about configuring this authentication type, see Using Anypoint Studio to Configure NetSuite Connector.
## Using Exchange Templates and Examples
Anypoint Exchange provides the following templates that you can use as starting points for your apps:
  * Retrieve a List of Customers from NetSuite
  * Salesforce and NetSuite Opportunity Aggrgation


## Next Step
After you complete the prerequisites, you are ready to create your own app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
MuleSoft Accelerator for Salesforce OMS | MuleSoft Documentation
# MuleSoft Accelerator for Salesforce OMS
MuleSoft Accelerator for Salesforce OMS enables you to integrate your Order Management System (OMS) with external business partners and application ecosystems by leveraging the application and B2B integration capabilities of Anypoint Platform. The solution accelerates the implementation of Electronic Data Interchange (EDI) messaging and other integrations into Salesforce OMS.
## Use Case
### B2B EDI Order Lifecycle Automation
The B2B EDI Order Lifecycle Automation use case lets you add EDI as a direct order intake channel to manage and service EDI orders across the full order management lifecycle.
## See Also
  *   *   *   * MuleSoft Accelerator for Salesforce OMS on Exchange
Text Plain Format | MuleSoft Documentation
# Text Plain Format
MIME type: `text/plain`
ID: `text`
The Text Plain format represents text as a string.
Note that DataWeave parses, encodes, and stores this format into RAM memory.
## Example
This example shows how DataWeave represents Text Plain data.
### Input
The Plain Text data serves as the input payload to the DataWeave source.
```
This is text plain
```

### Source
The DataWeave script transforms the Text PLain input payload to the DataWeave (dw) format and MIME type. It returns a string.
```
output application/dw
---
payload
```

### Output
Because the DataWeave (dw) output is a string, it is wrapped in quotation marks.
```
"This is text plain"
```

## Configuration Properties
DataWeave supports the following configuration properties for this format.
### Reader Properties
There are no reader properties for this format.
### 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`.  
The encoding to use for the output, such as UTF-8.  
## Supported MIME Types
This format supports the following MIME types.
Connection Not Established | MuleSoft Documentation
# Connection Not Established
If an organization has multiple identity providers, the guided setup can fail to create the data bridge between Anypoint and API Community Manager. During setup, an API request is sent to obtain the identity provider ID and to check if it matches the ID that is entered. When there are more than one identity providers, only the first identity provider ID from the response is read, which might not match the ID that was entered.
Resolve this issue by changing the identity provider ID:
  1. To find the identity provider ID, run this request:
`curl --location --request GET 'https://anypoint.mulesoft.com/accounts/api/organizations/<YOUR_ORG_ID>/identityProviders' \ --header 'Authorization: Bearer <TOKEN>'`
  2. Replace `<YOUR_ORG_ID>` with your organization ID and replace `<TOKEN>` with your token.
  3. In the response, find the line with the provider_id:
`"provider_id": "01234567-89ab-cdef-0123-456789abcdef",`
  4. In Salesforce, go to **Setup** > **Security** > **Named Credentials** and click **Anypoint**.
  5. Change the formula to the following:
`"v2|IDP_ID|" & $User.Username & "|" & $User.FirstName & "|" & $User.LastName & "|" & $User.Email & "|[\"Community User\"]"`
  6. Replace `IDP_ID`` with the identity provider ID.
For example:
`"v2|83685668-9e8a-49c2-9d9a-7a7c89391cce|" & $User.Username & "|" & $User.FirstName & "|" & $User.LastName & "|" & $User.Email & "|[\"Community User\"]"`
Periods (dw::core::Periods) | MuleSoft Documentation
# Periods (dw::core::Periods)
This module contains functions for working with and creating Period values.
To use this module, you must import it to your DataWeave code, for example, by adding the line `import * from dw::core::Periods` to the header of your DataWeave script.
## Functions
Name | Description  
---|---  
Returns a Period (P) value consisting of the number of years, months, and days between two Date values.  
Creates a Period value from the provided number of days.  
Creates a Period value that represents a number of days, hours, minutes, or seconds.  
Creates a Period value from the provided number of hours.  
Creates a Period value from the provided number of minutes.  
Creates a Period value from the provided number of months.  
Creates a Period value as a date-based number of years, months, and days in the ISO-8601 calendar system.  
Creates a Period value from the provided number of seconds.  
Creates a Period value from the provided number of years.
Idempotent Message Validator | MuleSoft Documentation
# Idempotent Message Validator
The Idempotent Message Validator ensures that only unique messages continue through a flow’s execution by checking the unique ID of the incoming message. You can use any incoming attribute of the Mule message as an ID, or you can compute the ID by configuring a DataWeave expression. You can also use the DataWeave `Crypto` functions to compute hashes (SHA, MD5) from the data.
## Message Hashing
DataWeave enables you to import the `Crypto` library to execute hashing functions. Calculating a hash can be useful when you want to compute a unique ID for the Mule message. For example, if you want to get an MD5 hash from the payload and use it as the ID, open the Idempotent Message Validator properties in Anypoint Studio and set **ID Expression** (`idExpression` in XML) to the following DataWeave expression:
```
#[
  %dw 2.0
  output text/plain
  import dw::Crypto
  ---
  Crypto::hashWith(payload,'MD5')
]
```

## Examples
  * The following example shows an Idempotent Message Validator configured to extract the query parameter `id` from the HTTP request and use that value as a unique identifier to filter the message:
```
<flow name="myFlow">
 <http:listener doc:name="Listener" config-ref="HTTP_Listener_config" path="/"/>
 ...
 <idempotent-message-validator doc:name="Idempotent Message Validator" idExpression="#[attributes.queryParams.id]"/>
 ...
</flow>
```

  * The next example shows an Idempotent Message Validator configured to hash the payload using a DataWeave expression, store the result in a persistent object store, and then use the processed message IDs as the unique identifier to filter the message:
```
<flow name="myFlow">
 <http:listener doc:name="Listener" config-ref="HTTP_Listener_config" path="/"/>
 ...
 <idempotent-message-validator doc:name="Idempotent Message Validator" idExpression="
  #[%dw 2.0
   import dw::Crypto
   output application/octet-stream
   ---
   Crypto::hashWith(payload,'MD5')]">
  <os:private-object-store alias="privateObjectStore"
    entryTtl="1"
    entryTtlUnit="MINUTES"
    maxEntries="10" />
 </idempotent-message-validator>
 ...
</flow>
```



## Parameter Reference
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
ID Expression | Expression | The expression Mule uses to generate the ID. You can use a DataWeave function to calculate the ID, or you can extract the ID from any existing value of the Mule message. | `#[correlationId]`  
Value Expression | Expression | This parameter is not used. Setting a value has no effect. | `#[correlationId]`  
Object Store | Object Store | Either a name to reference a global object store or a definition of a private object store where the component stores the processed message IDs. | Object Store created by the Object Store Manager. Not persistent, with an entry TTL of 5 MINUTES and an expiration interval of 6 SECONDS.  
Store Prefix | Defines the prefix of the object store names. This value is used only for the internally built object store. | _configFileName_._flowName_.IdempotentMessageValidator  
### Throws
  * `MULE:DUPLICATE_MESSAGE`


## See Also
  *