BassemE/mulesoft-documentation-embeddings huggingface dataset:
Salesforce CDP Connector 1.1 - XML and Maven Support | MuleSoft Documentation
# Salesforce CDP Connector 1.1 - XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio:
  * If you manually code a Mule runtime engine (Mule) app in XML either from the Anypoint Studio XML editor or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
  * If you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml` file.


## Add a Namespace for the Connector
Paste the following code inside the `mule` tag of the header of your configuration XML:
```
http://www.mulesoft.org/schema/mule/sdc
http://www.mulesoft.org/schema/mule/sdc/current/mule-sdc.xsd
```

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

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. When you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector:
```
<dependency>
 <groupId>com.mulesoft.connectors</groupId>
 <artifactId>mule4-sdc-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 `salesforce cdp`.
  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
MuleSoft Automation Credits 2.0 | MuleSoft Documentation
# MuleSoft Automation Credits 2.0
Your MuleSoft Automation subscription plan includes a quota of Automation Credits that depletes as you create and execute automations. You can use Automation Credits with MuleSoft Composer, MuleSoft IDP, MuleSoft RPA, Salesforce Flow Orchestration, MuleSoft for Flow: Integration, or a combination of these products.
The following table shows the conversion rate between Automation Credits and different activities:
RPA Bot Minutes | RPA API Calls | Composer Tasks | Flow Orchestration Runs | IDP Document Pages | Integration Tasks  
---|---|---|---|---|---  
1 = 80 Automation Credits | 1 = 2 Automation Credits | 1 = 2 Automation Credits | 1 = 100 Automation Credits | 1 = 25 Automation Credits | 1 = 2 Automation Credits  
For detailed definitions and more information, see MuleSoft Subscription Plan.
## Generative AI
The services contain features that use generative AI technology that may be provided by one or more third-parties as listed in the documentation applicable to the services. This documentation provides information and product requirements specific to these generative AI features and providers, including applicable third-party acceptable use policies which the customer must comply with when using the generative AI technology. Due to the nature of generative AI, the output that it generates may be unpredictable, and may include inaccurate or harmful responses. Before using any generative AI output, the customer is solely responsible for reviewing the output for accuracy, safety, and compliance with applicable laws and third-party acceptable use policies. The customer assumes all responsibility for output generated by the services and, as between Salesforce and the customer, such output is customer data.
Einstein supports these predictive models:
  * OpenAI’s `GPT-4o (gpt-4o-2024-08-06)` LLM
  * OpenAI’s `GPT-4o Mini (gpt-4o-mini-2024-07-18)` LLM
  * Google’s `GEMINI-2.0 Flash 001` LLM


Einstein accesses these models through the Salesforce Einstein Trust layer, which is part of the Salesforce Einstein platform.
Select the model to use during document analysis by clicking **Settings** in the document action editor.
Einstein doesn’t use customer data to train any models for document analysis in IDP.   
---  
## See Also
  * Mulesoft Composer: Overview
  * MuleSoft Composer: Getting Started
  * Composer Connector Reference
  * Knowledge Articles
  * Automation Credits Usage and Rates
Header Removal Policy | MuleSoft Documentation
# Header Removal Policy
**Policy name** | Header Removal  
---|---  
Removes headers from a request or a response  
Transformation  
**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: user-agent, accept, host, content-type, content-length, date, transfer-encoding, connection,   
---  
## Configuring Policy Parameters
### Mule Gateway
When you apply the Header Removal policy to your API from the UI, you can configure the following parameters:
**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
Unrecognized standard from unrecognized partner | MuleSoft Documentation
# `Unrecognized standard from unrecognized partner`
You might occasionally see tracking information such as this in the Activity section of Anypoint Partner Manager:
```
Unrecognized standard from unrecognized partner
Received <date>
File <name>
```

## Causes
This information appears in the Activity section when one of the following occurs:
  * Partner Manager receives a transmission that is in an unsupported data format: for example, receiving a PDF, image, and so forth on receiving endpoints.
  * Your partner sends you a valid X12 file but you have not configured a message flow that can accept it.
  * You do not recognize the partner because you did not set them up in Anypoint Partner Manager.


## Solution
If you encounter any of these situations, verify that your partner is sending valid X12-formatted files that align with the message flows that you associated with that partner.
Azure Key Vault Connector 1.2 XML and Maven Support | MuleSoft Documentation
# Azure Key Vault Connector 1.2 XML and Maven Support
Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio:
  * If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file.
  * If you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml` file.


## Add a Namespace for the Connector
Paste the following code inside the `<mule>` tag of the header of your configuration XML:
```
http://www.mulesoft.org/schema/mule/azure-key-vault
http://www.mulesoft.org/schema/mule/azure-key-vault/current/mule-azure-key-vault.xsd
```

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

## Add a POM File Dependency
The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. When you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector:
```
<dependency>
 <groupId>com.mulesoft.connectors</groupId>
 <artifactId>mule4-azure-key-vault-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 `Azure Key Vault`.
  4. Select the connector.
  5. Click **Dependency Snippets** near the upper right of the screen.


## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
Configuring and Managing Flows | MuleSoft Documentation
# Configuring and Managing Flows
After you collect the information described in the preparation checklist, you can then build, activate, and monitor your flows. Building a flow involves creating a new flow or cloning an existing flow; adding and testing a trigger; adding and testing each action to be performed by the flow, in the order that you want each action performed; and finally testing the completed new flow before activating it.
Test each trigger and action as you add it to your flow.
## Flow Details Page
Access the **Flow Details** page to see details about your flow:
The name of the flow.  
---  
Details about the flow: 
  1. **Created On** : The date on which the flow was created in the time zone set in your browser.
  2. **Flow ID** : The ID of the flow.
  3. **Flow Owner** : The owner of the flow.
  4. **Last Modified** : The date on which the flow was last modified in the time zone set in your browser.
  5. **Status** : The status or the flow. The status can be either active or inactive.
  6. **Last Triggered** : The date on which the flow was most recently triggered. This field displays the last time the flow was triggered by either an Event poll or the Scheduler.

  
The **Run History** of the flow. Composer stores up to 1000 records per flow and can include only the last two weeks of data. For example, for a flow that produces 10 records per day, you can see the Run History for the last two weeks of data (14 x 10 = 140 records). For a flow that produces 100 records per hour, you can see no more than 10 hours of the Run History. Triggering a flow via the Scheduler always creates an entry in the Run History. An entry in the Run History is only added by an Event trigger when a record is either created or updated and passes any filter condition. 
  1. **Start Date** : The date on which the flow started in the time zone set in your browser.
  2. **End Date** : The date on which the flow ended in the time zone set in your browser.
  3. **Status** : The status of the flow. The status can be either `SUCCESS` or `FAILED`.
  4. **Reference ID** : The ID of the record or execution that triggered the flow. For Event triggers, the value in this field is the corresponding **Record ID**. For events triggered by the Scheduler, a unique **Execution ID** value is created for the run instance.
  5. **Error** : If a flow fails, the error message for the failure appears.

  
The flow actions. You can delete, clone, or view an active flow. Note that if the flow is inactive, you can edit the flow.  
The **Run History** actions. You can refresh the **Run History** section or filter the section by specified criteria.  
## See Also
  * Mulesoft Composer: Overview
  * MuleSoft Composer: Getting Started
  * Composer Connector Reference
  * Knowledge Articles
Create an API Specification with the Visual API Editor | MuleSoft Documentation
# Create an API Specification with the Visual API Editor
You can use API Designer’s visual API editor to scaffold API specifications in RAML 1.0 or in OAS 2.0 or 3.0 (JSON). You do so by populating language-neutral forms.
## Before You Begin
Within Anypoint Platform, your user ID must be assigned the _Design Center Developer_ permission.
## About this task
The visual API editor is divided into three panels:
### The Left Panel
This panel displays the name of the API specification being developed. It also provides controls that allow you to create resources, data types, and security schemes. These components all are included within the body of the specification and are not created as separate files.
### The Middle Panel
This panel presents the forms in which you specify the properties of the components of the specification. When the editor first opens, it displays a form for specifying the main properties of the specification and for documenting it. Click on the name of an item in the left panel to open its form in the middle panel.
### The Right Panel
This displays the RAML Viewer and the OAS Viewer, both of which are read-only. Click the tabs at the bottom of the panel to switch between them. These viewers display the current draft of the specification in either RAML 1.0 or OAS 3.0. As you enter values in the forms that appear in the middle panel, the draft is updated with the values.
This panel also lets you run the mocking service to test endpoints that you have set up.
## Procedure
  1. On the **Projects** page in Design Center, click **Create new**.
  2. Select **New API Specification**.
  3. In the **New API Specification** dialog, name your project.
You can change the name later, if you want to.
  4. Select the option **Guide me through it** to use the visual API editor.
  5. Click **Create API Spec.**
_Result:_ The visual API editor opens.
As you make progress, you can run the mocking service to simulate calls to your API specification. For more information, view the topic "Simulate Calls to an API", which is listed in the **See Also** section at the end of this topic.
If at any time you want to edit the specification directly or customize it (import RAML fragments and more), click **Edit RAML** or **Edit OAS** to switch to the API editor. After you switch, however, you cannot switch back to the visual API editor to continue creating the API specification.


## What to Do Next
If you are satisfied with your API specification, you can publish it to Exchange in RAML 1.0. See Publish an API Specification.
Alternatively, you can customize the specification in the API editor by clicking **Edit RAML** or **Edit OAS**.
## See Also
  * Simulate Calls to an API
  * Publish an API Specification
  * Rename an Open Project
  * Delete an Open Project
read | MuleSoft Documentation
# read
## read(stringToParse: String | Binary, contentType: String = "application/dw", readerProperties: Object = {}): Any
Reads a string or binary and returns parsed content.
This function can be useful if the reader cannot determine the content type by default.
### Parameters
Name | Description  
---|---  
`stringToParse` | The string or binary to read.  
`contentType` | A supported format (or content type). Default: `application/dw`.  
`readerProperties` | Optional: Sets reader configuration properties. For other formats and reader configuration properties, see Supported Data Formats.  
### Example
This example reads a JSON object `{ "hello" : "world" }'`, and it uses the `"application/json"` argument to indicate _input_ content type. By contrast, the `output application/xml` directive in the header of the script tells the script to transform the JSON content into XML output. Notice that the XML output uses `hello` as the root XML element and `world` as the value of that element. The `hello` in the XML corresponds to the key `"hello"` in the JSON object, and `world` corresponds to the JSON value `"world"`.
#### Source
```
%dw 2.0
output application/xml
---
read('{ "hello" : "world" }','application/json')
```

#### Output
```
<?xml version='1.0' encoding='UTF-8'?><hello>world</hello>
```

### Example
This example reads a string as a CSV format without a header and transforms it to JSON. Notice that it adds column names as keys to the output object. Also, it appends `[0]` to the function call here to select the first index of the resulting array, which avoids producing the results within an array (with square brackets surrounding the entire output object).
#### Source
```
%dw 2.0
var myVar = "Some, Body"
output application/json
---
read(myVar,"application/csv",{header:false})[0]
```

#### Output
```
{ "column_0": "Some", "column_1": " Body" }
```

### Example
This example reads the specified XML and shows the syntax for a reader property, in this case, `{ indexedReader: "false" }`.
#### Source
```
%dw 2.0
output application/xml
---
{
  "XML" : read("<prices><basic>9.99</basic></prices>",
        "application/xml",
        { indexedReader: "false" })."prices"
}
```

#### Output
```
<?xml version='1.0' encoding='UTF-8'?>
<XML>
 <basic>9.99</basic>
</XML>
```
replaceAll | MuleSoft Documentation
# replaceAll
## replaceAll(text: String, target: String, replacement: String): String
Replaces all substrings that match a literal search string with a specified replacement string.
Replacement proceeds from the beginning of the string to the end. For example, the result of replacing `"aa"` with `"b"` in the string` `"aaa"` is `"ba"`, rather than `"ab"`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The string to search.  
The string to find and replace in `text`.  
`replacement` | The replacement string.  
### Example
This example shows how `replaceAll` behaves with different inputs.
#### Source
```
import * from dw::core::Strings
output application/json
---
{
  a: replaceAll("Mariano", "a" , "A"),
  b: replaceAll("AAAA", "AAA" , "B"),
  c: replaceAll(null, "aria" , "A"),
  d: replaceAll("Mariano", "j" , "Test"),
}
```

#### Output
```
{
  "a": "MAriAno",
  "b": "BA",
  "c": null,
  "d": "Mariano"
 }
```

## replaceAll(text: Null, oldValue: String, newValue: String): Null
Helper function that enables `replaceAll` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
API Autodiscovery | MuleSoft Documentation
# API Autodiscovery
Configuring autodiscovery allows a deployed Mule runtime engine (Mule) application to connect with API Manager to download and manage policies and to generate analytics data. Additionally, with autodiscovery, you can configure your Mule applications to act as their own API proxy.
When autodiscovery is correctly configured in your Mule application, you can say that your application’s API is _tracked by_ (green dot) or _paired to_ API Manager. You can associate an API in a Mule setup with only one autodiscovery instance at a given time.
## Prerequisites
To configure autodiscovery for your Mule application, ensure that:
  * The API exists in API Manager and is configured as either a basic endpoint, or a proxy endpoint.
  * The Mule application is configured to use Anypoint Platform credentials.
The platform credentials give your application access to the API Configuration in API Manager. You must configure your platform credentials before starting Mule.
  * The autodiscovery element is configured in your Mule application.
This XML element must point to the specific API in API manager which you want to pair to.


## Proxy Endpoint vs Basic Endpoint
If you configured a proxy endpoint, your autogenerated proxy is already correctly configured with the autodiscovery element. Additionally, if you want to take advantage of the platform deployment capabilities, such as 1-Click deployment, the API Manager credentials are automatically set for you.
## See Also
  * Configuring API Autodiscovery in a Mule 4 Application
  * Configuring API Autodiscovery in a Mule 3 Application
  * Configuring Organization Credentials in Mule Runtime 4
  * Configuring Organization Credentials in Mule Runtime 3
then | MuleSoft Documentation
# then
## then(value: Null, callback: (previousResult: Nothing) -> Any): Null
Helper function that enables `then` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
## then<T, R>(previous: T, callback: (result: T) -> R): R
This function works as a pipe that passes the value returned from the preceding expression to the next (a callback) only if the value returned by the preceding expression is not `null`.
_Introduced in DataWeave version 2.4.0._
### Parameters
Name | Description  
---|---  
The value of the preceding expression.  
Callback that processes the result of `previous` if the result is not `null`.  
### Example
This example shows how to use `then` to chain and continue processing the result of the previous expression.
#### Source
```
%dw 2.0
output application/json
---
{
  "chainResult": ["mariano", "de Achaval"]
      reduce ((item, accumulator) -> item ++ accumulator)
      then ((result) -> sizeOf(result)),
  "referenceResult" : ["mariano", "de Achaval"]
             map ((item, index) -> upper(item))
             then {
              name: $[0],
              lastName: $[1],
              length: sizeOf($)
            },
  "onNullReturnNull": []
        reduce ((item, accumulator) -> item ++ accumulator)
        then ((result) -> sizeOf(result))
}
```

#### Output
```
{
  "chainResult": 17,
  "referenceResult": {
   "name": "MARIANO",
   "lastName": "DE ACHAVAL",
   "length": 2
  },
  "onNullReturnNull": null
 }
```
Preparing Deployment | MuleSoft Documentation
# Preparing Deployment
To reduce the time involved and the error rate in the maintenance of automations, you can create reusable data containers:
Data Container Type | Usage | Linkable to  
---|---|---  
Global Variables |  Store values of the types:
  * Alphanumeric
  * Integer
  * Float
  * Boolean
  * Coordinates

| Activity parameters in run configurations of process automations  
Credentials | Store login data for external applications and web services | Activity parameters in run configurations of process automations  
## See Also
  * RPA Builder: Activity Paramters
  * Linkable Activity Parameters in Test Configurations
  * Linkable Activity Parameters in Production Configurations
  * Linkable Activity Parameters in Invocable Configurations
Amazon EC2 Connector 2.4 | MuleSoft Documentation
# Amazon EC2 Connector 2.4
Anypoint Connector for Amazon EC2 (Amazon EC2 Connector) provides connectivity to the Amazon Elastic Compute Cloud (Amazon EC2) API, enabling you to interface with Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage.
## Before You Begin
To use Amazon EC2 Connector, you must be familiar with:
  * The Amazon EC2 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:
  * AWS Identity and Access Management (IAM) user account credentials
  * A secret access key to IAM
  * Access to EC2 via the AWS cloud


## Common Use Cases for the Connector
Common use cases for the connector include:
  * Creating an EBS volume to attach to an instance in the same availability zone
  * Attaching an EBS volume to a running or stopped Amazon EC2 instance
  * Restarting an Amazon EBS-backed AMI that you’ve previously stopped
  * Stopping an Amazon EC2 instance


## 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


## Authentication Types
Amazon EC2 Connector connections use the following authentication types:
  * Basic
Uses a session token provided by Amazon STS to connect to Amazon EC2
  * Role
Uses the Amazon role ARN that uniquely identifies the role to allow cross-account access


For information about configuring these authentication types, see Using Anypoint Studio to Configure Amazon EC2.
## Next Step
After you complete the prerequisites and try the examples, you are ready to create your own app and configure the connector using Using Anypoint Studio to Configure Amazon EC2 Connector.
## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Amazon EC2 Connector Reference
  * MuleSoft Help Center
toMilliseconds | MuleSoft Documentation
# toMilliseconds
## toMilliseconds(date: DateTime): Number
Returns the representation of a specified date-time in milliseconds.
### Parameters
Name | Description  
---|---  
A `DateTime` to evaluate.  
### Example
This example shows a date-time in milliseconds.
#### Source
```
%dw 2.0
import * from dw::util::Timer
output application/json
---
{ "toMilliseconds" : toMilliseconds(|2018-07-23T22:03:04.829Z|) }
```

#### Output
```
{ "toMilliseconds": 1532383384829 }
```
sizeOf | MuleSoft Documentation
# sizeOf
## sizeOf(array: Array<Any>): Number
Returns the number of elements in an array. It returns `0` if the array is empty.
This version of `sizeOf` takes an array or an array of arrays as input. Other versions act on arrays of objects, strings, or binary values.
### Parameters
Name | Description  
---|---  
The input array. The elements in the array can be any supported type.  
### Example
This example counts the number of elements in the input array. It returns `3`.
#### Source
```
%dw 2.0
output application/json
---
sizeOf([ "a", "b", "c"])
```

### Example
This example returns a count of elements in the input array.
#### Source
```
%dw 2.0
output application/json
---
{
 "arraySizes": {
   size3: sizeOf([1,2,3]),
   size2: sizeOf([[1,2,3],[4]]),
   size0: sizeOf([])
  }
}
```

#### Output
```
{
  "arraySizes": {
   "size3": 3,
   "size2": 2,
   "size0": 0
  }
}
```

## sizeOf(object: Object): Number
Returns the number of key-value pairs in an object.
This function accepts an array of objects. Returns `0` if the input object is empty.
### Parameters
Name | Description  
---|---  
The input object that contains one or more key-value pairs.  
### Example
This example counts the key-value pairs in the input object, so it returns `2`.
#### Source
```
%dw 2.0
output application/json
---
sizeOf({a: 1, b: 2})
```

### Example
This example counts the key-value pairs in an object.
#### Source
```
%dw 2.0
output application/json
---
{
  objectSizes : {
   sizeIs2: sizeOf({a:1,b:2}),
   sizeIs0: sizeOf({})
  }
}
```

#### Output
```
{
 "objectSize": {
  "sizeIs2": 2,
  "sizeIs0": 0
 }
}
```

## sizeOf(binary: Binary): Number
Returns the number of elements in an array of binary values.
### Parameters
Name | Description  
---|---  
The input array of binary values.  
### Example
This example returns the size of an array of binary values.
#### Source
```
%dw 2.0
output application/json
---
sizeOf(["\u0000" as Binary, "\u0001" as Binary, "\u0002" as Binary])
```

## sizeOf(text: String): Number
Returns the number of characters (including white space) in an string.
Returns `0` if the string is empty.
### Parameters
Name | Description  
---|---  
The input text.  
### Example
This example returns the number of characters in the input string `"abc"`.
#### Source
```
%dw 2.0
output application/json
---
sizeOf("abc")
```

### Example
This example returns the number of characters in the input strings. Notice it counts blank spaces in the string `"my string"` and that `sizeOf("123" as Number)` returns `1` because `123` is coerced into a number, so it is not a string.
#### Source
```
%dw 2.0
output application/json
---
{
 sizeOfSting2 : sizeOf("my string"),
 sizeOfEmptyString: sizeOf(""),
 sizeOfNumber : sizeOf("123" as Number)
}
```

#### Output
```
{
 "sizeOfSting2": 9,
 "sizeOfEmptyString": 0,
 "sizeOfNumber": 1
}
```

## sizeOf(n: Null): Null
Helper function that enables `sizeOf` to work with a `null` value.
_Introduced in DataWeave version 2.4.0._
Microsoft Teams Connector 1.0 | MuleSoft Documentation
# Microsoft Teams Connector 1.0
Anypoint Connector for Microsoft Teams (Microsoft Teams Connector) gives you access to the Microsoft Teams APIs. This connector exposes the most commonly used operations provided by the Microsoft Teams APIs.
For compatibility information and fixed issues, see the Microsoft Teams Connector Release Notes.
## Before You Begin
To use this connector, you must be familiar with:
  * The Microsoft Teams APIs
  * 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 target resource
  * Anypoint Studio version 7.3.5 or later


## Common Use Cases for the Connector
  * Send notifications
Users are notified in Microsoft Teams when a new resource is created or modified in another service, for example, when a new Salesforce case is created.
  * Onboard employees
When a group of people are hired at the same time, and human resources has an email in Gmail or a spreadsheet in Google Sheets that contains information about the new hires, HR can use the email or spreadsheet to trigger different actions:
    * Add users to a workspace
    * Create a channel for all new hires and use it to instantly share important onboarding information with them
    * Archive the new hire channel after onboarding is completed
After the onboarding process is completed, resources can be freed or reused for the next onboarding process.
  * Create new teams for business projects
Create teams for new business projects to streamline and automate the management of team members, for example:
    * After a new team is created for a new business project, the client can quickly and automatically integrate this new team by using Microsoft Teams.
    * After teams are created, as each new employee is hired, the client can automatically execute a series of actions to integrate the new hire by using Microsoft Teams.
    * When a team member is either removed or moved to another team, the client can execute a series of automated steps to reflect this change within Microsoft Teams.
    * When the business project ends, the resources allocated for that business project in Microsoft Teams can be reused or removed.
    * If a manager is hired or replaced, the corresponding group owner of the team can be changed.


## Authentication Types
Microsoft Teams Connector connections use the following OAuth 2.0 grant types:
  * OAuth 2.0 authorization code grant type, which uses an access token from the Microsoft identity platform for authentication
  * OAuth 2.0 client credentials grant type, which uses the identity of the application to access web-hosted resources


## See Also
  * Introduction to Anypoint Connectors
  * Use Exchange to Discover Connectors, Templates, and Examples
  * Microsoft Teams Reference
  * MuleSoft Help Center
writeLinesWith | MuleSoft Documentation
# writeLinesWith
## writeLinesWith(content: Array<String>, charset: String): Binary
Writes the specified lines and returns the binary content.
_Introduced in DataWeave version 2.2.0._
### Parameters
Name | Description  
---|---  
Array of items to write.  
String representing the encoding to use when writing.  
### Example
This example inserts a new line (`\n`) after each iteration. Specifically, it uses `map` to iterate over the result of `to(1, 10)`, `[1,2,3,4,5]`, then writes the specified content ("Line $"), which includes the unnamed variable `$` for each number in the array.
Note that without `writeLinesWith "UTF-8"`, the expression `{ lines: to(1, 10) map "Line $" }` simply returns an array of line numbers as the value of an object: `{ "lines": [ "line 1", "line 2", "line 3", "line 4", "line 5" ] }`.
#### Source
```
%dw 2.0
import * from dw::core::Binaries
output application/json
---
{ lines: to(1, 10) map "Line $" writeLinesWith "UTF-8" }
```

#### Output
```
{
 "lines": "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\n"
}
```
Anypoint MQ Release Notes | MuleSoft Documentation
# Anypoint MQ Release Notes
The following release notes are provided for Anypoint MQ:
  * Anypoint MQ Release Notes
  * Anypoint MQ Connector Release Notes for Mule 4
Retrieving the Unified Schema and Diagnostic Data | MuleSoft Documentation
# Retrieving the Unified Schema and Diagnostic Data
You can download a copy of the unified schema from the query editor or by using a third-party API client. You can download diagnostic data from the **List of APIs added** page in DataGraph.
The schema is downloaded as a `.graphql` file. Diagnostic data is downloaded as JSON files.
## Download the Unified Schema from the Query Editor
To download the schema from the query editor, you need the consumer, contributor, or admin permission.
  1. Navigate to the query editor.
  2. From the actions menu (**…​**), select **Download Schema**.


## Retrieve the Unified Schema Using an API Client
To retrieve a copy of the unified schema, you need the following:
  * The graph endpoint of your unified schema, which you can obtain from the homepage of Anypoint DataGraph.
  * The `client_id` and `client_secret` values you use to query the unified schema, which you can obtain from the Client Applications page in API Manager.


In the API client of your choice, run a GET request with the following information:
  * The graph endpoint of the unified schema appended with `/schema`
  * Your `client_id` and `client_secret` headers


For example, the complete command looks like:
```
curl https://<GRAPH_ENDPOINT>/schema \
-H 'client_id: <YOUR_CLIENT_ID>' \
-H 'client_secret: <YOUR_CLIENT_SECRET>'
```

## Download Diagnostic Data
When you download diagnostic data, DataGraph downloads diagnostic data for API sources you’ve added to that environment.
To download Source APIs, you need the contributor or admin permission.
  1. Navigate to the **List of APIs added** page.
  2. In the right-hand corner of the API list, click **…​** > **Download Diagnostic Data**.
Listen For A Reply | MuleSoft Documentation
# Listen For A Reply
Request and Reply is a very common pattern between applications. AMQP Connector provides an operation specially designed for this, called `publish-consume`. The `publish-consume` operation enables you to publish a message to any exchange, and then wait for a reply on a different destination.
When using this operation, the `replyTo` property of the outgoing message will contain the ID of the queue at which your app will be waiting for a response. This destination may be a well-known destination, or it may be a temporary queue created on the fly with the only purpose of receiving a single response message.
Finally, the result of the operation will be the message received as a response, with exactly the same structure as if a `consume` operation was invoked.
## Wait For A Reply On A Temporary Queue
Using a temporary Queue to wait for a response is very simple, just configure the message being sent and the operation will automatically wait for a response in a temporary queue:
```
<amqp:publish-consume
	config-ref="config"
	exchangeName="targetExchange"
	maximumWait="20"
	maximumWaitUnit="SECONDS"/>
```

In this example, the operation will `publish` a message with the current `payload` as its **body** and the **replyTo property** of the message configured to a temporary destination, to the `targetExchange`. Then, it will automatically try to consume the response from that temporary queue until a message is consumed or the `maximumWait` is reached (in which case it will fail with a `AMQP:TIMEOUT` error).
## Receive The Reply On A Known Queue
In many cases you don’t want reply queues to be created per-request basis, but instead a well-known queue is used for replies. For this cases, all you have to do is configure the `reply-to` parameter on the outgoing Message:
```
<amqp:publish-consume config-ref="config" exchangeName="targetExchange">
  <amqp:message>
  		<amqp:properties reply-to="replyToQueue" />
  </amqp:message>
</amqp:publish-consume>
```

Now the operation will `publish` a message to the `targetExchange` with the current `payload` as its **body** and the `replyTo` **property** configured with the `replyToQueue`. Then, it will automatically try to consume the response from the `replyToQueue` queue until a message is consumed or the `maximumWait` is reached (in which case it will fail with a `AMQP:TIMEOUT` error).
## See Also
  *
Switching Environments | MuleSoft Documentation
# Switching Environments
This procedure describes how to switch an API from one environment to another and assumes you have added multiple environments to your organization. If you added no environments, none are listed when you attempt to switch. Exception: The Unclassified environment might appear. If you have upgraded APIs from the earlier versions of API Manager, you might have APIs residing in the Unclassified environment. You need to classify these APIs. See link below.
API Manager does not support switching to the Design environment.  
---  
This procedure assumes you added multiple environments in **Access Management** > **Environments** > **Add Environment**.
  1. In API Manager, click the environment control. In the following example, this control is labeled SANDBOX:
  2. In Switch Environment, select one of the other listed environments from among the available environments.
  3. Click **Switch**.


## See Also
  *   * Classifying an API instance into an Environment on API Manager
Installing Runtime Fabric | MuleSoft Documentation
# Installing Runtime Fabric
To install Anypoint Runtime Fabric, choose any of the following options:
  * Installing Runtime Fabric Using RTFCTL Use the `rtfctl` command line tool to install Runtime Fabric.
  * Installing Runtime Fabric Using Helm Use Helm package manager for Kubernetes to install Runtime Fabric.
  * Installing Runtime Fabric as a Kubernetes (K8s) Operator Install Runtime Fabric as a Kubernetes operator.
  * Installing Multiple Instances on a Single Cluster Install multiple instances of Runtime Fabric to share the same cluster among multiple Runtime Fabrics.
  * Installing Multiple Instances on a Single OpenShift Cluster Install multiple instances of Runtime Fabric to share the same OpenShift cluster among multiple Runtime Fabrics.


## See Also
  * Configuring Runtime Fabric
  * Uninstalling Runtime Fabric
  * Upgrading Runtime Fabric
Web Service Consumer Connector 1.9 | MuleSoft Documentation
# Web Service Consumer Connector 1.9
Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP web service from a Mule app to acquire data from an external source. In many cases, you can use Anypoint Connector for Workday (Workday Connector) or Anypoint Connector for ServiceNow (ServiceNow Connector) to connect to a service provider, however, when no connector is available for a specific web service, the easiest way to consume the service is to use the Web Service Consumer Connector.
The main features of the connector include:
  * Ability to consume DOC literal web services
  * Use of SOAP multipart messages
  * Use of SOAP headers
  * Support for a DataSense for SOAP headers, SOAP body, and attachments
  * Use of embedded DataWeave transformations inside the operation
  * Support for a unified experience for SOAP with attachments and MTOM handling
  * Custom HTTP configuration as a transport
  * Support for Web Service Security (WS Security)


Web Service Consumer Connector doesn’t support RPC WSDLs (Remote procedure call Web Service Descripting Language).   
---  
## Before You Begin
To use this connector, you must be familiar with:
  * SOAP and WSDLs
  * Anypoint Connectors
  * Mule runtime engine (Mule)
  * Elements in a Mule flow
  * Global elements
  * DataWeave
  * Creating a Mule app using Anypoint Studio


Before creating an app, you must have access to Anypoint Studio.
## 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
  * Web Service Consumer in Exchange
  * MuleSoft Help Center
Configure Use Bulk Copy for Database Connector SQL Server Connection | MuleSoft Documentation
# Configure Use Bulk Copy for Database Connector SQL Server Connection
```
You can configure the bulk copy for batch insert in Anypoint Connector for Database (Database Connector) for the Microsoft SQL Server Connection. This feature allows you to enable the driver to do bulk copy operations when executing batch insert operations. Configure this feature as a connection property in the Database Connector Configuration screen.
```

  1. In Studio, navigate to the **Global Elements** tab.
  2. Click **Create**.
  3. In the search bar, type `database`.
  4. Select **Database config**.
  5. Click **OK**.
  6. In the **Global Elements Properties** screen, set **Connection** to **Microsoft SQL Server Connection**.
  7. Click the **Advanced** tab.
  8. Set **Connection properties** to **Edit inline**.
  9. Click the plus sign to add a new property.
  10. In the **Connection property** screen, set **Key** to `useBulkCopyForBatchInsert`.
  11. Set **Value** to `true`.


## See Also
  * Database Connector Examples
  * MuleSoft Help Center
now | MuleSoft Documentation
# now
## now(): DateTime
Returns a `DateTime` value for the current date and time.
### Example
This example uses `now()` to return the current date and time as a `DateTime` value. It also shows how to return a date and time in a specific time zone. Java 8 time zones are supported.
#### Source
```
%dw 2.0
output application/json
---
{
  nowCalled: now(),
  nowCalledSpecificTimeZone: now() >> "America/New_York"
}
```

#### Output
```
{
 "nowCalled": "2019-08-26T13:32:10.64-07:00",
 "nowCalledSpecificTimeZone": "2019-08-26T16:32:10.643-04:00"
}
```

### Example
This example shows uses of the `now()` function with valid selectors. It also shows how to get the epoch time with `now() as Number`. For additional examples, see Date and Time (dw::Core Types).
#### Source
```
%dw 2.0
output application/json
---
{
 now: now(),
 epochTime : now() as Number,
 nanoseconds: now().nanoseconds,
 milliseconds: now().milliseconds,
 seconds: now().seconds,
 minutes: now().minutes,
 hour: now().hour,
 day: now().day,
 month: now().month,
 year: now().year,
 quarter: now().quarter,
 dayOfWeek: now().dayOfWeek,
 dayOfYear: now().dayOfYear,
 offsetSeconds: now().offsetSeconds,
 formattedDate: now() as String {format: "y-MM-dd"},
 formattedTime: now() as String {format: "hh:m:s"}
}
```

#### Output
```
{
 "now": "2019-06-18T16:55:46.678-07:00",
 "epochTime": 1560902146,
 "nanoseconds": 678000000,
 "milliseconds": 678,
 "seconds": 46,
 "minutes": 55,
 "hour": 16,
 "day": 18,
 "month": 6,
 "year": 2019,
 "quarter": 2,
 "dayOfWeek": 2,
 "dayOfYear": 169,
 "offsetSeconds": -25200,
 "formattedDate": "2019-06-18",
 "formattedTime": "04:55:46"
}
```
Automation Credits Usage and Rates | MuleSoft Documentation
# Automation Credits Usage and Rates
Your MuleSoft Automation subscription plan includes a quota of Automation Credits that depletes as you create and execute automations.
Credit usage rates differ for different subscription plans. Refer to the article that corresponds to your subscription plan as shown in the following table:
Subscription Plan | Conversion Rate Sheet  
---|---  
  * Automation Starter
  * Automation Advanced
  * Automation for vCore/Core
  * Additional Automation Credits

| MuleSoft Automation Credits 2.0  
  * MuleSoft - Automation
  * MuleSoft - Automation - (Gold, Platinum, Titanium Edition)
  * MuleSoft - Automation for Salesforce
  * MuleSoft - Automation for Salesforce - (Gold, Platinum, Titanium Edition)
  * MuleSoft - Automation - Additional Credits (100)
  * MuleSoft - Automation - Additional Credits (100) - (Gold, Platinum, Titanium)

| MuleSoft Automation Credits 1.0  
For more information on usage and pricing metrics, see Metrics Collected in Anypoint Platform.
## Monthly Account Summary Emails
Salesforce sends usage-based billing reports to every MuleSoft IDP customer on the 10th of each month. By default, Salesforce sends these emails to the account’s billing contact.
For additional information about the reports, the list of recipients, and other details, see the Monthly Account Summary Email FAQ.
General Timer Stop | MuleSoft Documentation
# General Timer Stop
_General timers_ are used to measure whole _Transactions_.
First place the _Start Timer_ and then the _Stop Timer_ by the _Transaction_ elements for which the run time is to be measured.
_General timers_ are **not** valid as _Measurement Points_ and cannot therefore be linked to a _Data Source_.
## Properties
  * **Timer name**
Name to write to the output file.


## Inbound Variables
The _General Timer Stop_ action step has no inbound variables.
## Outbound Variables
The _General Timer Stop_ action step has no outbound variables.
## See Also
  *
Configuring a Proxy for FTP Connector | MuleSoft Documentation
# Configuring a Proxy for FTP Connector
Anypoint Connector for FTP (FTP Connector) enables you to configure an HTTP or HTTPS tunnel proxy. The following example shows how to configure the **Proxy** field:
  1. In Studio, select your FTP Connector operation from the canvas.
  2. In the configuration screen for the operation, click the plus sign (**+**) next to **Connector configuration** to access the global element configuration fields.
  3. On the **General** tab, specify the connection information for the connector.
  4. Set **Proxy** to **Https tunnel proxy**.
  5. Set **TLS Configuration** to **Edit inline**.
  6. For **Trust Store Configuration** , select **Insecure**.
  7. Set the following fields:
     * **Proxy host** : `localhost`
     * **Proxy port** : `3129`
     * **Proxy username** : `userprox`
     * **Proxy host** : `passprox`


In the **Configuration XML** tab, the configuration `ftp:https-tunnel-proxy` looks like this:
```
<ftp:config name="FTP_Config" >
		<ftp:connection host="ftp" username="user123" password="pass123" >
			<ftp:proxy >
				<ftp:https-tunnel-proxy host="localhost" port="3129" username="userprox" password="passprox" >
					<tls:context >
						<tls:trust-store insecure="true" />
					</tls:context>
				</ftp:https-tunnel-proxy>
			</ftp:proxy>
		</ftp:connection>
	</ftp:config>
```

## See Also
  * FTP Connector Examples
  * MuleSoft Help Center