BassemE/mulesoft-documentation-embeddings huggingface dataset:
Pick Top Elements | MuleSoft Documentation
# Pick Top Elements
This DataWeave example sorts an array of candidates by the score they got in a test, then picks only the ones with the best score, as many as there are open positions to fill.
This example uses the following:
  * `map` to go through each of the candidates in the input.
  * `orderBy` to order the list of candidates according to their score.
  * `[n to n]` to select only a section of the full array of candidates. As the array in ordered in ascending order, the top candidates are at the end of the array, so you must use negative indexes. With the provided input, it selects from -3 to -1, -1 being the last index in the array.


DataWeave Script:
```
%dw 2.0
output application/json
---
{
  TopCandidateList: (payload.candidates map ((candidate) -> {
    firstName: candidate.name,
    rank: candidate.score
  }) orderBy $.rank) [ -payload.availablePositions to -1]
}
```

Input JSON Payload:
```
{
 "availablePositions": 3,
 "candidates":
  [
   {
    "name":"Gunther Govan",
    "score":99
   },
    {
    "name":"Michael Patrick",
    "score":35
   },
   {
    "name":"Amalia Silva",
    "score":96
   },
    {
    "name":"Tom Mathews",
    "score":40
   },
   {
    "name":"Simon Wilson",
    "score":84
   },
   {
    "name":"Janet Nguyen",
    "score":52
   }
  ]
}
```

Output JSON:
```
{
 "TopCandidateList": [
  {
   "firstName": "Simon Wilson",
   "rank": 84
  },
  {
   "firstName": "Amalia Silva",
   "rank": 96
  },
  {
   "firstName": "Gunther Govan",
   "rank": 99
  }
 ]
}
```

## Related Examples
  * Output Self-closing XML tags
  * Remove Specified XML Attributes


## See Also
  * DataWeave Selectors
  *
Prerequisites for MuleSoft Accelerator for Life Sciences | MuleSoft Documentation
# Prerequisites for MuleSoft Accelerator for Life Sciences
There are no setup or configuration guides specific to the MuleSoft Accelerator for Life Sciences. However, the use cases for this accelerator include a list of implementation templates, which contain details on the requirements for those applications. Refer to the MuleSoft Accelerator for Life Sciences use cases in Exchange for the list of assets.
## See Also
  *   * MuleSoft Accelerator for Life Sciences Overview
Unauthorized Endpoint Error | MuleSoft Documentation
# Unauthorized Endpoint Error
If calling a real endpoint from the console shows an **Unauthorized Endpoint** error:
  1. Open Salesforce setup.
  2. Open your community’s content security policy (CSP) trusted sites list.
  3. Ensure that the list includes the endpoint site domain.


The console works in the user’s browser and can call only trusted endpoint sites.
Environment Prerequisites | MuleSoft Documentation
# Environment Prerequisites
## Supported Environments
The following environments are the only environments supported by Anypoint Platform Private Cloud Edition (Anypoint Platform PCE):
  * VMWare bare metal virtualization
  * Physical servers
  * Amazon Web Services (AWS)


If you are using AWS, perform the steps provided in Provision AWS Prerequisites.
## See Also
  * Hardware Prerequisites
  * Software Prerequisites
  * Network Prerequisites
  * NFS Server Prerequisites
  * Preinstallation Verification
Access Management Overview | MuleSoft Documentation
# Access Management Overview
Access Management enables you to create your Anypoint Platform account and configure your user profile.
For organization owners and administrators, Access Management enables you to:
  * Invite users to your organization and manage their access.
  * Create business groups to contain your Anypoint Platform resources such as apps and APIs.
  * Create environments to manage app and API deployment.
  * Assign permissions to individual users or setup hierarchal user management by using the Teams feature to manage access to assets and areas of your organization.
  * Manage user identity and configure single sign-on (SSO) by using federated external identity providers (IdPs).
  * Protect your organization from unauthorized access by using multi-factor authentication.
  * Authorize client applications by configuring external client providers.
  * View user and connected app activity by using audit logs.
  * Develop and configure connected apps to delegate access to the platform.
  * Allow external organization access to facilitate collaboration with other Anypoint Platform organizations.


Access Management also provides a REST API for you to programmatically access the resources related to user and client management, organizations and business groups, and roles and permissions. To use this API, use the Access Management API Portal.
Depending on your control plane, some Access Management features may be unavailable to your organization. For example, account creation and user invitation from the platform is not available for Anypoint Platform Private Cloud Edition. Certain features are also unavailable for Mulesoft Government Cloud.
If you are an organization administrator and have questions about your account, contact your MuleSoft Account Team for help. Otherwise, contact your organization administrator.
Archetype Error When Creating Policies | MuleSoft Documentation
# Archetype Error When Creating Policies
If you attempt to run Archetype from a directory with existing files when you create a policy, you might encounter a “Directory already exists” error. The error might differ based on the Maven version installed in your environment.
The following code snippet shows an error generated for maven-archetype-plugin version 3.1.1:
```
mvn -Parchetype-repository archetype:generate \
[INFO] Parameter: basedir, Value: C:\Users\32481\AnypointStudio\studio-workspace\mycustompolicy
[INFO] Parameter: package, Value: mule-policy
[INFO] Parameter: groupId, Value: 6344d2e6-eff9-4020-b792-719c463d5b92
[INFO] Parameter: artifactId, Value: ClientIdCustomPolicy
[INFO] Parameter: packageName, Value: mule-policy
[INFO] Parameter: version, Value: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping mycustompolicy
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:14 min
[INFO] Finished at: 2019-07-03T14:07:26+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.1:generate (default-cli) on project mycustompolicy: Directory ClientIdCustomPolicy already exists - please run from a clean directory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException.
```

## Cause
This issue occurs because the directory in which Archetype is located already exists. The directory might have been created during a previous attempt to run Archetype.
## Solution
To resolve this issue, delete the existing Archetype directory and run the command again.
Setting the API URL | MuleSoft Documentation
# Setting the API URL
On the API version details page, you can configure the inbound endpoint of the API you plan to deploy. This action is required for Anypoint Platform to manage the API, either directly or by proxy. Defining a value in the RAML for the baseURI configures the Implementation URL of the API endpoint configuration Configure Endpoint.
  1. In API Manager, in API Administration, click an API version link.
  2. On the API version details page, click Configure Endpoint.
  3. Provide the actual inbound URL of the API, not a placeholder URL. If the API is deployed on-premises and you are using a load balancer, enter your load balancer endpoint here.
  4. Configure or accept other settings to set up and deploy an API proxy.
  5. Click Configure.
NetSuite Connector 11.0 | MuleSoft Documentation
# NetSuite Connector 11.0
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
Asset Types | MuleSoft Documentation
# Asset Types
The following asset types are supported in Exchange:
  * API Groups
A set of APIs bundled into a single asset.
  * API Spec Fragments
A part of an API specification that is reused to build a complete API specification.
  * AsyncAPI Specifications
An AsyncAPI specification file that specifies an event-driven API. Exchange supports AsyncAPI 2.0 and 2.6. AsyncAPI 2.6 supports specs with Avro schemas. The file type for AsyncAPIs with Avro schemas is AVSC.
  * Connectors
Packaged connectivity to an Anypoint Platform endpoint using third-party APIs and standard integration protocols.
Use connectors within your application’s flows to send and receive data using a protocol or specific API. Anypoint Studio comes with many bundled connectors, and Exchange has many more.
  * Custom
A description and an optional file to explain aspects of your system, to provide instructional videos, or to describe product or organizational documentation.
  * DataWeave Libraries
Packaged modules and mappings to share and reuse across applications.
  * Examples
Applications that are ready to run in Anypoint Studio and demonstrate a use case or solution.
  * GraphQL API
A schema definition that contains the object types and definitions that are used to interact with the API through the GraphQL specification. GraphQL enables you to query an API that supports this language in a much more flexible way than REST.
  * HTTP APIs
A placeholder for an endpoint for use by private Exchange users who want to manage the endpoint with API Manager.
Instead of requesting access to multiple APIs to satisfy a use case, a developer can access the group in one step.
  * Mule Applications
Applications that perform system integrations. These applications are published and consumed using APIs and don’t appear in the Exchange UI. Use the Exchange Maven Facade API or REST API to publish and manage Mule application assets.
For more information, see:
    * Exchange Platform APIs
    * Publish Assets Using the Exchange API
    * Publishing Assets Using Maven
  * Policies
Configuration modules to extend the functionality of an API and enforce capabilities such as security.
  * REST APIs
RAML or OAS files that specify APIs referenced by an HTTP Request connector to expose metadata to Anypoint Studio.
  * RPA Templates
    * RPA Activity Templates
Activity templates are reusable code within RPA to standardize the most used activity steps and make them available to other developers in the organization. File type is `.calw`.
    * RPA Process templates
Templates for RPA processes that can be imported into RPA Builder as projects and are customizable before deploying to RPA bots. Process templates are built on common patterns for RPA to build automation faster. File type is `.crpa`.
  * Ruleset
YAML files that describe a ruleset.
  * SOAP APIs
A WSDL file that specifies an API.
  * Templates
Packaged integration patterns built on best practices to address common use cases.
Complete the template’s use case or solution by supplying your own information, customizing, or extending the templates as needed.


## See Also
  *
Editing Names of Schema Elements | MuleSoft Documentation
# Editing Names of Schema Elements
When you add APIs to the unified schema, can rename fields, types, and query methods so they’re more useful to those consuming the unified schema, or so you can resolve conflicts between elements.
If you attempt to rename a type in an API that is merged with a type in the unified schema, you will undo the merge. Likewise, modifying the name of a field that you’ve configured as a primary key will break the link or merge associated with that primary key. When renaming fields or query methods, ensure that you are not breaking existing collaborations on those elements.
Before editing the name of an element, be sure to make it visible.
To edit the name of a schema element:
  1. Navigate to object type, field, or method, and click **Rename**.
  2. In the **Change to:** field, add the new name, and click **Confirm**.
  3. If you want to reset to the element to its default, click **Rename** again, and then click **Reset name to default**.
WebSockets Managing Groups | MuleSoft Documentation
# WebSockets Managing Groups
The WebSockets Connector uses socket groups, which are String identifiers that WebSockets clients can optionally subscribe to. This is useful for what we call message segregation, which enables your app to broadcast a single message to a group of different WebSockets clients.
Examples of how to leverage groups can be found in the documentation of the broadcast operation.
Both the `<websocket:inbound-listener>` trigger and the `<websocket:open-outbound-socket>` operation allow to specify default groups. That is groups that every new inbound and outbound sockets will be automatically subscribed to.
There are also use cases that require manually subscribing or unsubscribing a socket from a group. For example, imagine the use case of a multi-tenant application in which an inbound WebSocket is established. The initiator HTTP request includes an authentication header called `clientId`. We call a flow called `fetch-client-details` which validates a client ID and sets a variable called `orgId` that identifies the organization the client belongs to. The socket is added to a group that identifies its organization.
Group subscription is dynamic because the group to be subscribed to (the organization ID) can only be determined at runtime.
An example of a flow:
```
<flow name="onIncomingMessageFlow">
  <websocket:inbound-listener path="/feed" config-ref="ws" />
  <!-- Store relevant information in variables -->
  <set-variable variableName="socketId" value="#[attributes.socketId]" />
  <set-variable variableName="authHeader" value="#[attributes.headers.clientId]" />
  <!-- Validate the auth Header -->
  <flow-ref name="fetch-client-details" />
  <!-- Perform group subscription -->
  <websocket:subscribe-groups
   socketId="#[vars.socketId]"
   groups="#[[vars.orgId]]"
   config-ref="ws" />
</flow>
```

The flip side of this use case is that you also need to dynamically unsubscribe from a group, which can be achieved with the `<websocket:unsubscribe-groups>` operation:
```
<websocket:unsubscribe-groups
 socketId="#[vars.socketId]"
 groups="#[[vars.orgId]]"
 config-ref="ws" />
```

## See Also
  * MuleSoft Help Center
  * WebSockets Connector Overview
  * Connector Configuration
  *
SAP S/4HANA OData Connector 2.5 | MuleSoft Documentation
# SAP S/4HANA OData Connector 2.5
Anypoint Connector for SAP S/4HANA OData (SAP S/4HANA OData Connector) provides support for the OData APIs exposed by SAP S/4HANA Cloud and SAP S/4HANA on-premise.
The connector enables you to perform operations to:
  * Create, get, update, and delete entities
  * Retrieve a single entity
  * Query multiple entities
  * Invoke a remote function
  * Execute batch requests that consist of multiple requests


For software requirements and compatibility information, see the SAP S4/HANA Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The SAP S/4HANA OData API
  * Anypoint Connectors
  * Mule runtime (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 SAP S/4HANA OData target resource
  * Anypoint Platform
  * Anypoint Studio 7.3 or later
  * Have a developer account or other valid SAP S/4HANA instance
  * Access to the catalog service that allows you to use the service discovery
  * A communication user that is assigned to the corresponding communication arrangements for the desired APIs


## Common Use Case for the Connector
Perform CRUD operations on entity types of SAP S/4HANA’s OData API and process the response.
## 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 OData Connector Release Notes
  * SAP S/4HANA OData Connector on Exchange
  * MuleSoft Help Center
Get a SOAP Header | MuleSoft Documentation
# Get a SOAP Header
In SoapUI, the request window shows the soap envelope header. To retrieve a SOAP header from the request:
  1. In SoapUI, modify the `OrderTshirt` request by entering a value for the API key.
For example, enter `987654321` between the `<apiKey>` tags.
  2. In Studio, in the `OrderTshirt:\soapkit-config` flow, select **Transform Message**.
  3. Edit the DataWeave code to get the API key, which is a header property:
```
%dw 2.0
output application/java
ns ns0 http://mulesoft.org/tshirt-service
---
{
   body : {
     ns0#OrderTshirtResponse: {
      orderId: "I got a request from "
      ++ payload.body.ns0#OrderTshirt.name
      ++ " using the following auth header "
      ++ (payload.headers["AuthenticationHeader"].ns0#AuthenticationHeader.apiKey default "")
    }
  } write "application/xml"
}
```

  4. Save and run the project again.
  5. In SoapUI, send a request to the `OrderTshirt` endpoint. + The following response appears:
```
  <soap:Body>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <ns0:OrderTshirtResponse xmlns:ns0="http://mulesoft.org/tshirt-service">
     <orderId>I got a request from John, using the following auth header 987654321</orderId>
   </ns0:OrderTshirtResponse>
  </soap:Body>
</soap:Envelope>
```



## See Also
  *
SOAP Schema Validation Policy | MuleSoft Documentation
# SOAP Schema Validation Policy
**Policy Name** | SOAP Schema Validation  
---|---  
Validates incoming traffic against a specified WSDL schema  
Security  
**First Flex Gateway version available**  
**Returned Status Codes** | The policy returns a `400` for a client error or `500` for a server error. Error messages are defined by SOAP standard responses.  
## Summary
The Schema Validation policy only supports SOAP 1.1 and 1.2 APIs.   
---  
Use the SOAP Schema Validation policy to block incoming requests that don’t conform to the the defined WSDL schema. This policy prevents malformed or malicious SOAP messages from reaching the backend and enforces contract compliance between clients and services.
## 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: soap-validation
 config:
  wsdlUrl: <string> // REQUIRED
  encoding: <string> // REQUIRED, default 'UTF-8'
  serviceName: <string> // REQUIRED
  servicePort: <string> // REQUIRED
```

Determines if the schema is specified in this YAML resource, or if it’s specified in the API Context from Exchange (Connected Mode only). Supported values: `inline` or `context`. You must specify `inline` when configuring the policy in Local Mode.
Parameter | Required | Default Value | Description  
---|---|---|---  
URL of where to access the WSDL  
Encoding of the WSDL  
SOAP service name defined in the WSDL that validates requests  
SOAP port name defined in the WSDL that validates requests  
#### Resource Configuration Example
```
- policyRef:
  name: soap-validation
 config:
  wsdlUrl:
  encoding: UTF-8
  serviceName:
  servicePort:
```

### 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:
Field | Description  
---|---  
Service Name |  SOAP service name defined in the WSDL that validates requests  
Service Port |  SOAP port name defined in the WSDL that validates requests  
## See Also
  * XML Threat Protection Policy
Select XML Elements | MuleSoft Documentation
# Select XML Elements
DataWeave provides a number of selectors for traversing the structure of input data and returning matching values. The following examples use a single-value DataWeave selector (`.`) to extract data from XML elements.
The XML markup language requires a single root element. In the following example, the selector on the root (`language`) is able to extract the child element because the child has no siblings.
DataWeave Script:
```
%dw 2.0
output application/xml
---
payload.language
```

Input XML Payload:
```
<language>
  <name>DataWeave</name>
</language>
```

Output XML:
```
<?xml version='1.0' encoding='UTF-8'?>
<name>DataWeave</name>
```

To return all subelements of the root element in a valid XML structure with a single root, the following script uses a DataWeave key to specify a new element name (`myroot`) and selects the root (`root`) to return its value. A script that fails to return a single XML root produces the following error: `Trying to output non-whitespace characters outside main element tree (in prolog or epilog)…​`.
DataWeave Script:
```
%dw 2.0
output application/xml
---
{ myroot: payload.root }
```

Input XML Payload:
```
<root>
  <element>
    <subelement1>SE1</subelement1>
  </element>
  <element>E2</element>
</root>
```

Output XML:
```
<?xml version='1.0' encoding='UTF-8'?>
<myroot>
 <element>
  <subelement1>SE1</subelement1>
 </element>
 <element>E2</element>
</myroot>
```

The following example uses the name of the child element (`name`) with the single-value selector to select its value. Notice how `payload.language.name` navigates to the child element. The script also provides a root element for the value so that DataWeave can construct valid XML.
DataWeave Script:
```
%dw 2.0
output application/xml
---
{ newname : payload.language.name }
```

Input XML Payload:
```
<language>
  <name>DataWeave</name>
  <version>2.0</version>
</language>
```

Output XML:
```
<?xml version='1.0' encoding='UTF-8'?>
<newname>DataWeave</newname>
```

The following example uses an index to return the value of the second child element from the input XML. Notice that DataWeave treats child elements as indices of an array, so it can select the second child by using the index `language[1]`. The result is a single XML element.
DataWeave Script:
```
%dw 2.0
output application/xml
---
{ version : payload.language[1] }
```

Input XML Payload:
```
<language>
  <name>DataWeave</name>
  <version>2.0</version>
</language>
```

Output XML:
```
<?xml version='1.0' encoding='UTF-8'?>
<version>2.0</version>
```

If multiple child elements of the input have the same name, use the index to select the value of the child. The following example selects a subelement of a child element.
DataWeave Script:
```
%dw 2.0
output application/xml
---
{ mysubelement : payload.root[0].subelement1 }
```

Input XML Payload:
```
<root>
  <element>
    <subelement1>SE1</subelement1>
  </element>
  <element>E2</element>
</root>
```

Output XML:
```
<?xml version='1.0' encoding='UTF-8'?>
<mysubelement>SE1</mysubelement>
```
MCP Connector 1.1 XML and Maven Support | MuleSoft Documentation
# MCP Connector 1.1 XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Code Builder or Studio:
  * If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Code Builder or 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 Anypoint Code Builder or Studio, the XML is automatically populated the 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/mcp
http://www.mulesoft.org/schema/mule/mcp/current/mule-mcp.xsd
```

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

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector:
```
<dependency>
 <groupId>com.mulesoft.connectors</groupId>
 <artifactId>mule-mcp-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 `mcp`.
  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
APIkit for OData v2 Module Reference | MuleSoft Documentation
# APIkit for OData v2 Module Reference
Learn the fundamentals about dependency, namespace, and schema information in APIkit for OData v2 to collaborate, build applications, and maintain codebases.
## Dependency Information
Declare the APIkit for OData v2 extension with the APIkit for REST module dependency:
```
<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-module-apikit-odata</artifactId>
  <version>2.2.0</version> **(1)**
  <classifier>mule-plugin</classifier>
</dependency>
<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-apikit-module</artifactId>
  <version>1.8.3</version> **(1)**
  <classifier>mule-plugin</classifier>
</dependency>
```

The tooling determines the appropriate version of each dependency when scaffolding to guarantee compatibility. Manually setting dependency versions can produce issues. See the APIkit release notes before upgrading each component to the latest version.  
---  
Update the Anypoint Studio plugin to enable the tooling to determine the appropriate dependency combination.   
---  
## Namespace and Schema
```
xmlns:apikit="http://www.mulesoft.org/schema/mule/mule-apikit"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/mule-apikit http://www.mulesoft.org/schema/mule/mule-apikit/current/mule-apikit.xsd"
```

## See Also
  * APIkit for REST Module Reference
Redis Connector 5.3 | MuleSoft Documentation
# Redis Connector 5.3
Anypoint Connector for Remote Dictionary Server (Redis Connector) is an open source, in-memory data structure store used to cache user profiles, create leader boards, track real-time activities on a website, and filter spam. You can use Redis Connector as a message queue, custom object store, and more.
## Before You Begin
To use this connector, you must be familiar with:
  * The Redis API
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements in a Mule flow
  * Global elements
  * How to create a Mule app using Anypoint Studio


Before creating an app, you must have access to the Redis target resource.
## Audience
  * New users, read:
    * Using Anypoint Studio to Configure Redis Connector
    * Examples, which provides use cases for the connector
  * Advanced users, read:
    * XML and Maven Support
    * Examples topics


## Next Step
After you complete the prerequisites and experiment with examples, you are ready to create an app and configure the connector using Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Redis in Anypoint Exchange
  * Redis in EU Anypoint Exchange
  * MuleSoft Help Center
rightPad | MuleSoft Documentation
# rightPad
## rightPad(text: String, size: Number, padChar: String = " "): String
The specified `text` is _right_ -padded to the `size` using the `padText`. By default `padText` is `" "`.
Returns right padded `String` or original `String` if no padding is necessary.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
The size to pad to.  
The text to pad with. It defaults to one space if not specified.  
### Example
This example shows how `rightPad` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
 "a": rightPad(null, 3),
 "b": rightPad("", 3),
 "c": rightPad("bat", 5),
 "d": rightPad("bat", 3),
 "e": rightPad("bat", -1)
}
```

#### Output
```
{
 "a": null,
 "b": "  ",
 "c": "bat ",
 "d": "bat",
 "e": "bat"
}
```

## rightPad(text: Null, size: Any, padText: Any = " "): Null
Helper function that enables `rightPad` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._
Performance Tuning Guide | MuleSoft Documentation
# Performance Tuning Guide
To achieve optimal performance from your Mule applications, you must evaluate both the applications themselves and the environment in which they run. Although Mule 4 is designed to tune itself, your applications might exhibit performance issues due to their initial construction or dependencies.
Similarly, for on-premises installations, you might need to tune the environment itself so that your Mule applications can take full advantage of it. Because many variables influence it, tuning the performance of your application requires some trial and error.
You can simplify performance tuning by using documented best practices and testing your applications in ideal test environments. The following recommendations come from the Development and Services Engineering teams and benchmarking efforts by MuleSoft Performance Engineering.
## Performance Tuning Summary
Optimizing the performance of your Mule apps requires the following actions:
  * Applying tuning recommendations at the application level See Performance Tuning Recommendations for details.
  * Considering tuning prerequisites and best practices before testing See Performance Test Validations for details.
  * Monitoring performance during testing to determine the resources required by the Mule runtime engine (Mule) See Performance Monitoring for details.
DocuSign Connector 1.0 | MuleSoft Documentation
# DocuSign Connector 1.0
Anypoint Connector for DocuSign (DocuSign Connector) enables you to access the DocuSign platform and exposes operations provided by the DocuSign eSignature API v2.1.
For compatibility information and fixed issues, see the DocuSign Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The DocuSign API
  * Anypoint Connectors
  * Mule runtime (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 DocuSign target resource
  * Anypoint Platform
  * Anypoint Studio 7.3 or later


## Authentication Types
DocuSign Connector connections use the following authentication methods:
  * Authorization Connection Provider (Implicit Grant)
  * OAuth Connection Provider (Authorization Code Grant)


## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  *   * MuleSoft Help Center
MuleSoft Accelerator for Manufacturing | MuleSoft Documentation
# MuleSoft Accelerator for Manufacturing
MuleSoft Accelerator for Manufacturing equips discrete and process manufacturers with foundational assets for common use cases to accelerate their digital transformation journey. Our pre-built APIs, implementation templates, reference architecture, and connectors allow IT teams to spend more time innovating, and less time building common integrations from scratch.
## Use Cases
The following use cases are supported by the MuleSoft Accelerator for Manufacturing:
  * Account and product and order sync — Streamline account forecasts by connecting critical account, product, and order data from your ERP to CRM. This example will show how to accomplish this using SAP S/4HANA and Salesforce Manufacturing Cloud.
  * Sales rebate management — This solution seamlessly syncs customer and sales order data between SAP and Salesforce Manufacturing Cloud, and creates a credit memo in SAP in line with program guidelines and calculations.
  * Total productive maintenance - This solution seamlessly aggregates factory floor equipment data, like temperature and vibration, into a data visualization tool. This data visualization tool can model the data, and a business user can pre-define business criteria to trigger equipment maintenance work orders in a servicing case management system.


### Shared Use Cases
The following use cases provided by the MuleSoft Accelerator for SAP are also leveraged by this accelerator:
  * Procure-to-pay - Streamline your procure-to-pay process with pre-built APIs, implementation templates, and connectors to seamlessly move supplier, invoice, and goods receipt data.
  * Quote-to-cash: Salesforce and SAP S/4HANA - Sync order, inventory, and customer data from opportunity to close between Salesforce Sales Cloud (including CPQ) and SAP S/4HANA.
  * Quote-to-cash: B2B EDI - Enable the sales order/purchase order and post-purchase order transaction flows between businesses, with one business serving as the buyer and the other as the supplier.
  * Real-time and bulk data lakes integration - Send sales order, inventory, and customer information from source systems to common data lake storage repositories.


## See Also
  *   *   *   * MuleSoft Accelerator for Manufacturing on Exchange
Managing Mule Apps Deployed to Runtime Fabric | MuleSoft Documentation
# Managing Mule Apps Deployed to Runtime Fabric
To manage Mule apps deployed to Anypoint Runtime Fabric, review the following topics:
  * Monitoring Mule Apps Deployed to Runtime Fabric Use Anypoint Monitoring to view metrics and logs of Mule apps deployed to Runtime Fabric. Additionally, you can export telemetry externally by using a Log4j appender to integrate your logging system to Mule apps deployed to Runtime Fabric.
  * Managing Mule Apps Deployed to Runtime Fabric Using RTFCTL Use the `rtfctl delete`, `describe`, `disk`, `memory`, `package`, `restart`, `heapdump`,and `threaddump` commands to manage Mule apps deployed to Runtime Fabric.
  * Sending Application-to-Application Requests Send a request from one Mule app to another app inside the cluster by using the Mule app name and environment ID.
  * Reviewing Mule App Versioning Review deployed Mule app versioning to understand configuration changes history, roll back configurations, view Mule app statuses, and make updates to a deployed Mule app’s configuration.
  * Managing Mule App Schedules Use Runtime Manager to view and control the Scheduler components within the flows in your deployed Mule apps.
  * Managing Mule Runtime Patch Updates Review the Mule runtime engine patch updates and the Mule release channels for Runtime Fabric.


## See Also
  * Deploying Mule Apps to Runtime Fabric
  * Hardening Mule Apps Deployed to Runtime Fabric
Measurement Points | MuleSoft Documentation
# Measurement Points
Measurement Points are currently not supported by RPA Manager. This means that it is currently not possible to evaluate the data on the server. You can still use the Measurement Points in RPA Builder because they are still displayed in the _Workflow Run Results_.
  * Checkpoints are integrated into a Workflow in order to ascertain which part of the Workflow was reached before an error occurred.
  * The Checkpoint Collection action step enables you to collect all timer values from the Checkpoint action steps configured in an Activity Workflow.
  * General timers are used to measure whole Transactions. Use the _General Timer Start_ action step to start the timer.
  * General timers are used to measure whole Transactions. Use the _General Timer Stop_ action step to stop the timer.
  * The Stopwatch is basically a combined Start/Stop Timer with a clear graphical representation.
  * The Stopwatch Collection action step enables you to collect all timer values from the Stopwatch action steps configure in an Activity Workflow.
Output a Transformation to an Attribute or Variable (Design Center) | MuleSoft Documentation
# Output a Transformation to an Attribute or Variable (Design Center)
By default, the Transform component outputs to the payload of a Mule event. You can also output data to a variable or attribute that you create.
Before you begin, you should set up a basic flow that sends the Transform component Input data.
  1. From the Mapping tab in the Transform component, click the title of the Output column, which should say Output Payload by default.
  2. Select Add Transformation.
  3. Select one of these types:
     * Attributes
     * Variable
  4. For a variable, provide a name.
  5. Create or select a data type for the attribute or variable.
  6. Map the portion of the Transformer input that you want to output to the attribute or variable.
Note that you can check your mapping by adding a Logger after the Transformer, for example:
     * Logger message for an attribute: `message.attributes`
     * Logger message for the variable `myVar`: `vars.myVar`
After deploying your app, the Logs should output your logger message.


## Remove an Output Transformation
  1. Click the title of the Output column.
  2. Click the Trash Can icon for the transformation that you want to delete.


## See Also
Mule Message Structure
DataWeave Language
Salesforce Composite Connector 2.19 | MuleSoft Documentation
# Salesforce Composite Connector 2.19
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
Microsoft Excel Online Connector 1.1 XML and Maven Support | MuleSoft Documentation
# Microsoft Excel Online 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/microsoft-excel-online
http://www.mulesoft.org/schema/mule/microsoft-excel-online/current/mule-excel-online.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:excel="http://www.mulesoft.org/schema/mule/excel"
	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/excel
  http://www.mulesoft.org/schema/mule/excel/current/mule-excel.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-microsoft-excel-online-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 `excel`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
filterTree | MuleSoft Documentation
# filterTree
## filterTree(value: Any, criteria: (value: Any, path: Path) -> Boolean): Any
Filters the value or path of nodes in an input based on a specified `criteria`.
The function iterates through the nodes in the input. The `criteria` can apply to the value or path in the input. If the `criteria` evaluates to `true`, the node remains in the output. If `false`, the function filters out the node.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The value to filter.  
The expression that determines whether to filter the node.  
### Example
This example shows how `filterTree` behaves with different inputs. The output is `application/dw` for demonstration purposes.
#### Source
```
%dw 2.0
import * from dw::util::Tree
output application/dw
---
{
  a: {
     name : "",
     lastName @(foo: ""): "Achaval",
     friends @(id: 123): [{id: "", test: true}, {age: 123}, ""]
    } filterTree ((value, path) ->
      value match {
              case s is String -> !isEmpty(s)
              else -> true
             }
  ),
  b: null filterTree ((value, path) -> value is String),
  c: [
      {name: "Mariano", friends: []},
      {test: [1,2,3]},
      {dw: ""}
    ] filterTree ((value, path) ->
      value match {
              case a is Array -> !isEmpty(a as Array)
              else -> true
            })
}
```

#### Output
```
{
 a: {
  lastName: "Achaval",
  friends @(id: 123): [
   {
    test: true
   },
   {
    age: 123
   }
  ]
 },
 b: null,
 c: [
  {
   name: "Mariano"
  },
  {
   test: [
    1,
    2,
    3
   ]
  },
  {
   dw: ""
  }
 ]
}
```