BassemE/mulesoft-documentation-embeddings huggingface dataset:
Combine Strings | MuleSoft Documentation
# Combine Strings
Use **Combine Strings** to combine multiple variables into a single new variable. This action step supports Script variables, environment variables, and Pin variables. You can insert text before, after, and between variables.
Link the Pin variables to use with this action step before opening the wizard. Combine Strings supports a maximum of 5 Pin variables.
To define a single text value as a variable, use the Set Variable action step instead.
## Properties
**Pattern Text** : Defines the sequence in which variables and texts are concatenated.
## Inbound Variables
**Pattern** : Defines the sequence in which variables and texts are concatenated.
## Outbound Variables
**Combined String** : The combined strings stated as a single string, as defined in **Pattern Text**.
## Reserved values
Because Pin variables use the syntax `{<number>}`, Combine String replaces values such as `{1}` and `{2}` with the corresponding Pin variable or an empty value if there are no variables configured in these slots.
To use a string that contains `{1}` or other reserved value as part of the text, define a variable containing the string and then reference it in the pattern.
For example, consider the following Pin variables:
  * `{1}: Workflow Based Variables.constantString`, with value `Value {1} is:`
  * `{2}: Workflow Based Variables.variableNumber`, with a numeric value defined at runtime. For this example, assume the value is `123456`.


By setting the pattern text to: `{1} {2}`, the combined string result is `Value {1} is: 123456`.
## Wizard
The wizard contains the editable **Pattern** text field, drop-down lists of script and environment variables, and links to the Pin variables.
Clicking the name of a variable from the list adds a reference to the variable in the text field. You can also enter custom text into the **Pattern** field.
Clicking variable names in the **Insert Available Variables** section of the Wizard inserts variables into the pattern using the following syntax depending on the type of variable:
  * Pin variables: `{[number in the list of all Pin variables]}`. Example: `{1}`.
  * Environment variables: `%[name of variables]%`. Example: `%SYSTEM%`.
  * Script variables: `($[name of variables])`. Example: `$myVariable`.


The Pin variable _Combined String_ contains the result in the form of a single string.
### Example
The macro `{1}` is bound to variable _ActivityParameters.ap_alpha1_ and macro `{2}` is bound to variable _ActivityParameters.ap_alpha2_. The following table represents the values of both variables and how they translate to a new variable using different pattern texts:
**ActivityParameters.ap_alpha1** | **ActivityParameters.ap_alpha2** | **Pattern Text** | **Output Variable _(Combined String)_**  
---|---|---|---  
`www.{1}.{2}` | `www.mulesoft.com`  
`www.{1}.{2}` | `www.mulesoft.info`  
`Dear {1}. {2},` | `Dear Ms. Miller,`  
`Dear {1}. {2},` | `Dear Mr. Johnson,`  
`LoremIpsum`  
`{2}{1} - {1}{2}` | `IpsumLorem - LoremIpsum`  
## See Also
Checkpoint | MuleSoft Documentation
# Checkpoint
_Checkpoints_ are integrated into a _Workflow_ in order to ascertain which part of the _Workflow_ was reached before an error occurred. When a _Checkpoint_ is reached it is given the status True and saves the length of time from starting to execute the _Workflow_ until the _Checkpoint_ is reached.
## Properties
The action step _Checkpoint_ has no properties.
## Inbound Variables
**Suffix** can be used if the _Checkpoint_ is within the _Control Block_ 's _File Controlled Loop_. A suffix is then added to the name of the _Checkpoint_ during every loop. Each suffix is a column entry in the file that was imported in the _File Controlled Loop_.
## Outbound Variables
**Was Reached** is given the status True if the _Checkpoint_ was executed
  * Syntax: True


**Elapsed Time** is the time taken from when the _Workflow_ starts until the _Checkpoint_ is reached
  * Syntax: [Time since Workflow start in seconds]


## See Also
  *
AS2 Connector 6.9 Examples | MuleSoft Documentation
# AS2 Connector 6.9 Examples
The following examples show how to configure send and receive messages in Anypoint Connector for AS2 (AS2 Connector):
  * Receiving AS2 Messages and Sending Back MDNs Configure the **As 2 listener** source to start receiving AS2 requests and the **Send with Sync MDN** and **Send with Async MDN** operations to start sending AS2 requests.
  * Receiving AS2 MDN Messages Configure the **As 2 mdn listener** source to start receiving Messsage Disposition Notification (MDN) Messages.
  * Sending MDNs to Multiple Partners How to send MDNs to multiple partners.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
toUri | MuleSoft Documentation
# toUri
## toUri(str: String): Uri
Transforms a `String` value into a `Uri` value.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The `String` value to transform into a `Uri` value.  
### Example
This example shows how `toUri` behaves.
#### Source
```
%dw 2.0
import * from dw::util::Coercions
output application/json
---
{
 toUriExample: toUri("https://www.google.com/")
}
```

#### Output
```
{
 "toUriExample": "https://www.google.com/"
}
```
Viewing Runtime Logs in Runtime Manager in Connected Mode | MuleSoft Documentation
# Viewing Runtime Logs in Runtime Manager in Connected Mode
Use Runtime Manager to view the runtime logs of your Flex Gateway. Runtime Manager enables you to search for keywords within the logs and to filter by **Replica** , **Time Range** , and **Log Level**.
Runtime Manager stores up to 100 MB of logs per Flex Gateway for 30 days. Runtime Manager automatically purges logs that go beyond 100 MB per Flex Gateway. If you need more storage, either use Anypoint Monitoring to access these logs (Titanium subscription required) or use a third-party logging service.
To access Flex Gateway runtime logs in Runtime Manager:
  1. From Anypoint Platform, select **Runtime Manager**.
  2. Select **Flex Gateways** in the navigation menu.
  3. Click the name of the Flex Gateway whose logs you want to view.
  4. Click **Logs**.


## See Also
  * Viewing Self-Managed Runtime and Access Logs in Anypoint Monitoring
  * Configuring Flex Gateway Log Output for Third-Party Services
API Manager 2.x | MuleSoft Documentation
# API Manager 2.x
If you created an Anypoint Platform account prior to November 2017, use the API Manager 1.x documentation listed in the version menu in the sidebar.
If you created an Anypoint Platform account after November 2017:
  * Use API Manager 2.x to manage APIs.
  * Use Design Center to author and update RAML specifications.
Applications are automatically deployed to CloudHub when you use Design Center to develop your APIs.
  * Use API Manager to deploy an API proxy to other servers.
  * You can manage Mule runtime engine 4.x APIs only with API Manager 2.x.
ServiceNow Connector 6.17 | MuleSoft Documentation
# ServiceNow Connector 6.17
Anypoint Connector for ServiceNow (ServiceNow Connector) provides connections between Mule runtime engine (Mule) and ServiceNow apps. Use the ServiceNow operations with the custom ServiceNow tables, along with any operations available through the installed plugins.
For compatibility information and fixed issues, see the ServiceNow Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements in a Mule flow and global elements
  * How to create a Mule app using Anypoint Studio


Before creating an app, you must have access to the ServiceNow target resource and Anypoint Platform.
## Common Use Cases for the Connector
Common use cases for ServiceNow Connector include:
  * **IT Service Management (ITSM)**
Sync ServiceNow data and extend IT service management (ITSM) capabilities to SaaS and on-premises applications, such as Salesforce, SAP, Workday, and Microsoft Dynamics 365, to help with data migration and replication, application integration, and consolidation. For example, you can bidirectionally sync workers data between Workday and ServiceNow or aggregate employees from Workday and users from ServiceNow into a CSV file.
  * **Integrated Business Processes**
Fully integrate business processes across HR, legal, procurement, operations, marketing, and facilities departments.
  * **Record Creation and Retrieval**
Transform enterprise IT by automating and managing IT service relationships to create a single system of records that you can retrieve.


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


## Connection Types
The following authentication types are supported:
  * Basic
  * OAuth 2.0 Authorization Code


### Limitations
  * OAuth 2.0 Authorization Code authentication works only with the following versions of Mule:
    * 4.1.5
    * 4.2.1 and later
  * Metadata does not work with OAuth 2.0 Authorization Code authentication.


## Use Exchange Templates and Examples
Anypoint Exchange provides templates you can use as a starting point for your app, as well as examples that illustrate a complete solution.
  * Workday and ServiceNow Worker Bidirectional Sync
  * Workday Worker to ServiceNow Service Request Migration
  * Workday and ServiceNow Employee Aggregation
  * Workday to ServiceNow Service Worker Migration
  * Workday Worker to ServiceNow Service Request Broadcast


## Next Step
After you complete the prerequisites and experiment with templates and examples, you are ready to create an app with Anypoint Studio.
## See Also
  * Introduction to Anypoint Connectors
  * Use Anypoint Exchange to Discover Connectors, Templates, and Examples
  * ServiceNow Connector Release Notes
  * ServiceNow Connector on Exchange
  * MuleSoft Help Center
Anypoint DataGraph Administration Settings | MuleSoft Documentation
# Anypoint DataGraph Administration Settings
On the DataGraph Administration settings page, you can select environments, view and edit endpoints, configure policies, and configure client providers:
**Switch Environment** control. Click the control to see a list of environments you have added to your organization. Select an environment to switch.  
---  
**Consumer endpoint** edit options. To edit the current endpoint, click the **Edit consumer endpoint** icon. To revert to the system-generated endpoint, click the **Revert** icon.  
**DataGraph Policies** configuration options. You can choose to restrict requests to your unified schema from registered client applications only, set SLA-based rate limiting for requests, or allow requests from anyone with access to the unified schema’s endpoint.  
**DataGraph external client providers** control. To see a list of external client providers previously configured by your organization administrators, click the control. Select a provider from the list. To run queries in Anypoint DataGraph, obtain proper credentials from the external client provider.  If your administrators haven’t configured any external client providers, this item is not available.  
## See Also
  * Permissions for Anypoint DataGraph
  * Anypoint DataGraph Supported Authentication Methods
Opening a Component in the Canvas from the XML Editor | MuleSoft Documentation
# Opening a Component in the Canvas from the XML Editor
Cloud IDE 
Desktop IDE 
**Open Beta Release** : The **cloud IDE is in open beta**. Any use of Anypoint Code Builder in its beta state is subject to the applicable beta services terms and conditions, available from the IDE.
You can open a component and its configuration panel in the canvas from the XML editor. This feature is helpful, for example, if you want to configure the component from the UI, if a component is in another flow than the flow currently displayed in the canvas, or if the canvas is not open.
  1. From the configuration XML, place your cursor within the component’s XML.
  2. Right-click and select **Configure Component in UI**.
This action displays the component in the canvas and opens its configuration panel, for example:
namesOf | MuleSoft Documentation
# namesOf
## namesOf(obj: Object): Array<String>
Returns an array of strings with the names of all the keys within the given object.
_Introduced in DataWeave version 2.3.0._
### Parameters
Name | Description  
---|---  
The object to evaluate.  
### Example
This example returns the keys from the key-value pairs within the input object.
#### Source
```
%dw 2.0
output application/json
---
{ "namesOf" : namesOf({ "a" : true, "b" : 1}) }
```

#### Output
```
{ "namesOf" : ["a","b"] }
```

## namesOf(obj: Null): Null
Helper function that enables `namesOf` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Upgrading and Migrating Salesforce Marketing Cloud Connector to 4.x | MuleSoft Documentation
# Upgrading and Migrating Salesforce Marketing Cloud Connector to 4.x
Upgrade Anypoint Connector for Salesforce Marketing Cloud (Salesforce Marketing Cloud Connector) to version 4.x.
## Supported Upgrade Paths
From Version | To Version  
---|---  
## Changes in This Release
  * The connector now supports multiple child organizations by specifying the **Account Id** field.
  * The `SFDC-MARKETING-CLOUD:THROTTLED` error is removed.


## Upgrade Prerequisites
Before you perform the upgrade, you must:
  1. Create a backup of your files, data, and configuration in case you must restore to the previous version.
  2. Install Salesforce Marketing Cloud Connector 4.x.x.


## Upgrade Steps
Follow these steps to perform the upgrade from Salesforce Marketing Cloud Connector 3.x.x to Salesforce Marketing Cloud Connector 4.x.x:
  1. In Anypoint Studio, create a Mule project.
  2. In the **Mule Palette** view, click **Search in Exchange**.
  3. In the **Add Dependencies to Project** window, enter `Salesforce Marketing Cloud` in the search field.
  4. In the **Available modules** section, select **Salesforce Marketing Cloud Connector** and click **Add**.
  5. Click **Finish**.
  6. Verify that the `mule-sfdc-marketing-cloud-connector` dependency version is `4.x.x` in the `pom.xml` file, in which the first `x` is the minor release number and the second `x` is the patch release number.


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


## Troubleshooting
If there are problems with caching the parameters or caching the metadata, try restarting Studio.
## Revert the Upgrade
If it is necessary to revert to the previous version of Salesforce Marketing Cloud Connector, change the `mule-sfdc-marketing-cloud-connector` dependency version `4.x.x` in the project’s `pom.xml` file to the previous version.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
SAP SuccessFactors Connector 4.1 | MuleSoft Documentation
# SAP SuccessFactors Connector 4.1
Anypoint Connector for SAP SuccessFactors (SuccessFactors Connector) provides full support to query, create, update, and delete entities using the OData API exposed by SuccessFactors.
This connector enables you to:
  * Create, update, and delete entities
  * Retrieve a single entity by ID or query multiple entities


For compatibility information and fixed issues, see the SAP SuccessFactors Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * SAP SuccessFactors OData API
  * Mule runtime engine (Mule)
  * Anypoint Connectors
  * Anypoint Studio essentials


Before creating an app, you must have:
  * Credentials to access a SuccessFactors developer account
  * A valid SAP SuccessFactors instance
  * A MuleSoft Enterprise license
  * Access to Anypoint Studio 7.1 or later


## Common Use Cases for the Connector
Some common use cases for SuccessFactors Connector include:
  * Creating and deleting entities in SuccessFactors
  * Retrieving an entity by ID
  * Performing queries over entities of a specified type


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


For upgrade information, see Upgrading and Migrating SAP SuccessFactors Connector.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * SAP SuccessFactors Connector Reference
  * SuccessFactors HCM Suite Help
  * MuleSoft Help Center
Troubleshooting | MuleSoft Documentation
# Troubleshooting
If you encounter errors while you are using API Community Manager, refer to these explanations and instructions for recovery.
  * Avoid a Potential Security Vulnerability
  * API Documentation Not Displaying in the API Details Page
  * Approved Members Not Created or Emailed
  * Broken Images on Documentation Pages
  * Cannot Create Applications When Application Limit is Reached
  * Changes to APIs Are Not Displaying
  * Connection Not Established
  * Console Mocking Service Not Loading
  * Duplicate External Objects
  *   * Error When Creating New Community from Template
  * Incorrect or Missing Data for One API Version
  * Issues with Branded Emails
  * Missing Feature Error
  * Missing Request Access Button
  * Unauthorized Endpoint Error
isAlphanumeric | MuleSoft Documentation
# isAlphanumeric
## isAlphanumeric(text: String): Boolean
Checks if the `text` contains only Unicode letters or digits.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
### Example
This example shows how `isAlphanumeric` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import isAlphanumeric from dw::core::Strings
output application/json
---
{
 "a": isAlphanumeric(null),
 "b": isAlphanumeric(""),
 "c": isAlphanumeric(" "),
 "d": isAlphanumeric("abc"),
 "e": isAlphanumeric("ab c"),
 "f": isAlphanumeric("ab2c"),
 "g": isAlphanumeric("ab-c")
}
```

#### Output
```
{
 "a": false,
 "b": false,
 "c": false,
 "d": true,
 "e": false,
 "f": true,
 "g": false
}
```

## isAlphanumeric(text: Null): Boolean
Helper function that enables `isAlphanumeric` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._
Mule 4 for Mule 3 Users | MuleSoft Documentation
# Mule 4 for Mule 3 Users
Mule 4 improvements make it easier to learn, develop, and manage than Mule 3. Benefits include:
  * Easier and faster app development
  * Seamless access and data mapping
  * Simplified connectivity
  * Auto-tuned and highly performant runtime
  * Seamless upgrades of Mule runtime engine and connector versions
  * Up to 50% fewer steps and concepts to learn than Mule 3


If you are currently running Mule 3 applications, read this documentation to get an overview of the Mule 4 capabilities and to learn the differences between Mule 3 and Mule 4, to know when to migrate to Mule 4, and to understand what is required to migrate apps to Mule 4.
To understand the options for migrating your apps from Mule 3 to Mule 4, review Migration to Mule 4.
Automation Management | MuleSoft Documentation
# Automation Management
The **Automation Management** widget shows the progress of your process automation based on the distribution of the projects to the different phases of the lifecycle of a project.
You can choose which project categories are to be shown in the graphic. You can also include processes that are still being evaluated.
Rename the widget in accordance with the project categories it contains.
## Data Representation
The distribution across the phases of the lifecycle is shown as a colored pie chart.
In each case, the total number of selected processes for each phase is displayed.
## Configuration
Select a single category or multiple categories in sequence from the drop-down list.
Select the checkbox **Evaluations included** if you wish to include processes that are still being evaluated.
## Drill-down
This widget does not contain any drill-down data.
leftPad | MuleSoft Documentation
# leftPad
## leftPad(text: String, size: Number, padText: String = " "): String
The specified `text` is _left_ -padded to the `size` using the `padText`. By default `padText` is `" "`.
Returns left-padded `String` or original `String` if no padding is necessary.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
The input string.  
The size to pad to.  
The text to pad with. It defaults to one space if not specified.  
### Example
This example shows how `leftPad` behaves with different inputs and sizes.
#### Source
```
%dw 2.0
import * from dw::core::Strings
output application/json
---
{
  "a": leftPad(null, 3),
  "b": leftPad("", 3),
  "c": leftPad("bat", 5),
  "d": leftPad("bat", 3),
  "e": leftPad("bat", -1)
}
```

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

## leftPad(text: Null, size: Any, padText: Any = " "): Null
Helper function that enables `leftPad` to work with a `null` value.
_Introduced in DataWeave version 2.2.0._
Mule SDK Development Best Practices | MuleSoft Documentation
# Mule SDK Development Best Practices
The purpose of this documentation is to provide users of the Mule SDK with best practices for building modules and connectors in a way that makes the best use of Mule runtime engine (Mule) functionality and is consistent with MuleSoft’s UX and quality guidelines.
## Terminology
This documentation uses these special terms: 

Connector
    
A module that establishes connections to an external system. A connector is a module. 

Large String
    
A String larger than 4 KB in size. 

Module
    
A plugin built through the Mule SDK that extends the functionality of Mule 4. 

Mule language
    
The XML-based domain-specific language (DSL) used to write Mule applications and through which a module is used inside an operation. 

Must
    
The word "must" denotes a hard rule. This means that to be considered compliant with best practices, a module has to comply with all the practices described with this term. 

Should
    
This word "should" denotes a rule that, although recommended, could be skipped in certain cases and the module would still be compliant with best practices. 

Target system
    
The resource that a connector accesses. 

User
    
This refers not to the user of the Mule SDK (the one coding the module), but to the end user who consumes the module that a developer produces. All best practices are ultimately aimed at improving the end user’s experience.
## MuleSoft Coding Practices
Using the SDK to create a new module or connector **should not** be approached as simply wrapping an API, library, or piece of functionality into a component that Mule can understand.
Instead, the problem **should** be approached as “extending a programming language called Mule.”
If you were to create a new library for the C programming language or your own Java framework, you would design library APIs, syntax, and semantics so that a C or Java developer consuming that library finds it consistent and compliant with all the rules and guidelines inherent to that ecosystem. Failing to do so results in unhappy consumers with unmet expectations for consistency and clarity.
The same applies to a custom Mule module or connector, which needs to be approached not as just creating a Mule bridge, but as an extension to the Mule language that provides additional functionality in a consistent, usable, and organic way.
## See Also
  * MuleSoft Help Center
MuleSoft Accelerator for Consumer Goods | MuleSoft Documentation
# MuleSoft Accelerator for Consumer Goods
MuleSoft Accelerator for Consumer Goods helps consumer goods companies integrate their digital operations to gain visibility into trade promotion management and retail execution. Our foundational assets are expertly designed to jumpstart your top integration and business initiatives so that IT teams can spend more time innovating and less time building from scratch.
## Use Cases
### Product and Account Integration with Hierarchies
The Product and Account Integration with Hierarchies use case surfaces relevant product, customer, demand planning, and pricing information from ERP and PIM systems and easily consolidate this information into Trade Promotion Management (TPM) platforms like Salesforce Consumer Goods Cloud for informed promotional planning.
### Retail Execution
The Retail Execution use case unlocks shelf data to enable perfect retail execution with pre-built assets. Access store audit data from image recognition software, like Trax, and smoothly integrate into Retail Execution platforms, such as Salesforce Consumer Goods Cloud, to monitor at shelf performance in one platform.
### Trade Promotion Effectiveness
The Trade Promotion Effectiveness use case allows you to visualize your promotions in one integrated platform with pre-built assets that integrate Business Intelligence Tools (BI Tools), such as CRM Analytics, into a TPM platform like Salesforce Consumer Goods Cloud.
## See Also
  *   *   *   * MuleSoft Accelerator for Consumer Goods on Exchange
Email Connector Examples 1.6 | MuleSoft Documentation
# Email Connector Examples 1.6
To fully benefit from using Anypoint Connector for Email (Email Connector), see the following examples to configure the connector.
  * Send Emails and Attachments Configure the **Send** operation to send emails and attachments over SMTP or SMTPS servers.
  * List Emails Configure Email Connector and IMAP or POP3 protocols to list emails.
  * Connect to Gmail Configure Email Connector and IMAP, POP3, and SMTP protocols to connect to your Gmail account.
  * Trigger a Flow When Receiving a New Email Configure the **On New Email - IMAP** or **On New Email - POP3** sources to retrieve all the emails in an IMAP or POP3 mailbox, and generate a new message for each unread email found. Additionally, configure the **Delete After Retrieve** , **Enable Watermark** , **IMAP Matcher** or **POP3 Matcher** , **Attachment Naming Strategy** , and **Enable Remote Search** parameters for these sources.
  * Set Parsing Text File Attachment as Body Message Set the system property `parsing.text.attachment.as.body` to change the behavior of parsing attached text files when the file is the only content in the message.
  * Move Messages Between Folders for IMAP/S Connection Providers Configure the **Move to folder** operation to move messages between folders for IMAP and IMAPS connection providers.
  * Count messages with Email Connector Configure the **Count messages - IMAP** and **Count messages - POP3** operations get the total amount of messages in a specified mailbox folder.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Flex Gateway Policy Development Kit (PDK) Overview | MuleSoft Documentation
# Flex Gateway Policy Development Kit (PDK) Overview
Policies enforce regulations to help manage security, control traffic, and improve API adoption. Flex Gateway provides many included policies, but they might not cover all your specific business needs.
Flex Gateway Policy Development Kit (PDK) is a software development kit that enables you to develop custom policies with ease.
PDK provides instructions to guide you through the policy development lifecycle, from implementing your Rust source code to releasing your policy on Exchange. Like included policies, you can apply custom policies to Flex Gateway running in Connected Mode by using API Manager or to Flex Gateway running in Local Mode by using YAML configuration files.
PDK also provides example policies to help you get started with policy development.
Watch the PDK Product Spotlight video to see a quick overview of PDK.
## See Also
  * Review the architecture
  * Review the prerequisites
Configuring Agent Operations | MuleSoft Documentation
# Configuring Agent Operations
## Configure the Agent Define Prompt Template Operation
Use the **Agent define prompt template** operation to use specific prompt templates with your LLMs. This allows you to create natural language prompts that generate responses, extract information, invoke other prompts, or perform any text-based task.
To configure the **Agent define prompt template** operation:
  1. Select the operation on the Anypoint Code Builder or Studio canvas.
  2. In the **General** properties tab for the operation, enter these values:
     * **Dataset**
Specify the dataset for the LLM to evaluate using the provided template and instructions.
     * **Template**
Enter the prompt template for the operation.
     * **Instructions**
Provide the instructions for the LLM, outlining the goals of the task. This is the XML for this operation:


```
<ms-chainai:agent-define-prompt-template
 doc:name="Agent define prompt template"
 doc:id="f1c29c39-eac9-468c-9c46-4109a66303ec"
 config-ref="MuleChain_AI_Llm_configuration"
 template="#[payload.template]"
 instructions="#[payload.instructions]"
 dataset="#[payload.dataset]"
/>
```

This image shows an example of the configuration for the Agent define prompt template action in Anypoint Code Builder: 
### Output Configuration
This operation responds with a JSON payload containing the main LLM response. Additionally, attributes such as token usage are included as part of the metadata (attributes) but not within the main payload.
This is an example response:
```
{
 "response": "{\n \"type\": \"positive\",\n \"response\": \"Thank you for your positive feedback on the training last week. We are glad to hear that you had a great experience. Have a nice day!\"\n}"
}
```

The operation also returns attributes that aren’t within the main JSON payload, which include information about token usage, for example:
```
{
 "tokenUsage": {
   "outputCount": 9,
   "totalCount": 18,
   "inputCount": 9
 },
 "additionalAttributes": {}
}
```

  * `tokenUsage`
Token usage metadata returned as attributes
  * `outputCount`
Number of tokens used to generate the output
  * `totalCount`
Total number of tokens used for input and output
  * `inputCount`
Number of tokens used to process the input


## See Also
  * Using Anypoint Code Builder to Configure a Connector
  * Using Studio to Configure a Connector
  * MuleSoft AI Chain Connector Reference
  * MuleSoft AI Chain - Additional Configuration Information
  * MuleSoft Help Center
Close Web Session | MuleSoft Documentation
# Close Web Session
The action step _Close Web Session_ enables you to close a web session.
To do so, the action step must be mapped to an existing web session ID, to enable unique identification of the web session to be closed.
The action step _Close Web Session_ can only be placed outside of a web session.
## Properties
**Force error state if session could not be closed** If you activate this option, an error state is forced if the web session could not be opened or has already been closed. If this option is not set (default), the error is simply ignored.
## Inbound Variables
**Web Session ID** The web session ID identifies the web session to be closed.
**Force error state if session could not be closed** If you activate this option, an error state is forced if the web session could not be opened or has already been closed. If this option is not set (default), the error is simply ignored.
## Outbound Variables
**Web Session closed** Indicates whether or not the web session was closed.
Dtd (dw::xml::Dtd) | MuleSoft Documentation
# Dtd (dw::xml::Dtd)
This module contains helper functions for working with XML doctype declarations.
To use this module, you must import it to your DataWeave code, for example, by adding the line `import * from dw::xml::Dtd` to the header of your DataWeave script.
_Introduced in DataWeave version 2.5.0._
## Functions
Name | Description  
---|---  
| Transforms a `DocType` value to a string representation.
Protecting App Property Values | MuleSoft Documentation
# Protecting App Property Values
CloudHub 2.0 enables you to protect application property values by displaying the property name but not its value, in Anypoint Runtime Manager.
Additionally, the value is not viewable or retrievable by any user. CloudHub 2.0 resolves the property internally at runtime. These protected application values are encrypted and stored in the Anypoint Security secrets manager, which, in turn, is encrypted per user organization. Because the values are encrypted, you cannot view them in Anypoint Security secrets manager or Anypoint Runtime Manager.
Protected property values are separate from the encrypted Mule application properties stored in secure configuration files. See Secure Configuration Properties.   
---  
## Protect Property Values in Runtime Manager
Set protected properties via the table view for granular control over each property and value.
Although you can attempt to protect a single property more than once, Runtime Manager issues a warning and protects only the final instance of that property.
  1. From Anypoint Platform, select **Runtime Manager** > **Applications**.
  2. Click the app name.
  3. In the navigation menu, click **Settings**.
  4. On the **Settings** page, click the **Properties** tab.
  5. Depending on how many properties you want to protect, choose either:
     * To protect properties one at a time, click **Table view**.
     * To protect multiple properties, use **Text view** to add the key-value pairs, switch to **Table view** , and continue to Step 8 to protect the properties.
  6. In the **New Key** field, enter the property name to protect.
  7. In the **New Value** field, enter the property value.
  8. In the value field, click **Protect** and then click **Protect value** to confirm.
  9. Depending on the deployment status, choose either:
     * If this application is deployed, click **Apply Changes**.
     * If you’re ready to deploy the application, click **Deploy Application**.


On the **Properties** tab, the values for properties that you just protected are now no longer visible to you or any other user.
In the following example, the values for `birthdate` and `password` are protected, but the value for `username` is not:
After you commit the values and deploy the app, the protected property values don’t appear in the console and aren’t sent and received between the console and CloudHub.
## Replace a Protected Property Value
After you set the property value, you can’t retrieve it. However, you can replace the protected property value with a new protected value:
  1. From Anypoint Platform, select **Runtime Manager** > **Applications**.
  2. Click the app name.
  3. In the navigation menu, click **Settings**.
  4. On the **Settings** page, click the **Properties** tab.
  5. Click **Table view**.
  6. Click **…​** > **Replace protected value** :
  7. Enter a new value in the field.
  8. Click **Apply** , then **Apply Changes**.


## See Also
  * Secure Configuration Properties
  * Changing App Behavior with Properties
  * Deploying Apps to CloudHub 2.0
Generating API Documentation With Einstein Generative AI | MuleSoft Documentation
# Generating API Documentation With Einstein Generative AI
Use Einstein generative AI to generate API documentation for REST APIs in Exchange and streamline how your organization manages APIs. By using AI, you can simplify your API documentation processes. Generative AI creates API documentation that is consistent, accurate, and current. This frees you to focus on strategic tasks and enhances developer satisfaction.
You can create documentation for single file REST APIs that don’t have any documentation. From the asset details page in Exchange, generate the documentation, then manually edit and improve the documentation. After that, publish it to make it available to everyone in your organization.
This release supports:
  * REST APIs
  * Single file format
Multi-format files and fragments aren’t supported.


## Documentation Structure
AI-generated documentation in Anypoint Exchange standardizes API documentation, addressing inconsistency and incompleteness. The structure and format of the generated documentation is standardized across each API including fonts, headers, text size.
Generated documentation includes:
  * Overview and purpose of the API
  * Authentication requirements and security details
  * Base URL and environments
  * Detailed endpoint documentation including:
    * Request and response examples
    * Query parameters
    * Path parameters
    * Request body schemas
    * Response codes and examples
  * Error handling and status codes
  * Best practices for implementation
  * Sample code snippets


## Before You Begin
Before generating API documentation with Einstein, you must have a Salesforce org or trial account with Einstein enabled in Anypoint Platform. To enable Einstein in Anypoint Platform, see Enable Einstein for Your Anypoint Platform Organization.
Einstein is a usage-based product. For more information, see Generative AI Usage and Billing.
## Generate API Documentation with Einstein
Generate documentation for REST APIs that don’t have any documentation. You can edit and save a draft as many times as you like before publishing. Drafts aren’t visible to others until they’re published.
  1. Select the API from the catalog and click **Generate documentation** from the asset details page.


  1. Review the generated documentation in draft mode. Discard to delete the draft, or edit or publish it.
  2. To edit the AI-generated documentation, click **Edit** in draft mode, make your changes, and save the draft or publish it.
Publishing the documentation makes it available to everyone in your organization.


See Edit Asset Documentation, for more information about editing asset documentation.
Servers, Server Groups, and Clusters | MuleSoft Documentation
# Servers, Server Groups, and Clusters
Private Cloud Edition 
Use Runtime Manager to register and set up the properties of servers, server groups, and clusters that reside on-premises. After setting up a server, you can add it to a server group or cluster. Then, select the server, group, or cluster as the deployment target for your applications.
## Server Groups and Clusters
Both server groups and clusters run applications in multiple distributed nodes. When using a server group, instances of the applications are completely isolated from each other. In a cluster configuration, the nodes are aware of one another and share common information and synchronize statuses.
All servers in a server group or clusters must have the same Mule runtime engine version and Runtime Manager agent version.
## Alerts
You can set up email alerts to notify you when events occur on your servers, such as a server being disconnected or a server being removed from a cluster. You can link alerts to a specific server or to all of the servers in the server group or cluster.
## See Also
  *   * Deploy Applications to Your Servers
  * Manage Applications on Your Servers
  * Deployment and Server Scaling
  * Mule High Availability Clusters
  *
Timer Types (dw::util::Timer) | MuleSoft Documentation
# Timer Types (dw::util::Timer)
Type | Definition | Description  
---|---|---  
DurationMeasurement |  `type DurationMeasurement = { time: Number, result: T }` |  A return type that contains the execution time and result of a function call.  
TimeMeasurement |  `type TimeMeasurement = { start: DateTime, result: T, end: DateTime }` |  A return type that contains a start time, end time, and result of a function call.
Configure Driver Visibility using Mule Maven Plugin | MuleSoft Documentation
# Configure Driver Visibility using Mule Maven Plugin
Although Anypoint Studio enables you to configure database driver dependencies without problems in most cases, there are some scenarios where you must use the Mule Maven Plugin to properly set up the driver classes' visibility because of class loading isolation mechanisms.
## Configure Driver Visibility Across the Application
To configure additional database driver dependencies and make the driver visible across components within your Mule application, refer to the Configure Shared Libraries section in the Mule Maven Plugin documentation.
## Configure Driver Visibility Only for the Connector
When there is a risk of dependencies colliding and it’s necessary to have the Database Connector and the driver’s dependencies in the same class loader, to make the driver visible only for the connector, refer to the Configure Additional Plugin Dependencies section in the Mule Maven Plugin documentation.
Be aware of which component must establish the connection with the database, as the driver must be in the scope of that component’s class loader. For example, if a Mule application uses a datasource reference connection and targets a Spring bean datasource definition, it is the Spring’s class loader that requires the database library, not the database. Configure additional application dependencies using _shared libraries_.   
---  
## See Also
  *   * Database Connector Reference
  * MuleSoft Help Center
Using Permissions for Anypoint DataGraph | MuleSoft Documentation
# Using Permissions for Anypoint DataGraph
Anypoint DataGraph provides access management permissions so you can meet your organization’s security requirements and at the same time drive collaboration across teams.
Permissions for Anypoint DataGraph are independent of permissions for other Anypoint Platform products.
To contribute to the unified schema, you need to have the **Exchange Viewers** permission for the business group from which you want to add APIs. Refer to Set User Access Permissions for more information.
The following permissions are available per business group per environment:
Permission | Description  
---|---  
Permission to:
  * Contribute, consume, and operate the unified schema
  * View usage metrics

  
Contribute |  Permission to:
  * Add source APIs to the unified schema
  * Edit any source API schema added to the unified schema
  * Request access to run queries
  * Promote API schemas to an environment
  * View query traces in real time while running queries from the UI
  * Download a copy of the unified schema from the query editor

  
Permission to:
  * View and explore the unified schema
  * Request access to run queries and make data requests from the UI
  * Download a copy of the unified schema from the query editor

  
Permission to:
  * View customer-facing logs
  * Set a dedicated load balancer URL for Anypoint Datagraph

  
## Additional Resources
  * For more information on setting Anypoint DataGraph SLA tiers and managing contracts, refer to DataGraph Administration in the API Manager documentation.
  * For instructions on setting up user permissions and roles for Anypoint DataGraph, refer to Granting Permissions and Roles to Users
Database Connector XML and Maven Support | MuleSoft Documentation
# Database Connector XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio.
If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
When you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file.
## Add a Namespace for the Connector
Paste the following code inside the `<mule>` tag of the header of your configuration XML:
```
http://www.mulesoft.org/schema/mule/db
http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
```

This example shows how the namespace statements are placed in the `<mule>` XML block:
```
<mule xmlns:db="http://www.mulesoft.org/schema/mule/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/database
	http://www.mulesoft.org/schema/mule/database/current/mule-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>org.mule.connectors</groupId>
 <artifactId>mule-db-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 `database`.
  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
Salesforce Composite Connector 2.11 | MuleSoft Documentation
# Salesforce Composite Connector 2.11
Anypoint Connector for Salesforce Composite enables you to work with the Salesforce Batch and SObject Tree APIs. The connector exposes convenient methods for preparing subordinate requests, executing them in one batch, and parsing the results.
Salesforce Composite Connector also enables you to create SObject trees by using the **Create sobject tree** operation, which is separate from the batch operations.
This connector provides DataSense for execution and to:
  * Prepare subordinate requests and then parse the responses
  * Create SObject trees


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


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


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


For information about configuring these authentication types, see Using Anypoint Studio to Configure Salesforce Composite Connector.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * MuleSoft Help Center