BassemE/mulesoft-documentation-embeddings huggingface dataset:
Reusing Types from Java Classes | MuleSoft Documentation
# Reusing Types from Java Classes
Use the import directive with the `java!` prefix when loading a Java class. The prefix `java!` tells DataWeave to use the Java module loader. After the module loads, you can call constructors, variables, and functions (see Call Java Methods with DataWeave). The class type is also available. DataWeave exposes the type of the Java class with the type name `Class`.
Java classes are mapped to the DataWeave types listed in Java Value Mapping. If a Java class is not specified in the table, DataWeave treats the class as `JavaBean` and maps it to a DataWeave `Object` type. The keys in that object match the names of the properties in the Java class and their values correspond to the DataWeave type that matches the property class. The following example shows how DataWeave takes all properties from the Java getters:
Product Class:
```
package org.mycompany;

public class Product {
  private String name;
  private int price;
  public Product(String name, int price) {
    this.name = name;
    this.price = price;
  }
  public String getName() {return name;}
  public void setName(String name) {this.name = name;}
  public int getPrice() {return price;}
  public void setPrice(int price) {this.price = price;}
}
```

Loading the type for this Java class has the same effect as declaring this DataWeave type:
```
type Class = { name?: String | Null, price?: Number | Null }
```

The following example uses the type `Product::Class` as any other type in DataWeave. Creating a DataWeave object by calling the function `Product::new` (which calls the constructor of the Java class) also matches the type `Product::Class`. Notice that the import directive lacks `from` and instead uses the type `Class` prefix `Product::`. The prefix enables more declarative use of the type and avoids collisions with any other imported `Class` types:
DataWeave Script:
```
%dw 2.0
output json
import java!org::mycompany::Product
var aBook: Product::Class = {name: "Learn DW", price: 123}
fun description(p: Product::Class) = "The product: $(p.name), costs: $(p.price)"
type Order = {
  product: Product::Class,
  date: LocalDateTime
}
---
{
  a: Product::new("DW lang", 321) is Product::Class,
  b: description(aBook),
  c: {product: aBook, date: |2022-12-18T14:00:00|} is Order
}
```

Output:
```
{
  a: true,
  b: "The product: Learn DW, costs: 123",
  c: true
}
```
Use a Reader Property through a Connector Operation | MuleSoft Documentation
# Use a Reader Property through a Connector Operation
Connector operations that read input data provide an `outpuMimeType` field that you can use to identify the _input_ MIME type. This field also accepts one or more reader properties, which is useful for helping DataWeave read the input correctly.
By default, the DataWeave reader treats a comma (`,`) as a separator. However, assume that a CSV input is separated by the pipe (`|`) but that the content also contains commas. You can set a CSV reader property to recognize the pipe as the separator.
Pipe-separated CSV Input
```
id | name | role
1234 | Shokida,Mr. | dev
2345 | Achaval,Mr. | arch
3456 | Felisatti,Ms. | mngr
4567 | Chibana,Mr. | dev
```

The following example uses the Read operation in the File connector to read the pipe-separated (`|`) CSV input, and it uses a DataWeave script in the Transform Message component to output a row of the input in comma-separated format.
Mule Flow:
```
<flow name="ex-use-csv-reader-props" >
	<scheduler doc:name="Scheduler" >
		<scheduling-strategy >
			<fixed-frequency frequency="90" timeUnit="SECONDS"/>
		</scheduling-strategy>
	</scheduler>
	<file:read doc:name="Read" config-ref="File_Config" path="staff.csv"
	      outputMimeType='application/csv; separator=|; header=true'/>
	<ee:transform doc:name="Transform Message" >
		<ee:message>
			<ee:set-payload><![CDATA[%dw 2.0
output application/csv header = false
---
payload[1]]]></ee:set-payload>
		</ee:message>
	</ee:transform>
	<logger level="INFO" doc:name="Logger" message="#[payload]"/>
</flow>
```

The Scheduler component (`<scheduler/>`) in the example generates a Mule event each time it triggers the flow.
The Read operation (`<file:read/>`) uses `outputMimeType='application/csv; separator=|; header=true'` to identify the input MIME type (`application/csv`), the CSV separator (`|`), and the header setting (`true`).
The script in the Transform Message component (`<ee:transform-message/>`) returns the second row from the input CSV (`2345 , Achaval\,Mr. , arch`). The script uses `payload[1]` to select that row because DataWeave treats each row in the CSV as an index of an array. The output is comma-separated because the default CSV separator is a comma. The script omits the CSV header from the output by using the `output` directive (`output application/csv header = false`).
The Logger component (`<logger/>`), which is set to `payload`, writes the comma-separated output as INFO in its `LoggerMessageProcessor` message: `2345 , Achaval\,Mr. , arch`. To avoid treating the comma before "Mr." as a separator, the CSV output escapes the comma with a backslash (`Achaval\,Mr.`).
The following examples pass reader properties through the `outputMimeType` field:
  * CSV example that uses `streaming=true; header=true`
  * JSON example that uses `streaming=true`


## See Also
  *   *   *
Downloading Raw Data | MuleSoft Documentation
# Downloading Raw Data
You can use Anypoint Monitoring to download archived log data (raw data) collected on Mule apps that are running in hybrid, CloudHub, or Runtime Fabric deployments. This data is helpful for security, compliance, or other purposes where you need to examine or collect your warehoused data.
Log data is archived regularly.   
---  
To download raw data:
  1. Select the **Environment** and **Resource**.
The resource is a Mule app that runs in CloudHub, hybrid, Runtime Fabric deployments.
  2. Provide the date for the data you want to download, for example: `08/31/2018`.
  3. Locate and download log data that you want to examine.


If data is not available for a particular date, it might be that the app was not running that day, your company did not have a subscription to the logging or archiving service, or the app did not exist at that time.
## See Also
Logs in Anypoint Monitoring
CLI for Environments and Business Groups | MuleSoft Documentation
# CLI for Environments and Business Groups
Command | Description  
---|---  
use environment |  Make specified environment active  
use business-group |  Make specified business-group active  
## use environment
This command is only available for interactive mode.
```
> use environment [options] <name>
```

This command makes active the environment specified in `<name>`.
This command accepts only the default options: `--help`, `-f`/`--fields` and `-o`/`--output`.
## use business-group
This command is only available for interactive mode.
```
> use business-group [options] <name>
```

This command makes the business group you specified in `<name>` active.
If your business group or organization name contains spaces, you need to enclose its name between `"` characters. ```
> use business-group "QA Organization"
```
  
---
Email Connector 1.3 | MuleSoft Documentation
# Email Connector 1.3
Anypoint Connector for Email (Email Connector) sends and retrieves email messages over standard email protocols. Email Connector configurations share a basic set of parameters that require a connection over the protocols you use.
For compatibility information and fixed issues, see the Email Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * Creating a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have access to Anypoint Platform and Anypoint Studio.
## Common Use Cases for the Connector
Email Connector enables you to:
  * Retrieve emails from POP3 mailboxes
  * Retrieve, delete, and store emails from IMAP mailboxes
  * Send emails over the SMTP protocol
  * Support secure connections for all protocols over Transport Layer Security (TLS)


For examples, see Examples.
## Audience
  * New users, read:
    * Using Anypoint Studio to Configure the Connector to create your Mule app
    * Examples, which provide one or more use cases for the connector
  * Advanced users, read:
    * XML and Maven Support
    * Examples, which provides one or more use cases for the connector


## Next Step
After you complete the prerequisites and try the templates and examples, 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
APIkit for REST | MuleSoft Documentation
# APIkit for REST
Use APIkit for REST to streamline REST API development while ensuring compliance with industry standards. APIkit for REST is a framework designed to simplify the development and integration of RESTful APIs. REST (Representational State Transfer) is an architectural style for building web services.
APIkit for REST fully supports RAML (RESTful API Modeling Language) and OAS (OpenAPI Specification), which are widely adopted formats for describing RESTful APIs. Define your API contracts using RAML or OAS to benefit from consistent design, enhanced collaboration, and clear documentation.
## Features
  * Automatic Validation
APIkit for REST automatically validates incoming requests against your API contracts defined in RAML or OAS. This validation ensures that requests adhere to the specified rules and constraints of the API.
  * Code Generation
The framework provides code generation capabilities that help streamline the implementation of your RESTful APIs. APIkit for REST generates implementation templates based on your API contracts.
  * Intelligent Routing
With APIkit for REST, incoming requests are intelligently routed to the appropriate endpoints based on the defined API contracts.


APIkit for REST is a tool for efficient REST API development and integration. By leveraging its features and adhering to industry standards, you can accelerate your API development lifecycle, improve collaboration, and deliver high-quality RESTful APIs.
## See Also
  * Building, Implementing, and Testing a REST API
  * APIkit for REST Module Reference
Document Processing | MuleSoft Documentation
# Document Processing
The document processing action steps enable you to extract data from documents and translate text by using the Amazon Translate and Amazon Textract services.
Action steps that use Amazon Textract services process the document in a synchronous fashion, therefore Amazon does not store the document. These action steps automatically convert PDF files to PNG images. You can adjust the fidelity of the conversion in the properties grid of the action step.
To use these action steps, you need an active subscription to AWS.
  * The Credentials for AWS action step enables you to set up your AWS credentials one time and then reference them in any other AWS action step that requires them.
  * The Entities with AWS action step enables you to use Amazon Comprehend to inspect text for named entities and return information about them.
  * The ERP Docs with AWS enables you to use Amazon Textract to analyze invoices and receipts to extract relevant data.
  * The Key values with AWS action step enables you to extract form data by sending a local file to the AWS Textract service, which returns the extracted key-value pairs.
  * The OCR with AWS action step enables you to recognize the text in a document by sending a local file to the AWS Textract service, which returns the extracted values.
  * The Queries with AWS action step enables you to extract specific data from a document by specifying a query parameter so that the response contains the data you need, without having to apply further filtering on the JSON output to get the relevant values.
  * Signature Detection with AWS
The Signature Detection with AWS action step enables you to detect single or multiple signatures in files such as PNG, JPEG, or PDF.
  * The Tables with AWS action step enables you to recognize the text values inside a table by sending a local file to the AWS Textract service, which returns the extracted values.
  * The translate with AWS action step enables you to use the Amazon Translate service to translate the specified text.


## See Also
  *   *   *
Configuring Flex Gateway in Local Mode | MuleSoft Documentation
# Configuring Flex Gateway in Local Mode
  * Configure Replicas - Anypoint Flex Gateway enables you to create replicas, which are instances of Flex Gateway. By default, Flex Gateway runs as a single replica. Running multiple replicas enables scaling, load balancing, and high availability.
  * Configure TLS Context - Flex Gateway enables you to configure a TLS context to support regular TLS and mTLS in both inbound and outbound directions.
  * Configure Shared Storage - Flex Gateway enables you to configure shared storage for distributed caching and rate limiting policies.
  * Configure a Forward Proxy - Flex Gateway enables you to configure a forward proxy to route external HTTP connections through a proxy connection.
  * Configure a Liveness Check - Flex Gateway enables you to run a liveness check command to test gateway health. Additionally, Flex Gateways deployed on Kubernetes include a liveness probe to automatically restart pods after a specified number of failed checks.
  * Configure PROXY Protocol - Flex Gateway supports PROXY protocol to perserve client IP address when servicing multi-layer connections.
  * Configure Distributed Tracing - Flex Gateway enables you to configure distributed tracing for your APIs.


Refer to the Declarative Configuration Reference Guide for information about configuring Flex Gateway via declarative configuration files.
Upgrading and Migrating SAP S/4HANA SOAP Connector to 2.x | MuleSoft Documentation
# Upgrading and Migrating SAP S/4HANA SOAP Connector to 2.x
Upgrade Anypoint Connector for SAP S/4HANA SOAP to take advantage of the increased security offered by using OAuth 2.0 authentication to connect to SAP S/4HANA SOAP.
## Supported Upgrade Paths
This is a direct upgrade from version 1.0.0 version to 2.x.x.
From Version | To Version  
---|---  
## Changes in This Release
  * OAuth 2.0 is supported. The **OAuth 2.0 Application Connection Provider** option has been added to **Connection** types. For information about the configuration parameters for this connection type, see SAP S/4HANA SOAP Connector Reference.
  * Mule runtime engine (Mule) 4.2.1 or later is required.
  * The base package name has been changed to `com.mulesoft.connector.sap.s4hana.soap` so that all exported classes now have different fully qualified names.


## Requirements and Limitations
Be aware of the following requirements and limitations before you upgrade to the latest version.
### Requirements
You must be using Mule 4.2.1 or later.
### Limitations
This upgrade breaks backward compatibility.
## Upgrade Prerequisites
Before you upgrade, create a backup of your files, data, and configurations in case you need to restore to them.
## Upgrade Steps
Follow these steps to perform the upgrade:
  1. In Anypoint Studio, create a Mule project.
  2. In **Mule Palette** , click **Search in Exchange**.
  3. In **Add Dependencies to Project** , enter `SAP S/4HANA SOAP` in the search field.
  4. In **Available modules** , select **SAP S/4HANA SOAP Connector** and click **Add**.
  5. Click **Finish**.
  6. Verify that the `mule-sap-s4hana-soap-cloud-connector` dependency version is the one you are upgrading to in the `pom.xml` file in the Mule project.


Studio upgrades the connector automatically.
## Post Upgrade Steps
After you install the latest version of the connector, verify the upgrade:
  1. In Studio, verify that there are no errors in the **Problems** or **Console** views.
  2. Verify that there are no problems in the project `pom.xml` file.
  3. Test the connection and verify that the operations work.


## Troubleshooting
If there are problems with caching the parameters and metadata, try restarting Studio.
## Revert the Upgrade
If you must revert to your previous version of SAP S/4HANA SOAP Connector, change the `mule-sap-s4hana-soap-cloud-connector` dependency version 2.x.x in the project’s `pom.xml` to the previous version.
## See Also
MuleSoft Help Center
Publish Your Site | MuleSoft Documentation
# Publish Your Site
After you edit and preview your updated Salesforce Experience Cloud site, you can publish the new version for your users:
  1. Open the Anypoint API Community Manager control panel.
  2. Click **Community Builder**.
  3. Click **Settings** > **General**.
  4. Select the **Public can access the community** check box.
  5. Return to **Community Builder**.
  6. Click **Publish**.


If your community is not already active, activate it:
  1. Open the API Community Manager control panel.
  2. Click **Community Administration**.
  3. Click **Settings**.
  4. Click **Activate**.


After your community is published and active, view the live site:
  1. Open the API Community Manager control panel.
  2. Click **Open Community**.
AS2 Connector 6.7 | MuleSoft Documentation
# AS2 Connector 6.7
Mule runtime engine (Mule) supports the AS2 protocol through Anypoint Connector for AS2 (AS2 Connector).
AS2 Connector enables trading partners to transmit and receive AS2 messages with EDI-X12, EDIFACT, XML, or binary payloads, for example:
  * Send messages, signed or unsigned, over HTTP or HTTPS, using the AS2 protocol
  * Receive messages over HTTP or HTTPS, using the AS2 protocol
  * Receive asynchronous MDN for sent messages


For compatibility information and fixed issues, see the AS2 Connector Release Notes.
For a major or minor release, see Upgrading and Migrating.
## Before You Begin
To use this connector, you must be familiar with:
  * The AS2 target resource
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements and global elements in a Mule flow
  * How to create a Mule app using Anypoint Studio (Studio)


Before creating an app, you must have access to:
  * Credentials to access the AS2 target resource
  * Anypoint Platform
  * Anypoint Studio version 7.6 or later


## Common Use Cases for the Connector
Common use cases for AS2 Connector include the following:
  * Send with sync MDN


Sends a message through HTTP or HTTPS using the AS2 protocol requesting the partner for a synchronous MDN (receipt)
  * Send with async MDN


Sends a message through HTTP or HTTPS using the AS2 protocol requesting the partner for an asynchronous MDN (receipt)
  * Listener


Source that receives messages via HTTP or HTTPS using the AS2 protocol
  * MDN Listener


Source that receives asynchronous MDN receipts via HTTP or HTTPS using the AS2 protocol
  * Non repudiation Listener


Source that receives a signed copy of a receipt or a message for persistent non-repudiation storage
## Non-Repudiation Storage of AS2 Messages and MDNs
If needed, you can configure non-repudiation storage for your AS2 operations to support regulatory or compliance requirements.
Only signed messages and MDNs are eligible for non-repudiation.
The following AS2 Connector sources and operations support the non-repudiation feature:
  * AS2 Send Sync operation
  * AS2 Send Async operation
  * AS2 Listener source
  * AS2 MDN Listener source


### Before You Begin for Non-Repudiation Storage
To enable non-repudiation of a message in AS2 Connector, you must implement and configure a separate Mule flow that acts as a non-repudiation flow:
  * The non-repudiation flow must have access to the signed MIME message that is passed to it, along with appropriate non-repudiation specific attributes.
  * This non-repudiation-specific Mule flow is responsible for receiving, storing, and acting upon the messages and attributes it receives.
  * The name of this non-repudiation flow must be configured on an appropriate listener or operation that has non-repudiation storage enabled.


## Next Step
After you complete the prerequisites, 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
  * MuleSoft Help Center
MQTT Connector FAQ | MuleSoft Documentation
# MQTT Connector FAQ
MQTT Connector frequently asked questions (FAQ) are:
## Does MQTT Connector use an object store for the Enable File Persistence feature?
The **Enable file persistence** feature is available only on the on-premises installation and uses a file for persistent messages. Note that an object store enables persistent storage for CloudHub applications. Refer to the object store documentation for details.
## Is MQTT Connector supported on CloudHub and Cluster environments?
Yes, MQTT Connector is supported on CloudHub and on cluster environments.
## Is MQTT Connector cluster-aware?
MQTT Connector is cluster-aware. MQTT brokers usually implement a client takeover mechanism that closes an old connection if a new connection request with the same client ID as the existing (old) connection is received and then accepts the new connection. The client takeover mechanism can become a problem if you want to deploy an application in a cluster, and still provide an explicit client ID that identifies the client. MQTT Connector provides client ID generators that help you set a static client ID, set a client ID with a dynamic component to adjust to different deployment scenarios, or define your custom client ID generator.
For further information, refer to the set a Client ID with MQTT Connector documentation.
## What are the authentication types supported?
MQTT Connector authentication supports user and password, and certificate-based authentication (TLS or WSS). Refer to the configure credentials for authentication documentation.
## Does MQTT Connector trace connection and operation executions?
Refer to the Troubleshooting MQTT Connector documentation to learn how to enable verbose logging in DEBUG mode for the connector, for Eclipse Paho driver and the Mosquitto broker.
## What is the server-side configuration required for MQTT Connector to work?
MQTT Connector works with any MQTT version 3.x compliant server also known as MQTT broker. To configure the server, refer to your MQTT broker’s documentation, for example, the Eclipse Mosquitto broker documentation.
## Does MQTT Connector use a 3rd party library to connect with the external system?
MQTT Connector uses Eclipse Mosquitto libraries. The ArtifactID is `org.eclipse.paho.client.mqttv3`.
## Is there any documentation or release notes for the Eclipse Mosquitto external library?
To get release notes for Eclipse Mosquitto library, refer to the Eclipse public repository.
## Are there any permission, roles, or additional configuration required on the broker side to connect with our credentials using MQTT Connector?
No, there aren’t any additional permissions or configuration requirements to connect to MQTT version 3.x compliant MQTT brokers. On the MQTT broker side, you do need to configure the listeners properly.
## See Also
  * MuleSoft Help Center
docTypeAsString | MuleSoft Documentation
# docTypeAsString
## docTypeAsString(docType: DocType): String
Transforms a `DocType` value to a string representation.
_Introduced in DataWeave version 2.5.0._
### Parameters
Name | Type | Description  
---|---|---  
The `DocType` value to transform to a string.  
### Example
This example transforms a `DocType` value that includes a `systemId` to a string representation.
#### Source
```
%dw 2.0
import * from dw::xml::Dtd
output application/json
---
docTypeAsString({rootName: "cXML", systemId: "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd"})
```

#### Output
```
"cXML SYSTEM http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd"
```

### Example
This example transforms a `DocType` value that includes a `publicId` and `systemId` to a string representation.
#### Source
```
%dw 2.0
import * from dw::xml::Dtd
output application/json
---
docTypeAsString({rootName: "html", publicId: "-//W3C//DTD XHTML 1.0 Transitional//EN", systemId: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"})
```

#### Output
```
"html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
```
Header Removal Policy | MuleSoft Documentation
# Header Removal Policy
**Policy name** | Header Removal  
---|---  
Removes headers from a request or a response  
Transformation  
**First Flex Gateway version available**  
**Returned Status Codes** | 500 - The configuration includes an expression that was not evaluated.  
## Summary
The Header Removal policy removes all listed headers from a request or a response of a message when you specify an inbound and outbound map of the headers that you want to remove with a key-value pair.
You can optionally include DataWeave expressions in the value of the header. For example, all headers matching the following configured expression are injected to the message:
`“#[attributes.requestPath]”`
The following headers may not be removed: accept, host, content-type, content-length, date, transfer-encoding, connection,   
---  
## 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: header-removal-flex
 config:
  inboundHeaders: <array> // OPTIONAL, default: []
  outboundHeaders: <array> // OPTIONAL, default: []
```

Parameter | Required or Optional | Default Value | Description  
---|---|---|---  
`inboundHeaders` |  Empty array |  Map of header names or regular expressions to be removed at the beginning of the message processing, for example, `Cache-Control, Access-Control.*`  
`outboundHeaders` |  Empty array |  Map of header names or regular expressions to be removed at the end of the message processing, for example, `Access-Control-Allow-Credentials` |  `inboundHeaders` and `outboundHeaders` can not both be empty.  
---  
#### Resource Configuration Example
```
- policyRef:
  name: header-removal-flex
  config:
   inboundHeaders:
    - "Cache-Control"
    - "Access-Control.*"
   outboundHeaders:
    - "Access-Control-Allow-Credentials"
```

### 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:
**Parameter** | **Description**  
---|---  
Inbound Header Map |  List of header names or regular expressions (comma separated) to be removed at the beginning of the message processing, for example, `Cache-Control, Access-Control.*`  
Outbound Header Map |  List of header names or regular expressions (comma separated) to be removed at the end of the message processing, for example, `Access-Control-Allow-Credentials`  
Method & Resource conditions |  The option to add configurations to only a select few or all methods and resources of the API  
## How This Policy Works
Because every header that matches a Header Removal policy parameter is removed from the message, you must be careful about how you configure that parameter.
For example, the following parameter configuration removes any header starting with the word `Access-Control`, such as the `Access-Control-Allow-Credentials` and `Access-Control-Allow-Origin` headers from a message. The configuration also removes the `Cache-Control` header:
Figure 1. Inbound Header
Sending Asynchronous Responses from a Message Source | MuleSoft Documentation
# Sending Asynchronous Responses from a Message Source
Sources can send responses in an asynchronous way. Some of the main uses cases for asynchronous sources are:
  * The response operation is non-blocking.
  * The response operation is blocking, but it is asynchronously executed in a thread other than the one that initiates it (most typically, the thread executing a method annotated with `OnSuccess` or `OnError`).
  * The source will perform asynchronous auditing for which it needs to consume a response stream in a separate thread.


In these cases:
  * The runtime needs to know that the response will be asynchronous. Otherwise, there will be a race condition between the thread emitting the response and the runtime that is trying to free up resources associated with the message that is getting a response.
  * Methods annotated with `OnSuccess` or `OnError` must have an argument of type `SourceCompletionCallback`. That is enough to signal the runtime that the source is asynchronous.


The runtime will not finish the associated event until either the `success()` or `error(Throwable)` methods are invoked. Note that this is a very strong contract. A source that requests a `SourceCompletionCallback` without properly notifying the runtime is one likely to freeze the entire runtime eventually.
Here is an example:
```
@OnSuccess
public void onSuccess(@Content String response, SourceCompletionCallback callback) {
 asyncResponder.sendResponse(response, new ResponderCallback() {
  void onSuccess() {
   callback.success();
  }
  void onFailure(Throwable t) {
   callback.error(t);
  }
 };)
}
```

## Next Step
Transactional Message Sources
Prerequisites for MuleSoft Accelerator for OMS | MuleSoft Documentation
# Prerequisites for MuleSoft Accelerator for OMS
The amount of configuration you’ll need to perform depends on which assets you’re deploying in your target environment.
Use the following setup guides to configure the systems and products that are needed to implement the B2B EDI Order Lifecycle Automation use case:
  *   * Salesforce OMS Setup and Customization
  * Anypoint Partner Manager Setup


Use the following setup guides to configure the systems and products that are needed to implement the Salesforce OMS to ERP Integration use case:
  *   * SAP S/4HANA Order Management
  * 

## See Also
  *   * MuleSoft Accelerator for Salesforce OMS
Dtd Types (dw::xml::Dtd) | MuleSoft Documentation
# Dtd Types (dw::xml::Dtd)
Type | Definition | Description  
---|---|---  
`type DocType = { rootName: String, publicId?: String, systemId?: String, internalSubset?: String }` |  DataWeave type for representing a doctype declaration that is part of an XML file. Supports the following fields:
  * `rootName`: Root element of the declaration.
  * `publicId`: Publicly available standard (optional).
  * `systemId`: Local URL (optional).
  * `internalSubset`: Internal DTD subset (optional).

_Introduced in DataWeave version 2.5.0._
Flow Management | MuleSoft Documentation
# Flow Management
Private Cloud Edition 
You can individually start and stop the specific flows within your deployed applications via the Runtime Manager UI. All flows are active by default.
The flow management feature isn’t available for apps deployed to CloudHub and Anypoint Runtime Fabric.
To act on flows, you must have **Manage Applications** permission on the desired applications.
## Start and Stop Flows
Individual flows can be set to active or inactive through the **Start** and **Stop** buttons.
Select one or more flows in your app, and click the **Start** or **Stop** button.
Starting a flow doesn’t imply triggering its endpoints, it just makes it active if previously set inactive.   
---  
## Set Flows to Unmanaged
In some cases, you can explicitly set up your applications to start and stop flows automatically according to any criteria you want. In these cases, this behavior is carried out by logic in the applications running inside Mule runtime itself, and Runtime Manager is unaware of the logic behind these changes.
The default flow status for every application is unmanaged. This means that your flows freely transition states between active and inactive according to the behavior set up in application logic running in Mule runtime.
You can click **Start** or **Stop** for a flow in the **Flow Management** tab to override the unmanaged status. In this case, Runtime Manager continually enforces the active or inactive state of the flow, regardless of any changes Mule runime attempts. Click **Unmanage** to reset the flow status to unmanaged at any time.
## See Also
  *   * Manage Deployed Applications
  * Manage Applications on Your Servers
  * Monitor Applications
EDIFACT EDI Connector 2.10 Control Numbers | MuleSoft Documentation
# EDIFACT EDI Connector 2.10 Control Numbers
Using the Write operation in the Anypoint Connector for EDIFACT EDI (EDIFACT EDI Connector), you can generate control numbers on the generated EDIFACT payload by:
  * Managing global control numbers through control number keys
  * Managing identifier combination control numbers
  * Using your own control number


## Manage Global Control Numbers Through Control Number Keys
If your organization or your trading partner must maintain unique interchange, group, or transaction set control numbers across different identifier combinations and document types:
  * Set the configuration `Use supplied values` to `false`.
  * Leverage the control number key configurations (at the configuration level or operation level) to set a key unique to the partner.
By default, the control number key configurations pass dynamically at the operation level. You can then use this group control number key across different identifiers and transaction types for the same partner.


## Manage Identifier Combination Control Numbers
If you want the connector to automatically maintain control number sequencing based on the sender/receiver identifiers and you do not require global control numbers at a partner level, then set the Write configuration `Use supplied values` to `false`. When no value passes into the optional interchange, group, or transaction number key configurations, the sender/receiver identifier combination is the default.
## Use Your Own Control Number
If you must generate the control numbers and use them on the EDI payload, you can set the parameter `Use supplied values` to `true`, and map the control number in the payload to the DataWeave map.
Using RTFCTL for Runtime Fabric | MuleSoft Documentation
# Using RTFCTL for Runtime Fabric
After you set up the `rtfctl` command line tool, use `rtfctl` commands to install, configure, upgrade, uninstall, troubleshoot, back up, and restore Runtime Fabric. Additionally, you can replace a Mule license key.
  * Installing Runtime Fabric
  * Configuring Runtime Fabric
  * Upgrading Runtime Fabric
  * Backing Up and Restoring Runtime Fabric
  * Troubleshooting Runtime Fabric
  * Uninstall Runtime Fabric
  * Replacing a Mule License Key


## See Also
  * Using RTFCTL for Deployed Mule apps
Compression Module Examples | MuleSoft Documentation
# Compression Module Examples
Compression module examples help you compress, decompress, archive and extract files.
  * Compress and Decompress Example Compress a file using the **Compress** operation and decompress a payload from a remote service using the **Decompress** operation.
  * Archive and Extract Example Archive and extrat files from a file folder using the **Archive** and **Extract** operations.


## See Also
MuleSoft Help Center
Configuring a Disclaimer for Anypoint Platform PCE | MuleSoft Documentation
# Configuring a Disclaimer for Anypoint Platform PCE
To configure a disclaimer for your Anypoint Platform Private Cloud Edition (Anypoint Platform PCE), add a custom message to your login page that users in your organization see every time they log in:
  1. From Anypoint Platform, select **Access Management** > **Disclaimer**.
  2. Enter your disclaimer text (you can also set up a custom HTML message).
  3. Select **Save**.


## See Also
  * Configuring Anypoint Platform PCE
Einstein AI Connector 1.1 | MuleSoft Documentation
# Einstein AI Connector 1.1
Anypoint Connector for Einstein AI (Einstein AI Connector) provides connectivity to LLMs via the Salesforce Einstein Trust Layer.
Einstein AI Connector offers a range of advanced features that simplify and enhance AI integration in MuleSoft applications.
Use this connector to:
  * Build AI Agents in a low-code environment
  * Leverage existing investments (APIs, integrations, and templates) as tooling for the AI agents
  * Manage all Large Language Model (LLM) interactions through the Salesforce Einstein Trust Layer
  * Generate vector embeddings to power RAG-based architectures


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


Before creating an app, you must have:
  * Java 8 or 17
  * Apache Maven
  * Connected App credentials to connect with your Salesforce org
  * Anypoint Platform
  * The latest versions of Anypoint Code Builder or Anypoint Studio


To configure the connector, you must create a Connected App in Salesforce. For more information, see Models API Developer Guide.
## Common Use Cases for the Connector
These are some common use cases for Einstein AI Connector:
  * Enhance customer service by providing case summaries, case classifications, large dataset summaries, and more.
  * Assist sales teams in writing sales emails, summarizing cases for specific accounts, assessing the probability of closing deals, and more.
  * Support marketing teams in generating product descriptions, creating newsletters, planning social media campaigns, and more.
  * Generate embeddings of text data to support sentiment analysis and natural language understanding applications.


## Next Step
After you complete the prerequisites, you are ready to create an app and configure the connector using Anypoint Studio or Anypoint Code Builder.
## See Also
  * Introduction to Anypoint Connectors
  * Using Anypoint Code Builder to Configure a Connector
  * Using Studio to Configure a Connector
  * Einstein AI Connector Reference
  * Einstein AI Connector - Additional Configuration Information
  * MuleSoft Help Center
Scripting Module - Examples | MuleSoft Documentation
# Scripting Module - Examples
The following Scripting module examples show you how to use binding variables and how to access the registry.
## Use Binding Variables Example
The following Scripting Module XML example shows how to:
  * Use a flow variable in the scripting code, such as `vars.increment`
  * Use scripting parameters by referencing them, such as `initialValue`
  * Log some information by using the `log` variable, such as `log.info("…​.")`
  * Use the `result` variable to set the result of the execution
  * Define the payload in `vars.increment + Number(payload) + initialValue`


```
<set-variable variableName="increment" value="#[22]" />
<scripting:execute engine="ECMAScript">
  <scripting:code>
    log.info("Incrementing payload by " + (vars.increment + initialValue))
    result = vars.increment + Number(payload) + initialValue
  </scripting:code>
  <scripting:parameters><![CDATA[#[{ initialValue: 10 }]]]></scripting:parameters>
</scripting:execute>
```

## Access the Registry Example
The following Scripting Module XML example shows how to:
  * Access the registry
  * Stop or start a flow


```
<scripting:execute engine="Groovy">
  <scripting:code ><![CDATA[flow = registry.lookupByName("test-flow").get();
    if (flow.isStarted())
	    flow.stop()
    else
	    flow.start()]]>
  </scripting:code>
</scripting:execute>
```

## See Also
MuleSoft Help Center
Create a Directory Using SFTP Connector Example | MuleSoft Documentation
# Create a Directory Using SFTP Connector Example
Anypoint Connector for SFTP (SFTP Connector) provides a **Create directory** operation that enables you to create a directory of a given name.
If the reason for creating the directory is to immediately write, copy, or move content to the directory, then use the **Write** , **Copy** , or **Move** operations with the **Create parent directories** field set to **TRUE**.
## Configure the Create Directory Operation in Studio
To add and configure the **Create directory** operation in Studio, follow these steps:
  1. In the **Mule Palette** view, search for `sftp` and select the **Create directory** operation.
  2. Drag the **Create directory** operation onto the Studio canvas.
  3. In the **General** tab of the operation configuration screen, click the plus sign (**+**) next to the **Connector configuration** field to access the global element configuration fields.
  4. Specify the connection information and click **OK**.
  5. Set the **Directory path** field to the new directory’s path name, for example, `~/newFolder`.


The following screenshot shows the **Create directory** operation configuration:
Figure 1. Create directory operation configuration
In the XML editor, the `<sftp:create-directory>` configuration looks like this:
```
<sftp:create-directory doc:name="Create directory" config-ref="SFTP_Config" directoryPath="~/newFolder"/>
```

## See Also
  * SFTP Connector Examples
  * MuleSoft Help Center
Undeploying Message Flows | MuleSoft Documentation
# Undeploying Message Flows
Undeploying a message flow prevents future messages from being processed and enables you to recover resources that are consumed by a message flow that you no longer need.
You can undeploy your message flow from either a sandbox or a production environment. The undeployment process takes about five minutes, during which actions such as `Deploy` and `Delete` are unavailable.
During the undeployment process, do not log out of Anypoint Partner Manager or close your browser window.   
---  
To undeploy a message flow:
  1. In the sidebar, select **Message Flows**.
  2. Select the message flow to undeploy from the list and click **Undeploy**.


Partner Manager checks to see if any of the applications deployed to Mule are orphaned as a result of the undeployment. Partner Manager then cleans up orphaned applications to release any resources that the applications consumed.
## See Also
  * Deploying and Testing Message Flows
  * Creating Inbound Message Flows
  * Creating Outbound Message Flows
String Matchers Reference | MuleSoft Documentation
# String Matchers Reference
Anypoint Code Builder 
Anypoint Studio 
## containsString(String)
Checks that the expression contains the specified String.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::containsString('example')]"/>
```

## startsWith(String)
Checks that the expression starts with the specified String.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::startsWith('exam')]"/>
```

## endsWith(String)
Checks that the expression ends with the specified String.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::endsWith('ple')]"/>
```

## isEmptyString()
Checks that the expression has zero length.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::isEmptyString()]"/>
```

## isEmptyOrNullString()
Checks that the expression is null, or has zero length.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::isEmptyOrNullString()]"/>
```

## equalToIgnoringCase(String)
Checks that the expression is equal to the specified String, ignoring case.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::equalToIgnoringCase('example')]"/>
```

## equalToIgnoringWhiteSpace(String)
Checks that the expression is equal to the string disregarding leading and trailing white spaces, and compression all inner white spaces to a single space.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::equalToIgnoringWhiteSpace('An Example')]"/>
```

## stringContainsInOrder(Array<String>)
Checks that the expression contains all of the specified substrings, regardless of the order of their appearance.
Example
```
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::stringContainsInOrder(['an', 'example'])]"/>
```

## See Also
  *   * Core Matchers Reference
  * Comparable Matchers Reference
  * Iterable and Map Matchers Reference
Uninstalling Runtime Fabric on VMs / Bare Metal | MuleSoft Documentation
# Uninstalling Runtime Fabric on VMs / Bare Metal
Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.  
---  
You can uninstall Runtime Fabric and completely delete your gravity cluster, or you can uninstall Runtime Fabric without deleting your gravity cluster.
## Uninstall Runtime Fabric and Delete the Gravity Cluster
Perform this task to uninstall Runtime Fabric and completely remove the gravity cluster from your VMs.
Alternatively, you can perform the first two steps (delete all applications and the Runtime Fabric in Runtime Manager), and skip the remaining steps by re-imaging the VM disks.
To successfully complete this task, keep all nodes running and joined to the cluster.   
---  
  1. Using Runtime Manager, delete all Mule applications running on Runtime Fabric.
Verify across all associated environments that you have removed all applications.
  2. Using Runtime Manager, delete the Runtime Fabric.
  3. On each Worker VM, run the following command and confirm by typing “yes” when prompted:
```
sudo gravity leave --force
```

  4. Run `gravity status` on any other node until the node is no longer visible when running `gravity status`.
  5. On each Worker VM, run the following commands sequentially:
```
sudo umount /var/lib/gravity/planet/etcd
sudo umount /var/lib/gravity
sudo rm -rf /opt/anypoint/runtimefabric /root/.gravity /home/rtf-user/.gravity /var/lib/gravity /tmp/gravity /tmp/gravity-wizard*
sudo rm /etc/systemd/system/install-teleport-*.service /etc/systemd/system/install-planet-*.service /etc/systemd/system/shrink-*.service /etc/systemd/system/gravity__gravitational.io__teleport__*.service /etc/systemd/system/gravity__gravitational.io__planet-*.service
```

  6. Remove lines in the `/etc/fstab` file which are appended with the comment `# Added by RTF`.
  7. Restart the VM.
  8. Repeat steps 3 through 7 on each Controller VM.
  9. If the previous steps fail, perform a manual cleanup by running the following commands sequentially:
```
sudo systemctl stop gravity__gravitational.io__planet-*.service
sudo systemctl stop gravity__gravitational.io__teleport*.service
sudo systemctl disable gravity__gravitational.io__teleport__2.4.7.service
sudo systemctl disable gravity__gravitational.io__planet-master__5.0.8-1906.service
sudo gravity system uninstall --confirm
sudo umount /var/lib/gravity/planet/etcd
sudo umount /var/lib/gravity
sudo rm -rf /opt/anypoint/runtimefabric /root/.gravity /rtf-user/.gravity /var/lib/gravity /tmp/gravity /tmp/assets393106389 /tmp/gravity-wizard167466702
```



## Uninstall Runtime Fabric Without Deleting the Gravity Cluster
You can uninstall Runtime Fabric but keep the Gravity cluster. This is useful in scenarios in which you want to reinstall Runtime Fabric in the same cluster. To do so, run the following commands on one of the controller nodes:
```
rtfctl uninstall --confirm
rtfctl install <activation_data>
```