Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-16710688-custom Properties-44-dm #2806

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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