BassemE/mulesoft-documentation-embeddings huggingface dataset:
A2A Connector 0.1.0-BETA | MuleSoft Documentation
# A2A Connector 0.1.0-BETA
Anypoint Connector for Agent2Agent (A2A) (A2A Connector) facilitates inter-agent communication for Large Language Model (LLM) agents and other applications by implementing the A2A protocol. This enables agents to interact and delegate specialized tasks to other agents.
The A2A protocol is an open standard that supports:
  * Capability discovery
Identifies the functions and services offered by agents.
  * Interaction negotiation
Establishes communication methods between agents.
  * Secure information exchange
Transmits data between agent systems without requiring direct internal access.


A2A Connector provides Mule app integration that functions as both A2A servers and A2A clients.
Anypoint Connector for Agent2Agent (A2A) is a beta connector that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and the Non-GA Gen AI and Non-GA Credit Consumption terms in the Product Terms Directory. Use of this beta connector with external systems or services consumes Mule messages and is at the Customer’s sole discretion.  
---  
This A2A Connector beta release doesn’t support these A2A capabilities:
  * Streaming
  * Notifications
  * Task history

  
---  
For information about compatibility and fixed issues, see the A2A Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * How to create a Mule app using Anypoint Code Builder or Anypoint Studio


Before creating an app, you must have:
  * Java 17
  * Apache Maven
  * Anypoint Platform
  * Credentials to connect with the target resource
  * The latest versions of Anypoint Code Builder or Anypoint Studio


## Common Use Cases for the Connector
Build specialized domain specific agents each for Customer Service, Sales, or Marketing and have other agents interact with these agents using the A2A protocol.
## Connection Types
A2A Connector supports these connection types:
  * A2A server
    * Introduces a new A2A Listener with a **Task Listener** source.
    * Automatically generates an Agent Card based on the connector configuration.
    * Processes incoming A2A requests from client agents, extending A2A protocol support to existing agents or other connectors.
  * A2A client
    * Initiates tasks with other A2A host agents.
    * Retrieves task status from A2A host agents.


## Next Step
After you complete the prerequisites, you are ready to create an app and configure the connector using Anypoint Studio or Anypoint Code Builder.
## See Also
  * Anypoint Connectors Overview
  * Using Anypoint Code Builder to Configure a Connector
  * Using Anypoint Studio to Configure a Connector
  * A2A Connector Reference
  * MuleSoft Help Center
unwrap | MuleSoft Documentation
# unwrap
## unwrap(text: String, wrapper: String): String
Unwraps a given `text` from a `wrapper` text.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
The text used to unwrap.  
### Example
This example shows how `unwrap` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import unwrap from dw::core::Strings
output application/json
---
{
 "a": unwrap(null, ""),
 "b": unwrap(null, '\0'),
 "c": unwrap("'abc'", "'"),
 "d": unwrap("AABabcBAA", 'A'),
 "e": unwrap("A", '#'),
 "f": unwrap("#A", '#'),
 "g": unwrap("A#", '#')
}
```

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

## unwrap(text: Null, wrapper: String): Null
Helper function that enables `unwrap` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._
asin | MuleSoft Documentation
# asin
## asin(angle: Number): Number | NaN
Returns an arc sine value that can range from `-pi/2` through `pi/2`.
If the absolute value of the input is greater than 1, the result is `null`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
Number to convert into its arc sine value.  
### Example
This example shows how `asin` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::util::Math
output application/json
---
{
 "asin0": asin(0),
 "asin13": asin(0.13),
 "asin-1": asin(-1),
 "asin1.1": asin(1.1)
}
```

#### Output
```
{
  "asin0": 0.0,
  "asin13": 0.1303689797031455,
  "asin-1": -1.5707963267948966,
  "asin1.1": null
 }
```
appendIfMissing | MuleSoft Documentation
# appendIfMissing
## appendIfMissing(text: String, suffix: String): String
Appends the `suffix` to the end of the `text` if the `text` does not already ends with the `suffix`.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
The text used as the suffix.  
### Example
This example shows how `appendIfMissing` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import appendIfMissing from dw::core::Strings
output application/json
---
{
 "a": appendIfMissing(null, ""),
 "b": appendIfMissing("abc", ""),
 "c": appendIfMissing("", "xyz") ,
 "d": appendIfMissing("abc", "xyz") ,
 "e": appendIfMissing("abcxyz", "xyz")
}
```

#### Output
```
{
 "a": null,
 "b": "abc",
 "c": "xyz",
 "d": "abcxyz",
 "e": "abcxyz"
}
```

## appendIfMissing(text: Null, suffix: String): Null
Helper function that enables `appendIfMissing` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._
valueSet | MuleSoft Documentation
# valueSet
## valueSet<K, V>(obj: { (K)?: V }): Array<V>
Returns an array of the values from key-value pairs in an object.
_This function is**Deprecated**. Use dw::Core::valuesOf, instead._
### Parameters
Name | Description  
---|---  
The object to evaluate.  
### Example
This example returns the values from the input object.
#### Source
```
%dw 2.0
import * from dw::core::Objects
output application/json
---
{ "valueSet" : valueSet({a: true, b: 1}) }
```

#### Output
```
{ "valueSet" : [true,1] }
```
X12 EDI Connector 2.16 | MuleSoft Documentation
# X12 EDI Connector 2.16
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
SAP S/4HANA SOAP Connector 2.5 | MuleSoft Documentation
# SAP S/4HANA SOAP Connector 2.5
Anypoint Connector (SAP S/4HANA SOAP Connector) provides full support for the SOAP APIs exposed by SAP S/4HANA Cloud ERP, and starting with version 2.1, also provides support for SAP S/4HANA on-premise ERP. This connector enables you to automatically discover SOAP services enabled on your SAP S/4HANA instance and to invoke the SOAP service and associated operations.
For software requirements and compatibility information, see the SAP S/4HANA SOAP Connector Release Notes.
## Before You Begin
Before you create an app and use this connector, you must:
  * Have a developer account or other valid SAP S/4HANA instance.
  * Have a MuleSoft Enterprise license.
  * Enable discovery service in your SAP S/4HANA instance.
  * Have a communication user that is assigned to the corresponding communication arrangements for the desired APIs.
  * Be familiar with:
    * SAP S/4HANA SOAP
    * Mule runtime engine (Mule)
    * Anypoint Connectors
    * Anypoint Studio essentials


## Common Use Cases For the Connector
Send an XML request to SAP S/4HANA’s SOAP API and print a response.
## Using Exchange Templates and Examples
Anypoint Exchange provides templates you can use as a starting point for your app, as well as examples that illustrate a complete solution.
## 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
  * SAP S/4HANA SOAP Connector Release Notes
  * SAP S/4HANA SOAP Connector on Exchange
  * MuleSoft Help Center
Connectivity with MuleSoft Government Cloud | MuleSoft Documentation
# Connectivity with MuleSoft Government Cloud
Use Anypoint API Community Manager to create developer communities that surface APIs from Anypoint Platform organizations in the MuleSoft AWS Government Cloud environment. In this deployment model, your developer community runs on the standard API Community Manager product in the commercial cloud environment. Your community connects to your MuleSoft Government Cloud organization as an external system to retrieve the specific information you want to make available outside your FedRAMP authorization boundary for your public API community, such as API documentation.
In this model, you have full control of what data in your MuleSoft Government Cloud organization is accessible to the API Community Manager product in the Salesforce commercial cloud environment. The MuleSoft Government Cloud data control documentation page shows how to configure these detailed data access controls.
For compliance with FedRAMP regulations on handling support cases associated with API Community Manager when connected to your MuleSoft Government Cloud organization, any support case that requires access or interaction with your MuleSoft Government Cloud organization data is handled by the MuleSoft support team following FedRAMP requirements. Support cases that do not require access to your MuleSoft Government Cloud data (such as those related to look and feel, branding, CMS articles, and forums on your public developer community) are handled through API Community Manager standard support processes.
## Limitations
API Community Manager supports MuleSoft Government Cloud with a few limitations.
The following search options are visible but not functional for MuleSoft Government Cloud in the latest version of API Community Manager:
  * Search in API Specifications
  * Search in API Documentation Pages
  * Search in Custom Fields
  * Enable Advanced Links


## See Also
  * MuleSoft Government Cloud Data Control
Approving a Process for Automation | MuleSoft Documentation
# Approving a Process for Automation
This topic is affected by the Anypoint Platform integration.
You approve an evaluated process candidate to refer it to a project manager or a center of excellence for automation.
## Before You Begin
  * Ask an organization administrator in Access Management to assign you the required permissions:
Action | RPA Permission | Deprecated RPA Permission  
---|---|---  
Refer a process for automation to a center of excellence. | RPA Evaluations Manager | Process Evaluation Approval to a CoE  
Refer a process for automation directly to a project manager. | RPA Evaluations Manager | Process Evaluation Approval to a Project Manager  
  * You can only approve evaluated process candidates.
  * You can only refer processes to users assigned the `Project Management` privilege or user groups assigned as `Center of Excellence`.
If you use an Anypoint account to login to RPA Manager, user groups are replaced by teams and the Center of Excellence flag is deprecated. Ensure that the team you refer a process to has the required RPA permissions for automating the process.


## Select a Process for Approval
You can automate processes that have ratings for feasibility. Consider the benefits before automating a process. Automate simple processes first.
  1. Filter the process list in the **Process Evaluation** view of the **Process Evaluation** module to show only newly-created evaluations.
  2. View the **Process Matrix**. If you cannot see it, click **Expand** ().
  3. Hover over the dots to see the names of the corresponding processes.
  4. Click one of the toggle-dots in the upper right half of the matrix to select it and to display only the corresponding processes.


## Approve a Process
Approve the selected process to refer it to a project manager or a center of excellence for automation.
After approval, the process is also displayed either in the personal backlog of the project manager (**My RPA** - **My Backlog**) or in the team backlog of the center of excellence (**My RPA** - **Team Backlog**).
  1. In the **Process Evaluation** view of the **Process Evaluation** module, click **Approve** in the row of the evaluation you want to approve.
  2. Choose a user or a center of excellence as **Project Manager**.
  3. Click **OK**.


## See Also
  * Considering Which Processes to Automate
  * Anypoint Platform Migration Overview
  *   * Access Management - Manage User Access Using Teams
  * RPA Permissions - RPA Evaluations Manager
  * Starting Automation of Approved Processes
About Design Center | MuleSoft Documentation
# About Design Center
Anypoint Design Center is a development environment that includes API Designer, a tool that enables you to create API specifications in several modeling languages and create RAML API fragments. After you create a specification or fragment, publish it to Anypoint Exchange for anyone in your MuleSoft organization to use.
Flow Designer is end of life and its documentation is now located at Flow Designer archive site.   
---  
## Prerequisites for Using Design Center
You must meet the following requirements for accessing Design Center, using its features, running and deploying apps, and publishing designs to Exchange:
  * Be assigned the Design Center Developer permission or be the Organization Owner.
  * Be assigned the CloudHub Admin role for the Design environment.
  * Be assigned the Exchange Contributor role.
  * Belong to an Anypoint organization that has at least one CloudHub Design Environment with 0.2 vCores of available capacity.


To deploy to the production environment from Design Center, your user account also needs to be assigned to a CloudHub Developer role specifically for the production environment.
## Where to Start Using Design Center
To start using Design Center, click Design Center after signing into Anypoint Platform. The Projects list appears. See the documentation for API Designer for the steps to create projects for those tools.
## See Also
  * CloudHub Environments
divideBy | MuleSoft Documentation
# divideBy
## divideBy<T>(items: Array<T>, amount: Number): Array<Array<T>>
Breaks up an array into sub-arrays that contain the specified number of elements.
When there are fewer elements in the input array than the specified number, the function fills the sub-array with those elements. When there are more elements, the function fills as many sub-arrays needed with the extra elements.
### Parameters
Name | Description  
---|---  
Items in the input array.  
The number of elements allowed per sub-array.  
### Example
This example breaks up arrays into sub-arrays based on the specified `amount`.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
output application/json
---
{
 "divideBy" : [
   { "divideBy2" : [1, 2, 3, 4, 5] divideBy 2 },
   { "divideBy2" : [1, 2, 3, 4, 5, 6] divideBy 2 },
   { "divideBy3" : [1, 2, 3, 4, 5] divideBy 3 }
 ]
}
```

#### Output
```
{
 "divideBy": [
 {
  "divideBy2": [
   [ 1, 2 ],
   [ 3, 4 ],
   [ 5 ]
  ]
 },
 {
  "divideBy2": [
   [ 1, 2 ],
   [ 3, 4 ],
   [ 5, 6 ]
  ]
 },
  {
   "divideBy3": [
    [ 1, 2, 3 ],
    [ 4, 5 ]
   ]
  }
 ]
}
```

## divideBy(items: Null, amount: Any): Null
Helper function that enables `divideBy` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Google Drive Connector 1.0 | MuleSoft Documentation
# Google Drive Connector 1.0
Anypoint Connector for Google Drive (Google Drive Connector) enables you to automate business processes between Google Drive (Drive) and other enterprise applications, either on premises or in the cloud. Using the Google Drive connector, you can programmatically access and upload content and relevant information to and from Drive.
Drive enables you to store and back up all of your files in the cloud, including documents, slides, images, audio, and video. It integrates seamlessly with cloud-native apps that enable your teams to collaborate effectively in real time, using apps like Google Docs, Sheets, and Slides.
For compatibility information and fixed issues, see the Google Drive Connector Release Notes.
## Before You Begin
To use this connector, you should be familiar with:
  * The Google Drive 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 Google Drive
  * Anypoint Studio version 4.2.1 or later


## Common Use Cases for the Connector
Automate powerful business processes by integrating Google Drive with other enterprise IT tools and systems, such as messaging, CRM, and ITSM. Possibilities include:
  * Improving sales operations
Automate contract approval processes so that when a sales contract is received in the Salesforce CRM system, it is automatically uploaded to Drive and shared with the deal desk or other teams for their review.
  * Enhancing cross-team collaboration
Automatically notify all relevant teams and team members via Slack or Microsoft Teams and email when new content, such as product specs, contracts, and legal addendums, is uploaded to a given folder in Drive.
  * Securing your enterprise content
Automatically upload properly secured content from other enterprise systems, such as CRM, email, and marketing tools, to Drive folders. This minimizes IP leaks by making Drive the single source of truth for all of your content.


## Authentication Types
Google Drive Connector uses the OAuth 2.0 authentication connection type, which uses access tokens provided by the authorization server to access protected data.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Configuring RAG Operations for Einstein AI Connector 1.2 | MuleSoft Documentation
# Configuring RAG Operations for Einstein AI Connector 1.2
Retrieval-Augmented Generation (RAG) is a technique for enhancing AI-generated outputs by retrieving relevant content, and using it to augment AI prompts with additional context. By grounding LLMs with this additional information, they can provide more accurate and reliable responses.
## Configure the RAG Adhoc Load Document Operation
The **RAG adhoc load document** operation retrieves information based on a plain text prompt from an in-memory embedding store.
To configure the **RAG adhoc load document** operation:
  1. Select the operation on the Anypoint Code Builder or Studio canvas.
  2. In the **General** properties tab for the operation, enter these values:
     * **Prompt**
The prompt to send to the LLM and the embedding store to respond to.
     * **File Path**
Contains the full file path for the document to ingest into the embedding store. Ensure the file path is accessible.
You can also use a DataWeave expression for this field, for example:
`mule.home "/apps/" app.name ++ "/customer-service.pdf"`
  3. In **Additional properties** , select the values for:
     * **Embedding name**
     * **File type**
Type of document to ingest into the embedding store:
       * URL
A single URL pointing to web content to ingest.
     * **Option type**
How to split the document prior to ingestion into the vector database
     * **Model name**
Name of the API model that interacts with the LLM.
     * **Probability**
Probability of the model API staying accurate
     * **Locale**
Localization information, which can include the default locale, input locale(s), and expected output locales


This is the XML configuration for this operation:
```
<ms-einstein-ai:rag-adhoc-load-document
 doc:name="Rag adhoc load document"
 doc:id="edaea124-a8aa-4d4a-8f85-0f32ee4c9858"
 config-ref="Einstein_AI"
 prompt="#[payload.prompt]"
 filePath="#[payload.filePath]"
 optionType="PARAGRAPH"
/>
```

## See Also
  * Using Anypoint Code Builder to Configure a Connector
  * Using Studio to Configure a Connector
  * Einstein AI Connector Overview
  * Einstein AI Connector Reference
  * MuleSoft Help Center
Back-Pressure and MaxConcurrency | MuleSoft Documentation
# Back-Pressure and MaxConcurrency
Under heavy load, Mule runtime engine (Mule) might not immediately have the resources available to process a specific event. This issue might occur because all threads are busy and the current flow’s concurrency is exceeded. When this occurs, Mule logs the following message: `Flow 'flowName' is unable to accept new events at this time` This message is known as back-pressure. Mule back-pressure actions are specific to each connector’s source.
When a producer component outputs information at a higher rate than a consumer component can process it, you can use the `maxConcurrency` parameter to set the maximum number of concurrent messages that a flow can process at any given time, whether the components are internal or external, flows or sources, and so on.
Although Mule applies back-pressure on its own, the `maxConcurrency` parameter helps to control the flow performance, especially when a backend server may affect when having high concurrency. See how to set the parameter in the following example:
```
<flow name="perf-test-flow" maxConcurrency="${flow.max.concurrency}">
```

Similarly, you can limit the number of records that can be processed in a batch job by setting the `maxConcurrency` parameter as in the following example:
```
<batch:job jobName="test-batch" maxConcurrency="${batch.max.concurrency}">
```

By default, the Flow and Async scopes do not set a `maxConcurrency` limit, but the Batch Job component limits concurrency to twice the number of available cores. The capacity of your system also limits concurrency.
## Components with Max Concurrency Settings
The following components provide a max concurrency setting:
  * Flow scope
  * Scatter-Gather router
  * Async scope
  * Batch Job scope
  * Parallel For Each scope


## Recommendation
Unless a lower concurrency is required to artificially trigger a back-pressure event, use the default settings, and do not change the max concurrency value.
## See also
  * Execution Engine Threads and Concurrency
Add Another Output to the Transform Message Component (Anypoint Studio) | MuleSoft Documentation
# Add Another Output to the Transform Message Component (Anypoint Studio)
A single Transform Message component can give shape to several different parts of the output Mule event (the payload, variables, and attributes). Each different output part must be defined in a separate target XML element inside the `<ee:transform>` XML element as another block of DataWeave code. In Anypoint Studio 7, you do this by writing the DataWeave code in a separate tab of the Transform pane. For example, if one tab defines the payload, and another attributes, these are both parts of the same output Mule event.
To add a new output target:
  1. Click **Add new target**.
  2. Specify where in the output Mule message to place the result of this new DataWeave transform. In case you’re creating a new variable or property, you must also set a name for it.


Note that the execution order of multiple outputs can vary. Ensure that each transformation is independent of the order of execution and the other outputs.
## How Targets of a Transform Message Component are Represented in the Configuration XML File
The payload is represented in an `<ee:message>` element, as a child element of the `<ee:message>` element.
```
<ee:transform doc:name="Set Transactions XML" doc:id="5c58d889-896d-495a-b2f6-fe1613ae8044" >
 <ee:message >
  <ee:set-payload ><![CDATA[%dw 2.0
               output application/xml
               ...]]>
```

Attributes are represented together inside the `<ee:message>` element, as a child of the `<ee:message>` element.
```
<ee:transform doc:name="Set Transactions XML">
 <ee:message >
  <ee:set-payload ><![CDATA[%dw 2.0
               output application/xml
               ...]]>
  </ee:set-payload/>
  <ee:set-attributes>
  <![CDATA[%dw 2.0
       output application/java
       ---
      { }]]>
  </ee:set-attributes>
 </ee:message>
 ...
</ee:transform>
```

Each variable is represented inside a separate `<ee:variable>` element, as a child the `<ee:variables>` parent element. The `<ee:variables>` element is a direct child of the `<ee:transform>` element, so it is not part of the `<ee:message>` element. This XML structure reflects that variables and the message are carried along together with the parent event object.
Here is an example of a variable target defined inside a Transform Message component:
```
<ee:transform doc:name="Set accounts var" doc:id="15e226ab-8204-4d84-ab4b-f4fcdd088656">
 <ee:message>
 ...
 </ee:message>
 <ee:variables>
  <ee:set-variable variableName="accounts">
   <![CDATA[%dw 2.0
        output application/json
        ---
        ...]]>
  </ee:variable>
 </ee:variables>
</ee:transform>
```

## See Also
Transform Message Component
Change the Target Output of a Transformation
Mule Message Structure
DataWeave Language
Installing BAT | MuleSoft Documentation
# Installing BAT
The Blackbox Automated Testing (BAT) CLI wrapper is a command line wrapper that you install to execute API tests.
## Prerequisite for Linux and MacOS Systems
Before installing the BAT CLI, ensure that AdoptOpenJDK’s OpenJDK 8 is installed on your system.
## Prerequisites for Windows 10 Systems
  1. Install Windows Subsystem for Linux (WSL)
The instructions are at https://docs.microsoft.com/en-us/windows/wsl/install-win10.
  2. Install Java 8, curl, and the application "unzip" into the Linux distribution that you installed in your WSL.
  3. Ensure that the `JAVA_HOME` variable in your environment is set to the location of your Java installation.
  4. Add the `bat` executable to your `PATH` environment variable:
    1. Open the `~/.bashrc` file (if you are using `bash`) or the `~/.zshrc` file (if you are using `zsh`) for editing. For example, to use the `vi` editor, enter either of these commands:
`vi ~/.bashrc`
`vi ~/.zshrc`
    2. Add the following line to the end of the file and then save the file:
`export PATH=$PATH:~/.bat/bat/bin`


## Install BAT
You can install BAT CLI on Linux, MacOS, and Windows.
### Linux and MacOS Systems
  1. Ensure that the user under which you are installing has write and execute permissions for the directory into which you plan to install BAT CLI and to `/usr/local/bin`.
  2. Run the following command to install BAT CLI:
`curl -o- 'https://s3.amazonaws.com/bat-wrapper/install.sh' | bash`
This installs BAT CLI into the `$HOME/.bat/bat/bin` directory. The installation script automatically adds a `bat` file to the `/usr/local/bin` directory that points to the actual BAT CLI installation directory. If this does not work, you can manually add `$HOME/.bat/bat/bin` to your shell environment’s path to execute BAT CLI or rerun the installation under a user with write permission for `/usr/local/bin`.
  3. Run the command `bat -version` to verify that BAT CLI is installed.


### Windows
  1. Click here to automatically download the ZIP file of the BAT wrapper for Windows.
  2. Unzip the ZIP file to install BAT CLI in your Windows environment.
  3. Run the command `bat -version` to verify that BAT CLI is installed.


## What to Do Next
You can now start creating a test suite.
## See Also
  * Starting a New Test Suite
  * BAT Command Reference
Salesforce Releases and Migrations | MuleSoft Documentation
# Salesforce Releases and Migrations
The Salesforce organization dedicated to your API community follows the standard Salesforce release process. This automatically upgrades your organization to the latest Salesforce release version three times each year. As an organization administrator, you receive email notifications about the changes at least three months in advance, including any guidance, required steps for you to follow, or other resources for the upgrade.
Many Salesforce upgrades do not require any additional steps for Anypoint API Community Manager. If you must take steps to prepare API Community Manager for the upgrade, your MuleSoft customer success representative provides them and you can also view them on trust.mulesoft.com.
The Salesforce organization dedicated to your API community sometimes moves across instances within a region. These migrations usually have no impact on your API community. If there is any impact, your MuleSoft customer success representative notifies you and you can also view it on trust.mulesoft.com.
For help with the Salesforce release or migration process, contact your customer success representative.
For outages or operational issues with your API community, contact MuleSoft support.
## See Also
  * Salesforce release process
  * trust.mulesoft.com
Remove Variable Transformer | MuleSoft Documentation
# Remove Variable Transformer
The Remove Variable component takes a Mule variable name and removes the variable from a Mule event.
Field | XML | Description  
---|---|---  
Display Name |  Customize to display a unique name for this component in Anypoint Studio. Defaults to `Remove Variable`.  
`variableName` |  Name of the variable to remove. If the variable does not exist in the flow, the component logs a warning (`WARN`). Attempts to access the value of a variable that does not exist return a `null` value. See Example.  
## Example
This basic example shows how to remove a Mule variable from the flow:
```
<flow name="remove-variable-ex" >
 <scheduler doc:name="Scheduler" >
  <scheduling-strategy >
   <fixed-frequency frequency="10" timeUnit="SECONDS"/>
  </scheduling-strategy>
 </scheduler>
 <set-variable value='"value of my Mule variable"' doc:name="Set Variable"
        variableName="myMuleVar"/>
 <logger level="INFO" doc:name="Logger"
     message="#[vars.myMuleVar]"
     category="PRINT VALUE OF VARIABLE"/>
 <remove-variable doc:name="Remove Variable"
          variableName="myMuleVar"/>
 <logger level="INFO" doc:name="Logger"
      category="ATTEMPT TO PRINT VALUE OF REMOVED VARIABLE"
      message="#[vars.myMuleVar]"/>
 <remove-variable doc:name="Remove Variable"
          variableName="banana"/>
</flow>
```

The flow uses the following processors:
  * The Scheduler component triggers the flow.
  * Set Variable creates a Mule variable (`myMuleVar`).
  * The first Logger in the flow prints the value of the variable (`"value of my Mule variable"`).
  * Remove Variable provides a string with the name of the variable (`variableName="myMuleVar"`) to remove the variable from the Mule event.
  * The second Logger prints `null` because the Mule variable no longer exists.
  * The second Remove Variable logs a `WARN` message because it attempts to remove a Mule variable (`banana`) that does not exist in the Mule event.


The following example shows the logs for an execution of this flow:
```
INFO 2022-12-15 08:33:20,151 ...event: 2f65e920-7c96-11ed-97ec-147ddaaf4f97]
PRINT VALUE OF VARIABLE: "value of my Mule variable"
INFO 2022-12-15 08:33:20,155 ...event: 2f65e920-7c96-11ed-97ec-147ddaaf4f97]
ATTEMPT TO PRINT VALUE OF REMOVED VARIABLE: null
WARN 2022-12-15 08:33:20,156 ...event: 2f65e920-7c96-11ed-97ec-147ddaaf4f97]
...RemoveFlowVariableProcessor: There is no variable named 'banana'.
Check the 'variableName' parameter in the 'remove-variable' component at
remove-variable-ex/processors/4
```

## See Also
  * Variables in Mule Events
  * Enrich Data with Target Variables
Contributing Functions with Mule SDK | MuleSoft Documentation
# Contributing Functions with Mule SDK
DataWeave is the main expression language in Mule 4, and the Mule SDK is also aligned with that view. This allows you to contribute functions to DataWeave from your module’s code in a similar fashion that you code a Mule Operation. Using custom functions allows you to reuse code in a new way, providing extra functionality in a single Module with very little overhead regarding how they are declared compared to a Mule operation.
## Declaring a Function
At Extension level, you can use the `@ExpressionFunctions` annotation to reference the classes that contain the public methods representing the DataWeave functions. This method’s code is executed directly from DataWeave scripts using it name as identifier:
```
@Extension(name = "Docs")
@ExpressionFunctions(DocsFunction.class)
public class DocsModule {
}
```

In the `DocsFunction` class, this example defines the following method:
```
public Object xpath(@Optional(defaultValue = PAYLOAD) InputStream item,
          String expression){
  try {
   return xPathFactory.newXPath().evaluate(expression, documentBuilder.parse(item));
  } catch (Exception e) {
   return null;
  }
 }
```

This `xpath` function can now be used from inside a DataWeave script, referencing it _inside our Module’s namespace_.
The next example reads XML and sets an XPath filter using the new `xpath` function:
```
<flow name="xpathFunctionUsingPayloadAsDefault">
 <file:read path="files/bookstore.xml"/>
 <set-payload value="#[Docs::xpath("/bookstore/book[price>35]/title")]"/>
</flow>
```

To view the actual implementation of the simplified example shown above, refer to XPathFunction.java.
## Restrictions: Config-less and Connection-less
By definition, functions are not allowed to depend on or receive a particular Configuration or Connection.
Monitoring Apps Deployed to CloudHub 2.0 | MuleSoft Documentation
# Monitoring Apps Deployed to CloudHub 2.0
  * Viewing Log Data for Deployed Apps
  * Viewing Diagnostic Data for Deployed Apps
  * Configuring Application Alerts
splitWhere | MuleSoft Documentation
# splitWhere
## splitWhere<T>(array: Array<T>, condition: (item: T) -> Boolean): Pair<Array<T>, Array<T>>
Splits an array into two at the first position where the condition is met.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The array of elements to split.  
`condition` | The condition (or expression) used to match an element in the array.  
### Example
#### Source
```
%dw 2.0
import * from dw::core::Arrays
output application/json
var users = ["Mariano", "Leandro", "Julian", "Tomo"]
---
users splitWhere (item) -> item startsWith "Jul"
```

#### Output
```
{
 "l": [
  "Mariano",
  "Leandro"
 ],
 "r": [
  "Julian",
  "Tomo"
 ]
}
```

## splitWhere(array: Null, condition: (item: Nothing) -> Any): Null
Helper function that enables `splitWhere` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Salesforce Composite Connector 2.17 | MuleSoft Documentation
# Salesforce Composite Connector 2.17
Anypoint Connector for Salesforce Composite enables you to work with the Salesforce Batch and SObject Tree APIs. The connector exposes convenient methods for preparing subordinate requests, executing them in one batch, and parsing the results.
Salesforce Composite Connector also enables you to create SObject trees by using the **Create sobject tree** operation, which is separate from the batch operations.
This connector provides DataSense for execution and to:
  * Prepare subordinate requests and then parse the responses
  * Create SObject trees


For compatibility information and fixed issues, see Salesforce Composite Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Salesforce Composite API
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have:
  * Credentials to access the Salesforce Composite target resource
  * Anypoint Studio version 7.0 or later


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


For information about configuring these authentication types, see Using Anypoint Studio to Configure Salesforce Composite Connector.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center
Deleting API Specs and Fragments | MuleSoft Documentation
# Deleting API Specs and Fragments
Cloud IDE 
Desktop IDE 
**Open Beta Release** : The **cloud IDE is in open beta**. Any use of Anypoint Code Builder in its beta state is subject to the applicable beta services terms and conditions, available from the IDE.
Deleting API specs and fragments varies depending on the project creation date and project hosting.
  * To delete a design project hosted locally on Anypoint Code Builder, delete the entire project folder.
  * To delete a design project hosted on US cloud or EU cloud with an API spec imported from MuleSoft VCS, you must delete the project from MuleSoft VCS by accessing Design Center.
  * To delete a design project created with versions of Anypoint Code Builder released prior to February 2024 that required storage of the spec in the MuleSoft VCS, you must delete the project from MuleSoft VCS by accessing Design Center.
  * To delete a project hosted on JP cloud or CA cloud, you must use an Anypoint CLI command.


You must delete the previous project to reuse the project name for a new design project in Anypoint Code Builder.   
---  
## Before You Begin
  * Set up and access the web or desktop IDE.
  * Create a spec or fragment.


## Delete an API Spec from Anypoint Code Builder
To delete an API project (API spec or API spec fragment) from Anypoint Code Builder:
  1. In the Explorer view, right-click on the folder and select **File** > **Open Folder**.
  2. Locate the folder for the project to delete.
  3. Right-click and select to delete the folder.


## Delete an API Design Project
API design projects imported to Anypoint Code Builder from Design Center or created in Anypoint Code Builder before the February 2024 release automatically connect to MuleSoft VCS, which enables you to sync with a corresponding design project.
Design project names must be unique. To create a new design project with a name already used in Anypoint Code Builder, you must delete the existing project from the IDE.
To delete an API project (API spec or API spec fragment) from Anypoint Code Builder:
  1. In Anypoint Code Builder, delete the spec.


To delete a design project from Design Center:
  1. Navigate to Anypoint Platform and log in using your credentials.
Show me how
     * US cloud (non-EU host): Anypoint Platform (US)
     * EU cloud (EU host): Anypoint Platform (EU)
  2. Select **Design Center** from the navigation panel.
  3. Select **API Projects** from the navigation panel.
  4. Select the project and click the (**Delete Project**) icon.


To delete a design project by using Anypoint CLI:
  1. Run this command:


```
designcenter:project:delete [flags] <name>
```

For more information, see delete design projects using Anypoint CLI.
## See Also
  * Creating and Importing API Specifications
  * Creating and Using API Spec Fragments
  * About Design Center
MUnit Release Notes | MuleSoft Documentation
# MUnit Release Notes
The following release notes are provided for MUnit:
## MUnit 3.x
  * MUnit 3.5.0 Release Notes


## MUnit 2.x
  * MUnit 2.3.18 Release Notes


For previous versions of MUnit 1.x, 2.x, and 3.x that reached end of life, see the MUnit Release Notes Archive.   
---
Enabling and Disabling a Public Portal | MuleSoft Documentation
# Enabling and Disabling a Public Portal
All public portals in Exchange are enabled by default. You can sign in to your portal, view assets, and share new assets. Enabled portals do not require authorization to view asset details or download a specification. If you do not want the portal to be publicly shared, you can manually disable it. You must be an Exchange administrator to enable or disable a public portal.
The code examples for enabling and disabling a public portal show you how to obtain an access token with Multi-Factor Authentication (MFA) disabled.   
---  
To determine whether your public portal is enable or disable, use the following request:
```
curl "https://anypoint.mulesoft.com/exchange/api/v2/portals/YOUR_ORGANIZATION_DOMAIN/status"
```

## Enable a Public Portal
To start using your organization’s public portal and sharing assets publicly, you must enable the portal.
  1. Get an access token from an Anypoint Platform user account that has the Organization Administrator permission in the root organization:
```
ACCESS_TOKEN=$(curl https://anypoint.mulesoft.com/accounts/login -XPOST -d "username=YOUR_USERNAME&password=YOUR_PASSWORD" | jq -r ".access_token")
```

  2. Use the access token to change the status of your organization’s public portal to enabled status:
```
curl -X PUT https://anypoint.mulesoft.com/exchange/api/v2/portals/YOUR_ORGANIZATION_DOMAIN/status -d "enabled" -H "content-type: text/plain" -H "authorization: bearer $ACCESS_TOKEN"
```



## Disable a Public Portal
If you do not want to publicly share any information about your assets, disable your public portal.
**Note** : To disable your organization’s public portal, all the assets that are shared in the public portal must be set to private. See Remove an Asset from a Public Portal for instructions.
To view which assets are shared in the public portal, use the following request:
```
curl 'https://anypoint.mulesoft.com/exchange/api/v2/portals/YOUR_ORGANIZATION_DOMAIN/assets' | jq '.[] | [.groupId,.assetId]'
```

To disable a public portal:
  1. Ensure that all assets are private.
  2. Get an access token from an Anypoint Platform user account that has the Organization Administrator permission in the root organization:
```
ACCESS_TOKEN=$(curl https://anypoint.mulesoft.com/accounts/login -XPOST -d "username=YOUR_USERNAME&password=YOUR_PASSWORD" | jq -r ".access_token")
```

  3. Use the following access token to change the status of your organization’s public portal to enabled:
```
curl -X PUT https://anypoint.mulesoft.com/exchange/api/v2/portals/YOUR_ORGANIZATION_DOMAIN/status -d "disabled" -H "content-type: text/plain" -H "authorization: bearer $ACCESS_TOKEN"
```



## See Also
  * Customizing an Exchange Public Portal
currentMilliseconds | MuleSoft Documentation
# currentMilliseconds
## currentMilliseconds(): Number
Returns the current time in milliseconds.
### Example
This example shows the time in milliseconds when the function executed.
#### Source
```
%dw 2.0
import * from dw::util::Timer
output application/json
---
{ "currentMilliseconds" : currentMilliseconds() }
```

#### Output
```
{ "currentMilliseconds": 1532923168900 }
```
Upgrading and Migrating Amazon S3 Connector to Version 7.x | MuleSoft Documentation
# Upgrading and Migrating Amazon S3 Connector to Version 7.x
Upgrade Anypoint Connector for Amazon S3 (Amazon S3 Connector) to version 7.x.
## Supported Upgrade Paths
From Version | To Version  
---|---  
## Changes in This Release
  * The AWS SDK is now upgraded to version 2.28.28.


## Requirements
Ensure your system meets the following compatibility requirements before you perform the upgrade:
Application/Service | Version  
---|---  
4.3.0 and later  
AWS SDK for Java  
## Upgrade Prerequisites
Before you perform the upgrade, create a backup of your files, data, and configuration in case you need to restore to the previous version.
## Upgrade Steps
Follow these steps to perform the upgrade to version 7.x:
  1. In Anypoint Studio, create a Mule project.
  2. In the **Mule Palette** view, click **Search in Exchange**.
  3. In **Add Dependencies to Project** , enter `amazon s3` in the search field.
  4. In **Available modules** , select **Amazon S3** and click **Add**.
  5. Click **Finish**.
  6. Verify that the Amazon S3 dependency version is 7.x in the `pom.xml` file in the Mule project.


Studio upgrades the connector automatically.
## Post-Upgrade Steps
After you install the latest version of the connector, verify that your error handling is updated to work with the minor changes in error codes in this version of the connector.
## Verify the Upgrade
After you install the latest version of the connector, follow these steps to verify the upgrade:
  1. In Studio, verify that there are no errors in the **Problems** or **Console** views.
  2. Verify that there are no problems in the project `pom.xml` file.
  3. Test the connection to verify that the operations work.


## Revert the Upgrade
If it is necessary to revert to the previous version of Amazon S3, change the `mule-amazon-s3` dependency version in the project’s `pom.xml` file to the previous version.
You must update the project’s `pom.xml` file in Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Advanced Parameter Handling | MuleSoft Documentation
# Advanced Parameter Handling
Features in the SDK can improve the quality of your module by adding UI and UX tuning, enabling extension points so your module can interact with elements of other modules, and providing implementation enhancements to avoid boilerplate code.
## UI and UX Tuning
  *   * Customizing the Parameters UI
  * Customizing the Parameters DSL
  *   * 

## Extension Points and Modules Reuse
  * Importing Types From Other Modules
  * Using Generic Parameters For Extended Behavior
  * Stereotypes As A Way Of Referencing Elements By Kind


## Implementation Enhancers
  * Mule Services Injection