Skip to content

Commit

Permalink
W-16710688-custom Properties-44-dm
Browse files Browse the repository at this point in the history
  • Loading branch information
dmerlob committed Sep 10, 2024
1 parent 1b90780 commit aead8ce
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions modules/ROOT/pages/custom-configuration-properties-provider.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,17 @@ Follow these steps to customize the Mule SDK Module:
. Open the `pom.xml` file:
.. Define the GAV (`groupId`, `artifactId`, and `version`) of your module.
.. Define the `name` of your module.
.. Review the minimum Mule version you want your properties provider to require. This example is compatible with Mule 4.1.1 and later to cover all possible scenarios. See xref:mule-sdk::choosing-version.adoc[Choosing the SDK Version].
. Change the package name (`com.my.company.custom.provider.api`) of your code.
. Open `resources/META-INF/mule-artifact/mule-artifact.json`:
.. Set the `type` field with value `com.my.company.custom.provider.api.CustomConfigurationPropertiesExtensionLoadingDelegate`, replacing `com.my.company.custom.provider.api` to match the package name you changed previously.
.. Set the `name` field using the name you want to define for the module.
.. Set the `exportedPackages` field to match the package name you changed previously.
. Open `resources/META-INF/services/org.mule.runtime.config.api.dsl.model.properties.ConfigurationPropertiesProviderFactory`, and change the content to match the package name you changed previously.
. Open the `CustomConfigurationPropertiesExtensionLoadingDelegate` class:
. Open the `CustomConfigurationPropertiesExtension` class:
.. Change the `EXTENSION_NAME` constant to the name of your module.
.. Change the `fromVendor` method parameter to your company name.
.. Change the `vendor` method parameter on the `@Extension` annotation to your company name.
.. Customize the section at the end to define the parameters that can be configured in the `config` element of your module.
. Open the `CustomConfigurationPropertiesProviderFactory` class:
.. Change the `CUSTOM_PROPERTIES_PREFIX` value to a meaningful prefix for the configuration properties that your module must resolve.
.. Change the class implementation to look up the properties from your custom source.
. Update `CustomPropertiesProviderOperationsTestCase` with more test cases to cover your new module functionality.
. Update the MUnit test cases in `test/munit` with more test cases to cover your new module functionality.

Once your module is ready, you can install it locally using `mvn clean install` to make the module accessible from Studio.

Expand Down

0 comments on commit aead8ce

Please sign in to comment.