BassemE/mulesoft-documentation-embeddings huggingface dataset:
Global Elements | MuleSoft Documentation
# Global Elements
A global element is a reusable object containing parameters that any number of elements in a flow can share. You reference a global element from Anypoint Connectors or components in your Mule application.
Use the global element to apply configuration details to multiple local elements in flows. Create one global element that defines parameters and configuration details, and then reference the global element from any flow element that uses this configuration. This practice enables you to ensure consistency across flow elements.
Note that some components require their properties stored in a global element.
## Benefits
Global elements provide many benefits to you as a Mule application developer: reusability, efficiency, and flexibility.
  * Reusability
You can configure a global element once and then share that configuration among processors of the same type. Configuring global elements is particularly useful when you have to define the connection details and login credentials for an external source, such as a SaaS application or database.
  * Efficiency
You don’t have to change the same configuration multiple times for different processors in the flow if they all share a global element. For example, if you have multiple connectors that connect to the same service using one set of credentials, you can change the configuration in the global element and the changes apply to all flow elements that reference the global element.
  * Flexibility
An element in a flow can apply a global element’s configuration exactly as defined, or it can apply modifications to the global configuration properties.


## Before You Start
Review the features of the Anypoint Studio visual editor to learn more about developing Mule applications using the Anypoint Studio graphical user interface and to understand the context in which you use global elements.
## Create a Global Element
You can create global elements in two ways:
  * From the **Global Elements** tab in the Anypoint Studio canvas
  * From the properties panel of any connector or module that supports global elements


### From the Anypoint Studio Canvas
  1. In the Anypoint Studio visual editor, click the **Global Elements** tab to access a list of all global elements in an application:
  2. Click **Create** to add a new global element.
  3. In the **Choose Global Type** wizard, navigate the directories or use the filter to select the type of global element you want to create, and then click **OK**.
  4. Define the configurable parameters of your global element in the **Global Element Properties** window.
  5. Click **OK** to save.


### From the Properties Panel of a Connector or Module
To create a new global element from within a local component you placed in your flow:
  1. Click the component you want to create a global element for:
  2. In the properties panel, click the Add icon next to the **Connector Configuration** :
  3. Complete the required fields for the type of global element you want to create.


## See Also
  * Global Configurations
Google Pub/Sub Connector 1.0 XML and Maven Support | MuleSoft Documentation
# Google Pub/Sub Connector 1.0 XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio:
  * If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can 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/google-pubsub
http://www.mulesoft.org/schema/mule/google-pubsub/current/mule-google-pubsub.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:google-pubsub="http://www.mulesoft.org/schema/mule/google-pubsub"
	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/google-pubsub
  http://www.mulesoft.org/schema/mule/google-pubsub/current/mule-google-pubsub.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-google-pubsub-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 `google-pubsub`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Configuring Basic Security Filter for HTTP Connector | MuleSoft Documentation
# Configuring Basic Security Filter for HTTP Connector
Consider a Mule app that exposes an API for accessing sensitive customer information, such as personal details and order history. To secure this API, you want to implement basic security using a username and password combination. The Anypoint Platform for HTTP (HTTP Connector) **Basic Security Filter** operation enables you to enforce basic authentication.
The following example illustrates how to configure the **Basic Security Filter** operation to ensure that only authorized users can access the protected API.
  1. In Anypoint Studio, add an **HTTP Listener** source to your flow. This serves as the entry point for incoming API requests.
  2. Drag the **Basic Security Filter** operation after the **HTTP Listener**. The operation validates the username and password provided in the request headers.
  3. Select the **Basic Security Filter** operation from your flow.
  4. Configure the **Basic Security Filter** operation with the authentication **Realm** and **Security providers**.
  5. Continue building your Mule flow by adding the logic for handling API requests, retrieving customer information, or performing other operations.


In the **Configuration XML** , the configuration looks like this:
```
 <http:listener-config name="HTTP_Listener_config" >
		<http:listener-connection host="0.0.0.0" port="8081" />
	</http:listener-config>
	<flow name="testFlow1">
		<http:listener config-ref="HTTP_Listener_config" path="/test"/>
		<http:basic-security-filter realm="MuleRealm">
			<http:security-providers >
				<http:security-provider value="test" />
			</http:security-providers>
		</http:basic-security-filter>
    <!-- Add your API logic here -->
  </flow>
```

## See Also
  * HTTP Connector Examples
  * HTTP Connector Reference
scan | MuleSoft Documentation
# scan
## scan(text: String, matcher: Regex): Array<Array<String>>
Returns an array with all of the matches found in an input string.
Each match is returned as an array that contains the complete match followed by any capture groups in your regular expression (if present).
### Parameters
Name | Description  
---|---  
The input string to scan.  
A Java regular expression that describes the pattern match in the `text`.  
### Example
In this example, the `regex` describes a URL. It contains three capture groups within the parentheses, the characters before and after the period (`.`). It produces an array of matches to the input URL and the capture groups. It uses `flatten` to change the output from an array of arrays into a simple array. Note that a `regex` is specified within forward slashes (`//`).
#### Source
```
%dw 2.0
output application/json
---
flatten("www.mulesoft.com" scan(/([w]*)\.([a-z]*)\.([a-z]*)/))
```

#### Output
```
[ "www.mulesoft.com", "www", "mulesoft", "com" ]
```

### Example
In the example, the `regex` describes an email address. It contains two capture groups, the characters before and after the `@`. It produces an array matches to the email addresses and capture groups in the input string.
#### Source
```
%dw 2.0
output application/json
---
"anypt@mulesoft.com,max@mulesoft.com" scan(/([a-z]*)@([a-z]*).com/)
```

#### Output
```
[
 [ "anypt@mulesoft.com", "anypt", "mulesoft" ],
 [ "max@mulesoft.com", "max", "mulesoft" ]
]
```

## scan(text: Null, matcher: Any): Null
Helper function that enables `scan` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Step 6: Test the Automation | MuleSoft Documentation
# Step 6: Test the Automation
You finished the build phase and the automation project is ready to move to the testing phase, where you create a test plan to execute the necessary tests on your automation project. You can create multiple configurations to test your process using different activity parameters and to test for the completion of user tasks.
For this tutorial, create a simple test that confirms the proper deployment and execution of the automated process.
## Step 6.1: Create a Test Plan
To create a test plan, open RPA Manager and follow these steps:
  1. In RPA Manager, go to **My RPA** > **My Processes**.
  2. Click the **MuleSoft newsletter sign-up** project.
  3. Click **Publish(Test)**.
  4. Click the confirmation checkbox and then click **Release to Test**.
  5. Inside **Test plans** , click the **Create new test plan** button.
  6. In the **Test plan name** field, write **My Test** and click **Next**.
  7. Click **Next** (this process has no activity parameters).
  8. Click **Next** (this process has no user tasks).
  9. Select **Run test in Secure Session** , check **Enable Taskbar (Start menu, taskbar buttons)** , and click **Next**.
Ensure you followed the steps to configure the Secure Session. Otherwise, the bot fails to run.
  10. Select any of your configured bots and click **Finish**


## Step 6.2: Run the Test, Examine the Results, and Publish to Production
To run the test plan and see the results, follow these steps:
  1. In the **Test plans** panel, click **Start tests**.
  2. In the **Select Configuration to deploy** window, select your test plan and click **Execute**.
  3. In the **Test Results** panel, click **Update**.
If there are no results, wait a few minutes for the test to end and click **Update** again.
  4. Verify that there is a new entry for the bot showing **1** in the **Success** column.
  5. After the test finishes, click **Publish (Production)**.
  6. Click the confirmation checkbox and then click **Release to Production**.


## Next Steps
You created a test plan that executes the automation to ensure that the process runs successfully. Then, you finished testing the process and released it to the production phase. Now, it is time to publish the process to Anypoint Exchange by creating an invocable run configuration for this process.
Continue with Step 7: Publish the Automation to Exchange
## See Also
  *   *
atBeginningOfYear | MuleSoft Documentation
# atBeginningOfYear
## atBeginningOfYear(dateTime: DateTime): DateTime
Takes a `DateTime` value as input and returns a `DateTime` value for the first day of the _year_ specified in the input. It also sets the `Time` value to `00:00:00`.
The month, day, and time in the input changes to `01-01T00:00:00`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The `DateTime` value to reference.  
### Example
This example transforms the `DateTime` input (`|2020-10-06T18:23:20.351-03:00|`) to the date of the first day of the `Year` value (`2020`) in the input.
#### Source
```
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
 atBeginningOfYearDateTime: atBeginningOfYear(|2020-10-06T18:23:20.351-03:00|)
}
```

#### Output
```
{
 "atBeginningOfYearDateTime": "2020-01-01T00:00:00.000-03:00"
}
```

## atBeginningOfYear(localDateTime: LocalDateTime): LocalDateTime
Takes a `LocalDateTime` value as input and returns a `LocalDateTime` value for the first day of the _year_ specified in the input. It also sets the `Time` value to `00:00:00`.
The month, day, and time in the input changes to `01-01T00:00:00`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
`localDateTime` |  The `LocalDateTime` value to reference.  
### Example
This example transforms the `LocalDateTime` input (`|2020-10-06T18:23:20.351|`) to the date of the first day of the `Year` value (`2020`) in the input.
#### Source
```
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
 atBeginningOfYearLocalDateTime: atBeginningOfYear(|2020-10-06T18:23:20.351|)
}
```

#### Output
```
{
 "atBeginningOfYearLocalDateTime": "2020-01-01T00:00:00"
}
```

## atBeginningOfYear(date: Date): Date
Takes a `Date` value as input and returns a `Date` value for the first day of the _year_ specified in the input.
The month and day in the input changes to `01-01`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The `Date` value to reference.  
### Example
This example transforms `Date` input (`|2020-10-06|`) to the date of the first day of the `Year` value (`2020`) in the input.
#### Source
```
%dw 2.0
import * from dw::core::Dates
output application/json
---
{
 atBeginningOfYearDate: atBeginningOfYear(|2020-10-06|)
}
```

#### Output
```
{
 "atBeginningOfYearDate": "2020-01-01"
}
```
Amazon Redshift Connector 1.1 XML and Maven Support | MuleSoft Documentation
# Amazon Redshift 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/redshift
http://www.mulesoft.org/schema/mule/redshift/current/mule-redshift.xsd
```

This example shows how the namespace and schema statements are placed in the XML:
```
<mule xmlns:redshift="http://www.mulesoft.org/schema/mule/redshift"
  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/redshift http://www.mulesoft.org/schema/mule/redshift/current/mule-redshift.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-amazon-redshift-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 `amazon redshift`.
  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 example.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Amazon Lambda Connector 1.1 - XML and Maven Support | MuleSoft Documentation
# Amazon Lambda 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/amazon-lambda
http://www.mulesoft.org/schema/mule/amazon-lambda/current/mule-amazon-lambda.xsd
```

This example shows how the namespace statements are placed in the XML:
```
<mule xmlns:amazon-lambda="http://www.mulesoft.org/schema/mule/amazon-lambda"
	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/amazon-lambda
	http://www.mulesoft.org/schema/mule/amazon-lambda/current/mule-amazon-lambda.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-amazon-lambda-connector</artifactId>
 <version>1.1.0</version>
 <classifier>mule-plugin</classifier>
</dependency>
```

Replace the value for `<version>` with the version that corresponds to the connector you are using.
To obtain the most up-to-date `pom.xml` file information:
  1. Go to Anypoint Exchange.
  2. In Exchange, click **Login** and supply your Anypoint Platform username and password.
  3. In Exchange, search for `amazon lambda`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Release Notes | MuleSoft Documentation
# Release Notes
  *   *   * Anypoint Code Builder
  *   *   *   *   * API Functional Monitoring
  *   *   *   *   *   *   *   *   * Flex Gateway Policy Development Kit (PDK)
  *   *   *   *   *   *   * OpenAPI Specification 3.0 Support
  *   *   *   *
Amazon SNS 4.7 XML and Maven Support | MuleSoft Documentation
# Amazon SNS 4.7 XML and Maven Support
If you manually code a Mule application in XML (either from the Studio XML editor or a text editor), you must perform the following actions to access the connector:
  1. Add the namespace for the connector to your XML flow.
  2. Add dependency information to your Apache Maven `pom.xml` file.


In the Studio visual editor, when you drag a connector from the palette to the canvas, Studio automatically populates the XML code with the connector namespace and schema location.
## 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/sns
http://www.mulesoft.org/schema/mule/sns/current/mule-sns.xsd
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<?xml version="1.0"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
  xmlns:sns="http://www.mulesoft.org/schema/mule/sns"
  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/sns
  http://www.mulesoft.org/schema/mule/sns/current/mule-sns.xsd
  http://www.mulesoft.org/schema/mule/http
  http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<!-- Put your flows and configuration elements here -->
</mule>
```

## Add a POM File Dependency
The 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>mule-amazon-sns-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, access the connector in Anypoint Exchange and click **Dependency Snippets**.
## Next Step
After completing your namespace and `pom.xml` file, you can try out Examples.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
toString | MuleSoft Documentation
# toString
## toString(mimeType: MimeType): String
Transforms a `MimeType` value to a string representation.
_Introduced in DataWeave version 2.7.0._
### Parameters
Name | Type | Description  
---|---|---  
The MIME type value to transform to a `String`.  
### Example
This example transforms a `MimeType` value without `parameters` to a string representation.
#### Source
```
%dw 2.0
import * from dw::module::Mime
output application/json
---
toString({'type': "application", subtype: "json", parameters: {}})
```

#### Output
```
"application/json"
```

### Example
This example transforms a `MimeType` value that includes a `parameters` to a string representation.
#### Source
```
%dw 2.0
import * from dw::module::Mime
output application/json
---
toString({'type': "multipart", subtype: "form-data", parameters: {boundary: "my-boundary"}})
```

#### Output
```
"multipart/form-data;boundary=my-boundary"
```
repeat | MuleSoft Documentation
# repeat
## repeat(text: String, times: Number): String
Repeats a `text` the number of specified `times`.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
Number of times to repeat char. Negative is treated as zero.  
### Example
This example shows how `repeat` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
 "a": repeat("e", 0),
 "b": repeat("e", 3),
 "c": repeat("e", -2)
}
```

#### Output
```
{
 "a": "",
 "b": "eee",
 "c": ""
}
```

## repeat(text: Null, times: Any): Null
Helper function that enables `repeat` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
isKeyType | MuleSoft Documentation
# isKeyType
## isKeyType(t: Type): Boolean
Returns `true` if the input is the Key type.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The type to check.  
### Example
This example shows how `isKeyType` behaves with different inputs.
#### Source
```
%dw 2.0
import * from dw::core::Types
type AKey = Key
output application/json
---
{
  a: isKeyType(AKey),
  b: isKeyType(Key),
  c: isKeyType(Boolean),
}
```

#### Output
```
{
 "a": true,
 "b": true,
 "c": false
}
```
Using RTFCTL Tool Overview | MuleSoft Documentation
# Using RTFCTL Tool Overview
The `rtfctl` command line tool enables you to locally manage Runtime Fabrics. Using `rtfctl` you can perform the following actions:
  * Install, configure, and troubleshoot Runtime Fabrics
  * Get the status of a Runtime Fabric
  * Perform a heap dump or a thread dump of a running application
  * Display memory usage of a running Mule app
  * Manage proxy settings
  * Manage secure properties
  * Manage a Mule license
  * Manage the alert sender email address


## Before You Begin Using RTFCTL
Before you start using `rtfctl`, see the following topic to enable `rtfctl` Kubernetes permissions and install the `rtfctl` command line tool.
  * 

## Next Steps
After you install the command line tool, you can start using `rtfctl` commands to install and manage Runtime Fabric and manage Mule apps deployed to Runtime Fabric.
  * Using RTFCTL for Runtime Fabric
  * Using RTFCTL for Deployed Mule Apps


## See Also
  * Install the Runtime Fabric Command Line Tool
Mule Events | MuleSoft Documentation
# Mule Events
A Mule event contains the core information processed by the runtime. It travels through components inside your Mule app following the configured application logic.
Note that the Mule event is immutable, so every change to an instance of a Mule event results in the creation of a new instance.
A Mule event is composed of these objects:
  * A Mule Message contains a message payload and its associated attributes.
  * Variables are Mule event metadata that you use in your flow.


A Mule event source (previously called a "message source") triggers the generation of a Mule event and dispatches that event to the flow. Examples of event sources include triggers, such as the Scheduler, and listeners, such as the HTTP Listener and On New or Updated File components.
  1. A trigger reaches the event source.
  2. The event source produces a Mule event.
  3. The Mule event travels sequentially through the components of a flow.
  4. Each component interacts in a pre-defined manner with the Mule event.


In some cases when an issue occurs in an event source, the component does not produce a Mule event. For example, invalid or incorrect paths in an HTTP listener configuration prevents the creation of a Mule event. Connectors log such issues in ERROR, WARN, or INFO messages.
## See Also
  * Mule Message Structure
  *   * Variables in Mule Events
  * Logging and Debugging
  *
Categories | MuleSoft Documentation
# Categories
You can filter the list by policy categories:
  * Compliance
  * Security
  * Quality of Service
  * Transformation
  * Troubleshooting


After selecting a category, you can further filter the list by the type of protection it fulfills.
If a policy is already applied, or if the protection it provides is already fulfilled by another policy you applied, the policy appears unavailable.
## Policy Categories
Policies are categorized by the function they perform. For example, because you resolve issues with the help of logs, the Message Logging policy is categorized as a troubleshooting policy. The following table lists default policies by its category and the function it performs:
Policy | Category | Fulfills | Required  
---|---|---|---  
Client ID Enforcement |  Client ID Required  
CORS-enabled  
Header Injection |  Transformation |  Header Injection  
Header Removal |  Transformation |  Header Removal  
HTTP Basic Authentication |  Authentication |  Security Manager  
IP Blocklist |  IP Filtered  
IP Allowlist |  IP Filtered  
JSON Threat Protection |  JSON Threat Protected  
LDAP Security Manager |  Security Manager  
Message Logging |  Troubleshooting |  Message Logging  
OAuth 2.0 Access Token Enforcement Using External Provider Policy |  OAuth 2.0 protected  
OpenAM Access Token Enforcement |  OAuth 2.0 Protected  
PingFederate Access Token Enforcement |  OAuth 2.0 Protected  
Rate Limiting |  Quality of Service |  Rate Limited  
Rate Limiting, SLA-Based |  Quality of Service |  Rate Limited, Client ID required  
Simple Security Manager |  Security Manager  
Throttling -SLA-Based |  Quality of Service |  Throttled, Rate Limited, Client ID required  
Quality of Service |  Throttled, Rate Limited  
XML Threat Protection |  XML Threat Protected  
## See Also
  * Preparing RAML for Policies
join | MuleSoft Documentation
# join
## join<L <: Object, R <: Object>(left: Array<L>, right: Array<R>, leftCriteria: (leftValue: L) -> String, rightCriteria: (rightValue: R) -> String): Array<Pair<L, R>>
Joins two arrays of objects by a given ID criteria.
`join` returns an array all the `left` items, merged by ID with any right items that exist.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The left-side array of objects.  
The right-side array of objects.  
`leftCriteria` | The criteria used to extract the ID for the left collection.  
`rightCriteria` | The criteria used to extract the ID for the right collection.  
### Example
This example shows how join behaves. Notice that the output only includes objects where the values of the input `user.id` and `product.ownerId` match. The function includes the `"l"` and `"r"` keys in the output.
#### Source
```
%dw 2.0
import * from dw::core::Arrays
var users = [{id: "1", name:"Mariano"},{id: "2", name:"Leandro"},{id: "3", name:"Julian"},{id: "5", name:"Julian"}]
var products = [{ownerId: "1", name:"DataWeave"},{ownerId: "1", name:"BAT"}, {ownerId: "3", name:"DataSense"}, {ownerId: "4", name:"SmartConnectors"}]
output application/json
---
join(users, products, (user) -> user.id, (product) -> product.ownerId)
```

#### Output
```
[
 {
  "l": {
   "id": "1",
   "name": "Mariano"
  },
  "r": {
   "ownerId": "1",
   "name": "DataWeave"
  }
 },
 {
  "l": {
   "id": "1",
   "name": "Mariano"
  },
  "r": {
   "ownerId": "1",
   "name": "BAT"
  }
 },
 {
  "l": {
   "id": "3",
   "name": "Julian"
  },
  "r": {
   "ownerId": "3",
   "name": "DataSense"
  }
 }
]
```
Connect to an FTP Server Example | MuleSoft Documentation
# Connect to an FTP Server Example
To configure the global element to connect to an FTP server, follow these steps:
  1. Select the name of the connector in the Studio canvas.
  2. Select the operation in the Studio canvas.
  3. In the configuration screen for the operation, click the plus sign (**+**) next to **Connector configuration** to access the global element configuration fields.
  4. On the **General** tab, specify the connection information for the connector.
  5. Set **Working Directory** to `${workingDir}`. This is the root of every relative path used with this connector. The value defaults to the remote server.
  6. Set **Host** to specify the SFTP server host, for example, `localhost` or `192.168.0.1`.
  7. Set **Port** to `${ftpPort}`.
  8. Set **Username** to `anonymous` and **Password** to `password`.
  9. On the **Advanced** tab, optionally specify the timeout configuration and reconnection strategy.
  10. Click **Test Connection** to confirm that Mule can connect with the specified server.
  11. Click **OK**.


In the **Configuration XML** tab of your Studio canvas, the configuration `ftp:config` looks like this:
```
<ftp:config name="FTP_Config" doc:name="FTP Config" doc:id="" >
 <ftp:connection workingDir="${workingDir}" host="localhost"
  port="${ftpPort}" username="anonymous" password="password" />
</ftp:config>
```

## See Also
  * FTP Connector 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:
  * Run-rate business management — This solution seamlessly sends customer and order data from SAP into Manufacturing Cloud. It also sends product data and price lists from a PIM system into 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
Trusted Salesforce Organizations | MuleSoft Documentation
# Trusted Salesforce Organizations
Enable cross-platform features between your Anypoint Platform organization and a trusted Salesforce organization (tenant) by establishing a connection between them.
Establishing a tenant relationship between an Anypoint Platform organization and a Salesforce organization enables users in your organization to:
  * Enable API Catalog for a connected Salesforce organization to view a catalog of MuleSoft APIs that are available for use in the connected Salesforce organization and sync APIs to get the latest changes and updates.
  * Enhance Anypoint Code Builder and Intelligent Document Processing (IDP) developer experiences with Einstein.


When you establish the tenant relationship, you can initiate, complete, and manage the tenant relationships. You can also enable, disable, and remove connections.
You can establish relationships with multiple Salesforce orgs in your Anypoint Platform organization, but a Salesforce organization can connect to only one Anypoint Platform organization.
## Anypoint Platform Administrators
Anypoint Platform organization administrators can:
  * Initiate the connection process to a Salesforce organization.
  * Enable a tenant relationship with Salesforce.
  * Remove the relationship between Anypoint Platform and a Salesforce organization.
  * Manage connected Salesforce organizations.


## Salesforce Organization Administrators
Salesforce admins can:
  * Complete the connection process to the Anypoint Platform organization.
  * Disconnect or reconnect an Anypoint Platform and Salesforce organization.
  * Remove the connection between the Anypoint Platform organization and the Salesforce organization.
  * Enable the connected Anypoint Platform organization to use the Salesforce organization’s Einstein capability.


For more information about initiating and maintaining a relationship with a Salesforce organization, see Manage Your MuleSoft Anypoint Platform Connections in Salesforce Help.
## See Also
  * Establish a Tenant Relationship With a Trusted Salesforce Organization
  * Managing Connected Salesforce Orgs
  * Managing Capabilities for a Connected Salesforce Organization
Deployed Message flow configuration not found for Message: <name> | MuleSoft Documentation
# Deployed Message flow configuration not found for Message: <name>
You might occasionally see tracking information such as this in the Activity section of Anypoint Partner Manager:
```
X12 from <partner>
Received <date>
File <name>
control #
TA1 sent
```

## Causes
This information appears in the Activity section when one of the following occurs:
  * A transmission is received that contains a message type that is not configured for any partner or flow.
  * A transmission is received that contains a message type that is not supported by Anypoint Partner Manager.


## Solution
Verify that the message type was received via the transmission:
  1. For the activity that you are viewing, inspect the message to determine the message type received. The message should contain a message identifier string like this: `v004010-810-1548-000000001`. Parts of this message are:
     * v004010: X12 format version received in a transmission
     * 810: Message type received
     * 1548: Group Segment Identifier (GS06)
     * 000000001: Message Segment Identifier (ST02)
  2. From within your Anypoint Partner Manager, Sandbox or Production environment select **Message Flows**.
  3. If you know the specific flow you are searching for, click on the card related to that flow to expand the associated configurations.
  4. If you do not know which flow you are looking for, search by partner name or message type (such as 850) to identify possible related message flows, and click on the message flow card to open up the flow.
  5. In the message flow configurator, verify that the appropriate message type (such as X12, version - 4010, message type - 850) is configured and that this matches the type of file that was listed in the Activity that indicated that an unrecognized standard was being used.
  6. If there is a discrepancy between the type of message configured in the message flow compared to the message received in the activity, then either contact your partner and ask them to send the appropriate file, or correct your message flow to ensure that the message type configured matches the type you expect to receive from your partner.


Partner Manager supports receiving only X12 files. If your partner sends you any other type of file such as (JSON, XML, CSV, and so on), contact your partner and ask them to send the appropriate file type to you.
Mule Data Types | MuleSoft Documentation
# Mule Data Types
Mule runtime engine uses a typed data structure called `TypedValue` that centralizes data access across different components. This data structure provides access to both the actual data and its data type. The data type consists of two values, the MIME type and the encoding of the data.
## Input Data
Mule stores all variables and the payload using the `TypedValue` data structure. Also, operations like `List` from the Anypoint Platform File Connector return their results as `TypedValue` instances, enabling DataWeave to list different types of files (JSON, XML, CSV, and so on) to read.
## Output Data
DataWeave always outputs a `TypedValue` instance. DataWeave decides what writer to use based on the data type of the `TypedValue` instance. However, you can manually specify the data type in a DataWeave script by using the `output` directive. If the script that Mule is executing is assigned to a message processing field, Mule informs DataWeave which type of data to expect type based on the metadata of that field. For example, if the data type is a Plain Old Java Object (Pojo), then DataWeave knows not only which class to instantiate but also that it must use the Java writer to generate the output.
## How DataWeave Uses Mule Data Types
DataWeave uses the data type contained in the `TypedValue` instance to determine which reader to use, based on the MIME type, and how to configure that reader (encoding, reader properties), based on the MIME type properties. When DataWeave cannot determine the data type, it follows this procedure:
  1. Verifies which input types the script is using.
If all inputs are compatible or of the same data type, DataWeave uses that data type. For example, if the script contains `<set-payload value="#[payload.someValue]/>` DataWeave examines the data type of the payload and, if the payload is JSON, DataWeave uses the JSON writer. If there is more than one input in the script and they are from different data types, DataWeave throws an error.
For example, if the script contains `<set-payload value="#[payload.someValue ++ vars.myVar]/>`, in which `vars.myBar` is of type XML and `payload` is of type JSON, DataWeave throws an error. In some cases, specifically when working with XML, an expression in a Set payload operation fails because it generates an invalid XML structure.
  2. If no input is used, DataWeave uses the Java writer.
For example, when DataWeave reads the script `<set-payload value="#[\{a: true}]/>`, it uses the Java writer to output a `java.util.Map` object with an entry containing ("a", true).
For the Logger message processor, DataWeave has a special feature to avoid errors when creating the output. First, DataWeave tries to determine which input types the script is using, and then it uses the corresponding writer to generate the output. If DataWeave fails because the writer cannot create that data structure, then DataWeave uses the DataWeave writer, which can output any possible data structure.


## See Also
  *   * Setting MIME Types in DataWeave
Binaries (dw::core::Binaries) | MuleSoft Documentation
# Binaries (dw::core::Binaries)
This module contains helper functions for working with binaries.
To use this module, you must import it to your DataWeave code, for example, by adding the line `import * from dw::core::Binaries` to the header of your DataWeave script.
## Functions
Name | Description  
---|---  
Concatenates the content of two binaries.  
Transforms a Base64 string into a binary value.  
Transforms a hexadecimal string into a binary.  
| Splits the specified binary content into lines and returns the results in an array.  
Transforms a binary value into a Base64 string.  
Transforms a binary value into a hexadecimal string.  
| Writes the specified lines and returns the binary content.
isReferenceType | MuleSoft Documentation
# isReferenceType
## isReferenceType(t: Type): Boolean
Returns `true` if the input type is a Reference type.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The type to check.  
### Example
This example shows how `isReferenceType` behaves with different inputs.
#### Source
```
%dw 2.0
output application/json
import * from dw::core::Types
 type AArray = Array<String> {n: 1}
 type AArray2 = Array<AArray>
 ---
 {
   a: isReferenceType( AArray),
   b: isReferenceType(arrayItem(AArray2)),
   c: isReferenceType(String)
 }
```

#### Output
```
{
 "a": false,
 "b": true,
 "c": false
}
```
Troubleshooting Managed Gateway Maintenance | MuleSoft Documentation
# Troubleshooting Managed Gateway Maintenance
When viewing or maintaining Anypoint Managed Flex Gateway instances, you might encounter issues. Check these topics for possible causes and solutions.
  * Missing Gateway Metrics
  * Gateway Properties Not Editable
  * Timeout While Waiting for Update
  * Gateway is Missing or Disabled
  * API Path Conflict


## Missing Gateway Metrics
In Runtime Manager, if you can’t see metrics for your gateway from the Managed Flex Gateway dashboard, verify that you have the _Usage Viewer_ permission. 

Verify your permissions
    
Check your assigned roles and permissions in Access Management to verify that you have the required _Usage Viewer_ Runtime Manager permission.
Your Anypoint Platform Admin can add these permissions in Access Management. For more information, see Manage Team Permissions .
## Can’t Change Gateway Properties
You can’t edit some Managed Flex Gateway properties, such as **Gateway Name** , **Deployment Target** , and **Flow plans** , after the gateway instance is created. To change these properties, you must delete and recreate your Managed Flex Gateway with the desired values.
## Timeout While Waiting for Update
If your Managed Flex Gateway update or deletion is stalled, refresh the status and check again in a few minutes. Delays might happen when the Anypoint Platform is handling a lot of traffic.
## Gateway is Missing or Disabled in API Manager
When adding an API instance to a gateway, if you don’t find your Managed Flex Gateway in the API Manager **Select a gateway** list or the Managed Flex Gateway is disabled, view the gateway status in Runtime Manager to ensure the gateway is running. If the gateway status isn’t **Running** , fix the probelm from Runtime Manager. If the gateway status is **Running** but still unavailable in API Manager, there might be a cluster issue, and you should contact MuleSoft Support for assistance.
## API Path Conflict
When an API to a Managed Flex Gateway, if you see the **This path conflicts with another API** error in API Manager, you must choose a different base path. Each API instance in a Flex Gateway must be unique within the gateway. To fix this problem, change the API path to a unique value or edit the path of the other API instance. Click **API** in the error message to view and edit the API instance with the conflicting path.
Apache Cassandra Connector 4.1 XML and Maven Support | MuleSoft Documentation
# Apache Cassandra Connector 4.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/cassandra-db
http://www.mulesoft.org/schema/mule/cassandra-db/current/mule-cassandra-db.xsd
```

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