Publishing Split-Model Policies to Exchange
During the custom split-model policy development cycle, you can upload the definition and implementation of your policy to Exchange to create a new Exchange assets to manage the asset versions and to distribute it to other users. For more information about Exchange, see Anypoint Exchange Overview.
For custom policies running in Local Mode, it is not required to publish your policy to Exchange. However, Exchange is a useful version control tool. It is your responsibility to distribute custom policies for Local Mode use.
When uploading your policy to Exchange, you can choose to either:
-
Publish a Custom Policy
Publish a policy if the policy version is still in development. This enables you to test and edit the policy version.To learn about development assets, see Publish a Custom Policy.
-
Release a Custom Policy
Release the policy to create a definitive version of the policy. After releasing the policy, you must create a new policy version to edit the policy.To learn about production assets, see Release a Custom Policy.
Every time you publish or release a definition and implementation asset, you create a new stable version of that asset in Exchange. For more information about stable state assets, see Stable State Assets.
After you upload your definition and implementation assets to Exchange, see Applying Custom Policies.
Before You Begin
-
Ensure that the Connected App you used to authenticate to the Anypoint Platform CLI has the
Exchange Contributorscope applied.
Publish a New Split-Model Policy
-
-
Make changes on the
gcl.yaml -
Execute
make publishin the definition project to publish the development definition asset to Exchange.
-
-
Create an implementation project:
-
Update the
definition_asset_idversion field in thecargo.tomlfile to1.0.0-DEV. -
Execute
make build-asset-filesin the implementation project. -
Code your policy logic and test locally.
-
Execute
make publishto release the development implementation asset to Exchange for testing in lower environments. -
Validate the policy works as expected. Complete steps C and D until testing is complete.
-
-
After validating the policy works as expected, release the both assets to Exchange:
-
In the definition project, execute
make releaseto release the definition asset to Exchange. -
In the implementation project, update the
definition_asset_idversion field in thecargo.tomlfile to1.0.0. -
Execute
make releaseto release the implementation asset to Exchange.
-
Publish a Patch Version Update (Implementation Update)
After you have Published a new split-model policy, you can update the implementation asset for bug fixes or performance updates:
-
Develop the new policy implementation:
-
In the implementation project, update the patch number of version in the
cargo.tomlfile. For example:1.0.1. -
Add the
-DEVsuffix to thedefinition_asset_idversion field in thecargo.toml. For example:1.0.0-DEV. -
Execute
make build-asset-filesin the implementation project. -
Code your policy logic and test locally.
-
Execute
make publishto release the development implementation asset to Exchange for testing in lower environments. -
Validate the policy works as expected. Complete steps D and E until testing is complete.
-
-
After validating the policy works as expected, release the implementation asset to Exchange:
-
In the implementation project, remove the
-DEVsuffix from thedefinition_asset_idversion field in thecargo.tomlfile. For example:1.0.0-DEVto1.0.0. -
Execute
make releaseto release the implementation asset to Exchange.
-
Publish a Minor or Major Version Update (Definition and Implementation Update)
After you have Published a new split-model policy, you can update the definition and implementation assets for updates that require new parameters:
-
Update the definition asset:
-
Update the version in the
exchange.jsonfile of your definition project to1.1.0. -
Make changes to the
gcl.yamlfile. -
make publishon the definition project to publish the development definition asset to Exchange.
-
-
Update the implementation asset:
-
In the implementation project, update the minor or major number of version in the
cargo.tomlfile. For example:1.0.0to1.1.0. -
Update and add the
-DEVsuffix to thedefinition_asset_idversion field in thecargo.toml. For example:1.0.0-DEVto1.1.0-DEV. -
Execute
make build-asset-filesin the implementation project. -
Code your policy logic and test locally.
-
Execute
make publishto release the development implementation asset to Exchange for testing in lower environments. -
Validate the policy works as expected. Complete steps D and E until testing is complete.
-
-
After validating the policy works as expected, release both assets to Exchange:
-
In the implementation project, remove the
-DEVsuffix from thedefinition_asset_idversion field in thecargo.tomlfile. For example:1.1.0-DEVto1.1.0. -
Execute
make releaseto release the implementation asset to Exchange.
-
Develop Split Model Policies Locally Without Publishing to Exchange
-
Develop the policy definition:
-
Ensure the version in the
exchange.jsonfile is the correct version. For example:1.0.0for your first version. -
Make changes to the
gcl.yamlfile. -
Execute
make release-localin the definition project.
-
-
Develop the policy implementation:
-
Add the
-DEVsuffix to thedefinition_asset_idversion field in thecargo.tomland ensure it matches the definition asset version used in step one. -
Execute
make build-asset-filesin the implementation project. -
Code your policy logic and test locally.
-
Validate the policy works as expected. Complete steps C until testing is complete.
-
-
If you wish to distribute the policy locally as a production asset:
-
Remove the
-DEVsuffix from thedefinition_asset_idversion field in thecargo.tomlfile. For example:1.0.0-DEVto1.0.0. -
Execute
make buildto compile the implementation asset. -
Distribute the policy assets as desired.
-



