From d21245ee8d9393d900adcd4c0d32e8f081baf1c4 Mon Sep 17 00:00:00 2001 From: Cristian Venticinque Date: Thu, 5 Mar 2026 16:06:31 -0300 Subject: [PATCH 1/2] Reoving code snippets topic, links and references --- modules/ROOT/nav.adoc | 1 - .../pages/_partials/acb-component-info.adoc | 4 +- modules/ROOT/pages/index.adoc | 7 - .../ROOT/pages/int-ai-gen-flow-examples.adoc | 3 +- .../ROOT/pages/int-configure-components.adoc | 4 +- .../ROOT/pages/int-create-integrations.adoc | 1 - .../pages/int-developing-integrations.adoc | 1 - .../pages/int-work-with-code-snippets.adoc | 379 ------------------ .../pages/tut-af-integrate-am-flights.adoc | 9 +- .../pages/tut-af-integrate-use-dataweave.adoc | 136 +------ 10 files changed, 20 insertions(+), 525 deletions(-) delete mode 100644 modules/ROOT/pages/int-work-with-code-snippets.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 7825f44d4..8e330ccd1 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -80,7 +80,6 @@ * xref:int-developing-integrations.adoc[] ** xref:int-create-integrations.adoc[] ** xref:int-configure-components.adoc[] -*** xref:int-work-with-code-snippets.adoc[] *** xref:int-configure-components-add.adoc[] *** xref:int-configure-dw-expressions.adoc[] *** xref:int-configure-components-check-connection.adoc[] diff --git a/modules/ROOT/pages/_partials/acb-component-info.adoc b/modules/ROOT/pages/_partials/acb-component-info.adoc index 13b98f588..5124b30a8 100644 --- a/modules/ROOT/pages/_partials/acb-component-info.adoc +++ b/modules/ROOT/pages/_partials/acb-component-info.adoc @@ -52,7 +52,7 @@ For reference documentation on specific connector and component configurations, // // tag::note-component-add-config[] -When adding components, you can start from xref:int-work-with-code-snippets.adoc[code snippets], the canvas, or the configuration XML for your app. +When adding components, you can start from the canvas or the configuration XML for your app. You can configure components from their configuration panels in the canvas or from the XML. // end::note-component-add-config[] // @@ -238,8 +238,6 @@ The configuration XML file now includes the XML for the HTTP Listener within the + For example, add the `` component from a snippet. + -For more information about snippets, see xref:anypoint-code-builder::int-work-with-code-snippets.adoc[]. -+ .. In the configuration XML, place your cursor before the opening `` tag, and type `http`. + Ensure that the cursor is not inside the `` element. diff --git a/modules/ROOT/pages/index.adoc b/modules/ROOT/pages/index.adoc index 3306bbea5..69e27c958 100644 --- a/modules/ROOT/pages/index.adoc +++ b/modules/ROOT/pages/index.adoc @@ -83,13 +83,6 @@ A flow reference enables you to trigger execution of a flow or subflow from anot [[business-groups]] * Business groups organize APIs, Mule applications, and other resources within an Anypoint Platform organization. Organization administrators create and control access to business groups. For details about business groups, organizations, and related management features, see xref:access-management::business-groups.adoc[]. -[[snippets]] -== Code Snippets - -Snippets are code patterns that you can insert from the IDE into the configuration XML files of your Mule applications. Using code snippets for reusable code patterns helps you work more efficiently and reduces the potential for configuration errors. - -The IDE provides built-in snippets, and you can create your own user snippets. To use and create code snippets, see xref:int-work-with-code-snippets.adoc[]. - == Anypoint Platform Product Integrations //relationships to our other products diff --git a/modules/ROOT/pages/int-ai-gen-flow-examples.adoc b/modules/ROOT/pages/int-ai-gen-flow-examples.adoc index 82da659b9..28008586b 100644 --- a/modules/ROOT/pages/int-ai-gen-flow-examples.adoc +++ b/modules/ROOT/pages/int-ai-gen-flow-examples.adoc @@ -165,7 +165,7 @@ The `type` attribute is set to `Account` to specify the object type to update. === Complete the Flow -To run this flow, use built-in snippets to add configurations for your Salesforce instance. For more information about built-in snippets, see xref:int-work-with-code-snippets.adoc[]. +To run this flow,add configurations for your Salesforce instance. The following is an example of the completed flow: @@ -430,7 +430,6 @@ The following is an example of the completed flow: == See Also -* xref:int-work-with-code-snippets.adoc[] * xref:vibes-create-integrations.adoc[] * xref:acb-reference.adoc[] * xref:acb-component-scheduler.adoc[] diff --git a/modules/ROOT/pages/int-configure-components.adoc b/modules/ROOT/pages/int-configure-components.adoc index eb8b1559c..31c7cc0a5 100644 --- a/modules/ROOT/pages/int-configure-components.adoc +++ b/modules/ROOT/pages/int-configure-components.adoc @@ -1,5 +1,6 @@ = Configuring Components :page-deployment-options: cloud-ide, desktop-ide +:page-aliases: int-work-with-code-snippets.adoc, work-with-code-snippets.adoc, create-xml-snippets.adoc :open-config-xml: In the Explorer, open the configuration XML file for your project: include::reuse::partial$beta-banner.adoc[tag="anypoint-code-builder"] @@ -8,7 +9,6 @@ Configure connectors and processors within your implementation and integration p Common tasks include the following: -* xref:int-work-with-code-snippets.adoc[Work with Code Snippets] * <> * xref:int-configure-dw-expressions.adoc[Configure Expressions] * <> @@ -17,7 +17,7 @@ Common tasks include the following: == Before You Begin -* Determine which connectors, processors, and snippets you intend to use. +* Determine which connectors and processors you intend to use. + // Note on ways to start component configs: include::partial$acb-component-info.adoc[tags="note-component-add-config"] diff --git a/modules/ROOT/pages/int-create-integrations.adoc b/modules/ROOT/pages/int-create-integrations.adoc index 98820b849..8044d5573 100644 --- a/modules/ROOT/pages/int-create-integrations.adoc +++ b/modules/ROOT/pages/int-create-integrations.adoc @@ -132,5 +132,4 @@ The file's canvas provides the same options for building your project file that * xref:start-workspaces.adoc[] * xref:acb-reference.adoc[] -* xref:int-work-with-code-snippets.adoc[] * xref:debugging-mule-apps.adoc[] diff --git a/modules/ROOT/pages/int-developing-integrations.adoc b/modules/ROOT/pages/int-developing-integrations.adoc index d98ba2ffe..4a38db901 100644 --- a/modules/ROOT/pages/int-developing-integrations.adoc +++ b/modules/ROOT/pages/int-developing-integrations.adoc @@ -22,7 +22,6 @@ Some common use cases are: After you xref:int-create-integrations.adoc[create your integration project], you can optionally: -* xref:int-work-with-code-snippets.adoc[Work with code snippets]. * xref:int-create-secure-configs.adoc[Define and secure properties for your Mule application]. * xref:int-trigger-flows.adoc[Trigger flows in your development environment]. * xref:int-use-dw-to-transform-data.adoc[Use the DataWeave language]. diff --git a/modules/ROOT/pages/int-work-with-code-snippets.adoc b/modules/ROOT/pages/int-work-with-code-snippets.adoc deleted file mode 100644 index 6adba7be0..000000000 --- a/modules/ROOT/pages/int-work-with-code-snippets.adoc +++ /dev/null @@ -1,379 +0,0 @@ -= Working with Code Snippets -:page-deployment-options: cloud-ide, desktop-ide -:page-aliases: work-with-code-snippets.adoc, create-xml-snippets.adoc - -include::reuse::partial$beta-banner.adoc[tag="anypoint-code-builder"] - -// work-with-code-snippets, create-xml-snippets - - -_Code snippets_ are code patterns that you insert from the IDE into the configuration XML files of your Mule application flows or subflows. -Using code snippets for reusable code patterns helps you work more efficiently and reduces the potential for configuration errors. - -Use snippets to provide configurations for any element supported by the Mule DSL, such as commonly used connector operations, message processing patterns supported by Core components, or multi-element configurations in the configuration XML. -You can configure snippets for connector operations, Core processors, and other processors in the XML configuration file for your Mule applications. See <> - -In addition to providing built-in snippets, Anypoint Code Builder enables you to configure your own user snippets in JSON format. See <>. - -Anypoint Code Builder converts the snippets to XML when you add them to the configuration XML of your Mule application. - -Snippets are templates created in JSON format. -When you insert a snippet into the configuration XML for a Mule application flow or subflow, the snippet JSON transforms to XML automatically. -Create your user snippets in the `mule-xml.json` file. - -Code snippets are a VS Code feature. For more information, see https://code.visualstudio.com/docs/editing/userdefinedsnippets[Snippets in Visual Studio Code^]. - - -== Benefits of Using Built-in Snippets - -Using the XML generated from snippets helps you configure applications more quickly and consistently than with the basic XML elements available from the configuration XML, for example: - -* Built-in Logger snippet: -+ -[source,XML] ----- - ----- -+ -To configure the snippet XML in a Mule application, specify the values to the attributes, such as the `message` for the Logger. - -* Basic Logger XML: -+ -[source,XML] ----- - ----- -+ -To configure the basic Logger XML, you must provide the attributes and values. - - -== Before You Begin - -* xref:start-acb.adoc[Set up and access the web or desktop IDE]. -* xref:int-create-integrations.adoc[Create an integration project]. - -[[adding-snippets]] -== Adding Snippets to a Mule Application - -Add snippets from either the canvas or the configuration XML: - -* From the canvas, Anypoint Code Builder inserts all user snippets into the `` or `` element that you are working on. -* From the configuration XML, use <> to find and insert user snippets. -+ -For example, for a global configuration that must reside at the same level as the `` or ``, and not within either element, use auto-complete. -From the auto-complete menu, snippets are identified by their name and a two-dimensional box icon. - -Add built-in or user snippets to your integration or implementation: - -* <> -* <> - -[[add-builtin-snippet]] -=== Add a Built-In Snippet to a Flow or Subflow - -To add a built-in snippet: - -. On the canvas, click the image:icon-plus.png["",15,15] (*Add component*) icon where you want to add the snippet: -+ -image::main-tutorial-add-first-http-listener.png["Mule application canvas"] -. Select *Snippets* > *Built-in Snippets*. -. Click the built-in snippet to add to your flow or subflow. -+ -The IDE inserts XML for the snippet within the `` or `` element of your application at the location you selected from the canvas. - -You can also use the auto-complete feature to insert built-in snippets directly into the XML configuration file. -See <>. - -[[add-user-snippet]] -=== Add a User Snippet to a Flow or Subflow - -Add user snippets that you create to your integration or implementation. To create snippets, see <>. - -To add a user snippet to a flow or subflow: - -. In the canvas, click the image:icon-plus.png["",15,15] (*Add component*) icon where you want to add the snippet: -+ -image::main-tutorial-add-first-http-listener.png["Mule application canvas"] -. Select *Snippets* > *User Snippets*. -+ -If no snippets are defined, Anypoint Code Builder creates a new `mule-xml.json` snippet file with a sample snippet to edit. -See <>. -. Click the user snippet to add to your flow or subflow. -+ -The IDE inserts XML for the snippet within the `` or `` element of your application at the location you selected from the canvas. - -[[creating-user-snippets]] -== Creating User Snippets - -Create user snippets from either the canvas or from the Command Palette. - -* <> -* <> - -[[create-snippet-canvas]] -=== Create User Snippets from the Canvas - -Create reusable user snippets for your Mule applications. - -User snippets are specific to your IDE instance and not shared in projects for applications that you export for others to import and work on. - -. In the canvas, click the image:icon-plus.png["",15,15] (*Add component*) icon where you want to add the snippet: -+ -image::main-tutorial-add-first-http-listener.png["Mule application canvas"] -. Select *Snippets* > *User Snippets*. -+ -. Click the image:icon-snippet-plus.png["",15,15] (*Create user snippet*) icon. -+ -Anypoint Code Builder opens `mule-xml.json`, where you configure user snippets. -If no snippets are defined, Anypoint Code Builder creates a new `mule-xml.json` snippet file with a sample snippet to edit. -+ -For example, uncomment all the fields after *Example* to create the *Log a message* user snippet: -+ -[source,JSON] --- -{ - // Example: - "Log a message": { // <1> - "prefix": "log", // <2> - "body": [ // <3> - "$0", - ], - "description": "Log output to console" - } -} --- -[calloutlist] -.. Name that appears in the snippet list -.. Trigger text to auto-complete the snippet -.. Reusable code -. Save the snippet and click the image:icon-snippet-refresh.png["",15,15] (*Refresh snippet list*) icon. -. Add the sample snippet to your flow: -.. In *User Snippets*, click *Log a message*. -+ -Anypoint Code Builder adds the snippet to your configuration XML: -+ -[source,xml] ----- - ----- -+ -The value of `doc:id` is randomly generated because of the `$RANDOM_HEX` value in the snippet. -+ -. Add any required values or configurations to the XML, such as a `level` and `message` value, for example: -+ -[source,xml] ----- - ----- -. Add any other snippets to your `mule-xml.json` by adding a comma after the `}` and defining your new snippet, for example: -+ -[source,JSON] --- -{ - // Example: - "Log a message": { - "prefix": "log", - "body": [ - "$0", - ], - "description": "Log output to console" - }, - "Add your snippet title here": { - "prefix": "Add your snippet trigger here", - "body": [ - "Add your code here", - ], - "description": "Add your description here" - } -} --- - -You can also use the auto-complete feature to insert user snippets directly into the XML configuration file. - -[[create-snippet-file]] -=== Create User Snippets in a Configuration File - -To configure user snippets: - -// Pointer to Configure User Snippets -include::partial$acb-reusable-steps.adoc[tags="configure-user-snippets"] -. In the *Select Snippets File or Create Snippets* field that opens, select: -+ -[source,command] ----- -mule-xml.json (Mule XML) ----- -. If the file has no configurations, `mule-xml.json` provides comments within curly braces: -+ -[source,json] --- -{ - // Place your snippets for mule-xml here. Each snippet is defined under a snippet name and has a prefix, body and - // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the - // same ids are connected. - // Example: - // "Print to console": { - // "prefix": "log", - // "body": [ - // "console.log('$1');", - // "$2" - // ], - // "description": "Log output to console" - // } -} --- - -. Add your snippet code to the file. -+ -.Example Snippet Code -[%collapsible] -==== -[source,json] --- -{ - "Mule Flow": { - "prefix": "muledx:flow", - "body": [ - "", - "", - "" - ] - }, - "HTTP Listener Config": { - "prefix": "muledx:http-listener-config", - "body": [ - "", - " ", - "" - ] - }, - "HTTP Listener": { - "prefix": "muledx:http-listener", - "body": [ - "" - ] - }, - "Set Payload": { - "prefix": "muledx:set-payload", - "body": [ - "" - ] - }, - "Set Variable": { - "prefix": "muledx:set-variable", - "body": [ - "" - ] - }, - "Logger": { - "prefix": "muledx:logger", - "body": [ - "" - ] - }, - "Database Config - MySQL": { - "prefix": "muledx:db-config-mysql", - "body": [ - "", - " ", - "" - ] - }, - "Database Select": { - "prefix": "muledx:db-select", - "body": [ - "", - " ", - " ", - " ", - "" - ] - }, - "Transform Message": { - "prefix": "muledx:transform-message", - "body": [ - "", - " ", - " ", - " ", - " ", - " ", - "" - ] - } - } --- -==== - - -[[autocomplete]] -== Use Auto-Complete to Insert Snippets into the Configuration XML - -To add snippets directly to the configuration XML for a Mule application: - -. Click in the configuration XML file. -// Pointer to Auto Complete -include::partial$acb-reusable-steps.adoc[tags="open-auto-complete"] -. Insert the snippet into your flow or subflow: -+ -** For a built-in snippet, search for and select the name of the built-in snippet, for example: -+ -image::acb-auto-complete-options.png["Auto-completion options for the Choice router"] -+ -Compare the built-in Choice snippet configuration to the basic XML configuration for this component: -+ -[source,xml] --- - - // <1> - - - - - - - // <2> - - - --- -+ -<1> XML for the built-in Choice snippet is `flow:choice` in the auto-complete list. The icon for snippets in this menu is a one-dimensional box. -<2> XML for the minimally configured Choice component, which is also available by navigating to *Core Processors* > *Flow Control* > *Choice* from the canvas. -The icon for this XML is a three-dimensional box. - -* For a user snippet, search for and select the name of the user snippet (as configured in `mule-xml.json`), for example: -+ -image::acb-auto-complete-user-snip.png["Auto-completion options for the Log a message user snippet"] - - -//// - -This relates to the connect-to-a-db topic. -For an example of a global configuration for connections to a database, which must reside outside of the `` element, see xref:connect-to-a-db.adoc[]. - - "Select first and last name from database": { // - "prefix": "select-name-from-db", - "body": [ - "", - "", - "", - "", - "", - "", - "", - "$0" - ], - "description": "Pull first and last name from database" - } -} --- -<1> A snippet for a Database Connector select operation that retrieves `firstName` and `lastName` values from a Database. -+ -If you insert the snippet for the database example into your configuration XML, the next step is to provide the value of `config-ref=""`. To get the value, it is necessary to configure a global `` element at outside of the ``. To learn more about this configuration, see xref:connect-to-a-db.adoc[]. - -//// diff --git a/modules/ROOT/pages/tut-af-integrate-am-flights.adoc b/modules/ROOT/pages/tut-af-integrate-am-flights.adoc index fa9c5f605..b6adfafb1 100644 --- a/modules/ROOT/pages/tut-af-integrate-am-flights.adoc +++ b/modules/ROOT/pages/tut-af-integrate-am-flights.adoc @@ -109,20 +109,15 @@ The configuration XML file adds the XML for the HTTP Listener into the `` ---- -. In the configuration XML, place your cursor before the opening tag, and type `http`. -. Select the built-in `` snippet: +. In the configuration XML, place your cursor before the opening tag, and copy the following code: + -image::add-http-config-snippet.png["http:listener-config highlighted in the configuration XML menu"] -+ -.Snippet XML example: [source,xml] ---- ---- -+ -In the menu, the snippet is a partially configured Mule component that is represented by a _two-dimensional_ box icon. Three-dimensional box icons are reserved for basic component XML that is not preconfigured. For information about code snippets, see xref:int-work-with-code-snippets.adoc[]. + . In the configuration XML, configure the attributes for the HTTP Listener configuration ``: + [source,xml] diff --git a/modules/ROOT/pages/tut-af-integrate-use-dataweave.adoc b/modules/ROOT/pages/tut-af-integrate-use-dataweave.adoc index a49be264c..89476774c 100644 --- a/modules/ROOT/pages/tut-af-integrate-use-dataweave.adoc +++ b/modules/ROOT/pages/tut-af-integrate-use-dataweave.adoc @@ -14,135 +14,22 @@ Complete these procedures: . xref:tut-af-integrate-am-flights.adoc[] . xref:tut-af-integrate-connect-to-a-db.adoc[] -[[snippets]] -== Create a User Snippet for the Transformation +[[add-transform-component]] +== Add the Transform Message Component -Define snippets in the `mule-xml.json` file. For information about snippets, see xref:work-with-code-snippets.adoc[]. - -// Pointer to Configure Snippets -include::partial$acb-reusable-steps.adoc[tags="configure-user-snippets"] -. In the *Select Snippets File or Create Snippets* field that opens, enter: -+ -[source,command] ----- -mule-xml.json (Mule XML) ----- -. If the file has no configurations, `mule-xml.json` provides comments within curly braces: -+ -[source,json] --- -{ - // Place your snippets for mule-xml here. Each snippet is defined under a snippet name and has a prefix, body and - // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the - // same ids are connected. - // Example: - // "Print to console": { - // "prefix": "log", - // "body": [ - // "console.log('$1');", - // "$2" - // ], - // "description": "Log output to console" - // } -} --- -. Add this snippet code to the file: -+ -[[collapsible]] -[source,json] ----- -{ - "Transform Message": { - "prefix": "muledx:transform-message", - "body": [ - "", - " ", - " ", - " ", - " ", - " ", - "" - ] - }, - "Mule Flow": { - "prefix": "muledx:flow", - "body": [ - "", - "", - "" - ] - }, - "HTTP Listener Config": { - "prefix": "muledx:http-listener-config", - "body": [ - "", - " ", - "" - ] - }, - "HTTP Listener": { - "prefix": "muledx:http-listener", - "body": [ - "" - ] - }, - "Set Payload": { - "prefix": "muledx:set-payload", - "body": [ - "" - ] - }, - "Set Variable": { - "prefix": "muledx:set-variable", - "body": [ - "" - ] - }, - "Logger": { - "prefix": "muledx:logger", - "body": [ - "" - ] - }, - "Database Config - MySQL": { - "prefix": "muledx:db-config-mysql", - "body": [ - "", - " ", - "" - ] - }, - "Database Select": { - "prefix": "muledx:db-select", - "body": [ - "", - " ", - " ", - " ", - "" - ] - } -} ----- -+ -The snippets provide starting configurations for several Mule components, including Transform Message. -. Proceed to <>. - -[[return-payload]] -== Return the Payload as JSON +Add a Transform Message component to the flow so you can configure it to return the database payload as JSON in the next section. . In Anypoint Code Builder, open `american-ws-anypoint-code-builder.xml`. -. From the canvas, insert the snippet `Transform Message` below the *Database Select* operation. +. Add the Transform Message component below the *Database Select* operation. Use one of these methods: + -After the listener, click the image:icon-plus.png["",15,15] (*Add component*) icon and navigate to *Snippets* > *User Snippets* > *Transform Message*. +* *From the canvas:* Click the image:icon-plus.png["",15,15] (*Add component*) icon after the *Database Select* operation. In the menu, open *Core Processors* (or search for *transform*), then select *Transform Message*. +* *From the configuration XML:* Place your cursor inside the flow, after the closing tag of the *Database Select* element. Use auto-complete (Ctrl+Space or Cmd+Space), type `ee:transform` or `transform`, and select *Transform Message* from the list. + -If the *User Snippets* panel is empty at first, wait a moment, and try again. Alternatively, navigate to the `muledx:transform-message` snippet from the configuration XML: +The IDE inserts the component. If the inserted XML does not include `` and `` with an empty `` block, add that structure inside `` so you can add the DataWeave script in the next section. + -//TODO: image seems out of date; where's the plus icon? image::transform-with-output-json.png["Transform component highlighted"] + -.User snippet XML: +.Example Transform Message component XML: [source,xml] ---- @@ -153,7 +40,12 @@ image::transform-with-output-json.png["Transform component highlighted"] ---- -. In the configuration XML, add the `doc:name` value *Transform Message* or similar to the `` component: + +[[return-payload]] +== Return the Payload as JSON + +. Open `american-ws-anypoint-code-builder.xml` if it is not already open (you added the Transform Message component in <>). +. Ensure the Transform Message component is present below *Database Select* (you added it in the previous section). In the configuration XML, add the `doc:name` value *Transform Message* or similar to the `` component: + ---- From 0330e8193523f003011521d6e97e2c5afd928192 Mon Sep 17 00:00:00 2001 From: Cristian Venticinque Date: Thu, 12 Mar 2026 11:20:31 -0300 Subject: [PATCH 2/2] Removing code snippets, references, and procedures --- .../pages/_partials/acb-component-info.adoc | 14 ++----- modules/ROOT/pages/af-project-files.adoc | 2 +- .../ROOT/pages/int-ai-gen-flow-examples.adoc | 8 ++-- .../ROOT/pages/int-create-secure-configs.adoc | 16 +++----- .../tut-af-integrate-connect-to-a-db.adoc | 9 +---- ...tut-graphql-test-first-implementation.adoc | 2 +- .../tut-slack-create-config-files-sfdc.adoc | 38 +++++++++++++------ 7 files changed, 44 insertions(+), 45 deletions(-) diff --git a/modules/ROOT/pages/_partials/acb-component-info.adoc b/modules/ROOT/pages/_partials/acb-component-info.adoc index 5124b30a8..0299cb4ae 100644 --- a/modules/ROOT/pages/_partials/acb-component-info.adoc +++ b/modules/ROOT/pages/_partials/acb-component-info.adoc @@ -234,19 +234,11 @@ The configuration XML file now includes the XML for the HTTP Listener within the ---- -. Add another component, this time using the XML configuration menu. +. Add another component, this time using the configuration XML. + -For example, add the `` component from a snippet. +In the configuration XML, place your cursor before the opening `` tag. Ensure that the cursor is not inside the `` element. Add the following code: + -.. In the configuration XML, place your cursor before the opening `` tag, and type `http`. -+ -Ensure that the cursor is not inside the `` element. -+ -.. Type `http`, and select the `http:listener-config` snippet: -+ -image::anypoint-code-builder::add-http-config-snippet.png["http:listener-config snippet highlighted in the configuration XML menu"] -+ -The snippet adds the following code: +// image::anypoint-code-builder::add-http-config-snippet.png["http:listener-config highlighted in the configuration XML menu"] + [source,xml] ---- diff --git a/modules/ROOT/pages/af-project-files.adoc b/modules/ROOT/pages/af-project-files.adoc index 5525db579..d1f9849c3 100644 --- a/modules/ROOT/pages/af-project-files.adoc +++ b/modules/ROOT/pages/af-project-files.adoc @@ -1145,7 +1145,7 @@ The `ref` element is used in different elements in the agent network YAML, and i The `ref` element represents another asset that exists in Exchange. The type of asset referenced depends on the context (such as agent, MCP server, LLM provider). The semantic is always that of referencing an asset that exists in Exchange, or will exist when the agent network is published (meaning, it's defined in the file). If referenced, it's in the `dependencies` section of `exchange.json`. -This snippet represents a link to an HR agent. The `name` attribute doesn't point to the agent's human friendly or logical name (which can change); instead, it references the `assetId` that `hr-agent` has in Exchange. +This example represents a link to an HR agent. The `name` attribute doesn't point to the agent's human friendly or logical name (which can change); instead, it references the `assetId` that `hr-agent` has in Exchange. [source,yaml] ---- diff --git a/modules/ROOT/pages/int-ai-gen-flow-examples.adoc b/modules/ROOT/pages/int-ai-gen-flow-examples.adoc index 28008586b..46ade2a7b 100644 --- a/modules/ROOT/pages/int-ai-gen-flow-examples.adoc +++ b/modules/ROOT/pages/int-ai-gen-flow-examples.adoc @@ -71,7 +71,7 @@ After reviewing and inserting the generated flow into your project: ---- + This example flow is configured to poll for new cases every 5000 milliseconds. -. Use built-in snippets to add configurations for your Salesforce instance and email inbox. +. Add the required configurations for your Salesforce instance and email inbox in your configuration XML. The following is an example of the completed flow: @@ -165,7 +165,7 @@ The `type` attribute is set to `Account` to specify the object type to update. === Complete the Flow -To run this flow,add configurations for your Salesforce instance. +To run this flow, add the required configurations for your Salesforce instance in your configuration XML. The following is an example of the completed flow: @@ -265,7 +265,7 @@ output application/java After reviewing and inserting the generated flow into your project: . Update the name of the database table and fields to match what is configured in your MySQL database. -. To run this flow, use built-in snippets to add configurations for your Salesforce instance. +. To run this flow, add the required configurations for your Salesforce instance in your configuration XML. The following is an example of a completed flow: @@ -372,7 +372,7 @@ After reviewing and inserting the generated flow into your project: . Update the `watermarkColumn` in the Database *Listener* to whichever database column is used to indicate new records. + The values that are taken from this column are used to filter the contents of the next poll, so that only rows with a greater watermark value are processed. -. To run this flow, use built-in snippets to add configurations for your database and email inbox. +. To run this flow, add the required configurations for your database and email inbox in your configuration XML. The following is an example of the completed flow: diff --git a/modules/ROOT/pages/int-create-secure-configs.adoc b/modules/ROOT/pages/int-create-secure-configs.adoc index affed74d7..49fe79423 100644 --- a/modules/ROOT/pages/int-create-secure-configs.adoc +++ b/modules/ROOT/pages/int-create-secure-configs.adoc @@ -391,11 +391,9 @@ The POM file includes dependencies for the components in the configuration XML. To use an encrypted value in a Mule application: -. Before the `` element in the configuration XML, add the Secure Configuration Properties _snippet_ (``) by pressing Cmd+Space (Mac) or Ctrl+Space (Windows), typing the initial letters of the element name, such as `secu`, and then selecting the snippet: +. Before the `` element in the configuration XML, add the following Secure Configuration Properties configuration (``): + -image::acb-snippet-secure-config-prop.png["Selecting Secure Configuration Properties Snippet"] -+ -The XML for an unmodified snippet looks like this before a `` element: +// image::acb-snippet-secure-config-prop.png["Selecting Secure Configuration Properties"] + [source,xml] ---- @@ -409,12 +407,10 @@ The XML for an unmodified snippet looks like this before a `` element: ... ---- + -The snippet preconfigures parts of the element that the basic XML configuration does not, so be sure to select the _snippet_ and _not_ the basic XML for this element, which has the same name but a different icon. Like all snippets, this snippet is identified by a two-dimensional box icon, while the basic XML for this element has a three-dimensional box icon. -+ -When you _first_ add the `` snippet to the configuration XML, you can tab to the `algorithm` attribute to select another algorithm, or you can change the value manually: +. Optionally change the `algorithm` attribute to select another algorithm: + image::int-secure-config-algorithms.png["List of supported algorithms in Secure Configuration Properties module."] -. Configure the snippet with values for the `file`, `key`, and `algorithm` attributes, for example: +. Configure the element with values for the `file`, `key`, and `algorithm` attributes, for example: + [source,xml] ---- @@ -431,7 +427,7 @@ If you want to use the variable `$\{env}` in your filename configuration, see << * `name`: A name of your choice for the encryption key (defaults to `${encryption.key}`) + This name serves as the key for the encryption value (password) used to encrypt your secure properties with the Secure Properties Tool. -* `algorithm`: Algorithm you used to encrypt your secure properties (defaults to Blowfish in the snippet). Other <> are available. +* `algorithm`: Algorithm you used to encrypt your secure properties (defaults to Blowfish in the previous example). Other <> are available. . In the connector or component XML, add the key of an encrypted property as the value of an XML attribute, for example: + [source,xml] @@ -510,7 +506,7 @@ Before you begin: To hide sensitive values from the Runtime Manager UI when you deploy to CloudHub or CloudHub 2.0: -. In the `mule-artifact.json` file for your application, provide the _name_ of the encryption key (`encryption.key` by default) that you provided in the global `` snippet within your configuration XML, for example: +. In the `mule-artifact.json` file for your application, provide the _name_ of the encryption key (`encryption.key` by default) that you provided in the global `` element within your configuration XML, for example: + ---- { diff --git a/modules/ROOT/pages/tut-af-integrate-connect-to-a-db.adoc b/modules/ROOT/pages/tut-af-integrate-connect-to-a-db.adoc index 9eae50240..e6894582a 100644 --- a/modules/ROOT/pages/tut-af-integrate-connect-to-a-db.adoc +++ b/modules/ROOT/pages/tut-af-integrate-connect-to-a-db.adoc @@ -70,13 +70,8 @@ image::add-mysql-driver-dependency.png["pom.xml with new dependency highlighted" == Add a Database Connector Configuration . In Anypoint Code Builder, open `american-ws-anypoint-code-builder.xml`. -. In the configuration XML, add the global `` snippet. -.. Place your cursor before the opening tag. -.. Press Ctrl+Spacebar (Mac) or Cmd+Spacebar (Windows). -.. Type `mysql` to search for the snippet. -.. Select the snippet `db:mysql-config`. +. In the configuration XML, add the following global `` configuration before the opening tag: + -.Snippet XML before the opening tag: [source,xml] ---- @@ -131,7 +126,7 @@ NOTE: The `getFlights` flow contains an expected error: `The content of element . Add the *Select* operation for Anypoint Connector for Database (Database Connector). + Either search for *Select* or navigate to the operation from *Connectors* > *Database* > *Select*. -. Provide this configuration for the snippet: +. Provide this configuration for the Select operation: + [tabs] ==== diff --git a/modules/ROOT/pages/tut-graphql-test-first-implementation.adoc b/modules/ROOT/pages/tut-graphql-test-first-implementation.adoc index 38c0b4dc3..af274e172 100644 --- a/modules/ROOT/pages/tut-graphql-test-first-implementation.adoc +++ b/modules/ROOT/pages/tut-graphql-test-first-implementation.adoc @@ -44,7 +44,7 @@ curl --request POST \ If you receive the error `curl: (7) Failed to connect to localhost port 8081 after 0 ms: Couldn't connect to server`, stop and rerun the application in debug mode. For guidance with stopping the application, see xref:int-debug-mule-apps.adoc[]. + TIP: Tools such as Postman provide a way to build GraphQL queries. For example, -in Postman, you can place your query in the *Body* tab and find the code snippet for a `curl` request. The resulting command includes newline (`\\n`) and tab (`\\t`) characters that you can delete from the `curl` command's `--data` value. For more information, see https://learning.postman.com/docs/sending-requests/graphql/graphql-http/[Make an HTTP call with GraphQL] in the Postman documentation. +in Postman, you can place your query in the *Body* tab and copy the example `curl` request. The resulting command includes newline (`\\n`) and tab (`\\t`) characters that you can delete from the `curl` command's `--data` value. For more information, see https://learning.postman.com/docs/sending-requests/graphql/graphql-http/[Make an HTTP call with GraphQL] in the Postman documentation. + Anypoint Code Builder returns the following output in the terminal (manually reformatted to enhance readability): + diff --git a/modules/ROOT/pages/tut-slack-create-config-files-sfdc.adoc b/modules/ROOT/pages/tut-slack-create-config-files-sfdc.adoc index 8e64afa66..5c503f64c 100644 --- a/modules/ROOT/pages/tut-slack-create-config-files-sfdc.adoc +++ b/modules/ROOT/pages/tut-slack-create-config-files-sfdc.adoc @@ -37,34 +37,50 @@ email: slack: token: "yourSlackToken" -- -. Navigate to your `new-case-salesforce.xml` file, add a new line before the `` tag, type `configuration` and select *mule:configurationProperties*: +. Navigate to your `new-case-salesforce.xml` file, add a new line before the `` tag, and paste this line: + -image::select-mule-config-properties-contacts-sync.png["Code snippet with *mule:configurationProperties* highlighted in search results"] +[source,XML] +-- + +-- +// image::select-mule-config-properties-contacts-sync.png["Code snippet with *mule:configurationProperties* highlighted in search results"] + +//// . Scroll through the attributes and set the value of `file` to `config.yaml`: + [source,XML] -- -- +//// == Configure Your Salesforce Connector Use the values in your `config.yaml` file to connect the Salesforce Connector to your Salesforce environment: -. In your `new-case-salesforce.xml` file, create a new line after the `` element, type `salesforce`, and select *salesforce:sfdc-config*: +. In your `new-case-salesforce.xml` file, create a new line after the `` element, and paste the following code: + -image::sync-api-select-sfdc-config.png["Code snippet with *Salesforce:sfdc-config* highlighted in search results"] -. Set the *name* field to `Salesforce-Config`. -. Create a new line, type `basic` and select *Salesforce:Basic*: -+ -image::basic-auth-sfdc-connector.png["Code snippet with *Salesforce:basic* highlighted in search results"] -. Configure the `username` and `password` properties to use your configuration file values: +[source,XML] +-- + + + +-- + +// image::sync-api-select-sfdc-config.png["Code snippet with *Salesforce:sfdc-config* highlighted in search results"] +// . Set the *name* field to `Salesforce-Config`. +// . Create a new line, type `basic` and select *Salesforce:Basic*: +//+ +// image::basic-auth-sfdc-connector.png["Code snippet with *Salesforce:basic* highlighted in search results"] +//. Configure the `username` and `password` properties to use your configuration file values: + +//// [source,XML] -- -- + +//// [NOTE] -- When you move your cursor over the `${salesforce.username}` and `${salesforce.password}` elements, Anypoint Code Builder shows the values from the configuration file. @@ -95,7 +111,7 @@ If you get an error, verify the error message to troubleshoot further. * `objectType`: *Case* * `config-ref`: *Salesforce-Config* * `name`: *On New Case* -. In the `` element, replace `` with the following snippet: +. In the `` element, replace `` with the following XML: + [source,XML] -- @@ -112,7 +128,7 @@ image::add-logger-end-flow-canvas.png["The flow canvas with the *Add Flow* plus + image::drag-logger-canvas.png["A workflow with the *Logger* component added"] + -A `logger` component is added to the `flow` snippet in the code editor. +A `logger` component is added to the flow in the code editor. + . Replace the `logger` component in the code editor with the following: +