Use case: Many plugin enrichers use parameters that are suitable in your Development environment but should be modified when you deploy the model in QA and/or Production. It's cumbersome to remember to manually update the parameters before closing your model every time you're ready to deploy to QA.
Solution: You can control many "environment variables" using the Admin API. However, as of v5.2 of xDM, plugin enricher parameters are hardcoded. The easiest way to update these parameters is using a SQL update (or delete if you're removing the parameter entirely) to the
mta_param table in the repository.
WARNING: Editing the repository is not something we usually advise. Be careful you don't break your environment. Only do this if you are confident you know what you're doing!!!
How to edit your repository to update or remove the plugin parameters
Prerequisite: You should be scripting your deployment using the Admin API. If you're not scripting your deployments yet (to export/import/deploy your model, images, plugins, roles, data location configuration, etc.), now is the right time to start.
How it works: The additional update/delete query should execute after the model import into QA/PROD and before deployment in QA/PROD.
Let's take the Melissa Personator plugin as an example.
There is a parameter on the Melissa Personator plugin called
Request Limit. This parameter defines the maximum number of requests that are sent to the Melissa API. Setting this parameter during development-time is a cost-saving measure as limits the number of calls to the API: for instance, if it is set to 3, only 3 calls will be sent so that you can test the plugin works, while further calls won't be sent. The value for this parameter should then be removed when moving to Production, where all requests are expected to be sent and processed.
Here's the query to use for finding all the parameters:
select * from semarchy_repository.mta_param where classname = 'PluginEnricherParam';
We are going to filter on the plugin parameter Request Limits for the Melissa plugin. It turns out it's called
PARAM_REQUESTS_LIMIT. Since there are 2 Melissa plugins, Personator and Global Address Verification, we want to filter the results to only take the Personator plugin in case you are using both enrichers. I can do this by joining to the
mta_enricher table using the
select * from dev4_repo.mta_param p inner join dev4_repo.mta_enricher e on e.uuid = p.o_enricher where p.classname = 'PluginEnricherParam' and p.param_name = 'PARAM_REQUEST_LIMIT' -- and e.uuid = '1016af7b-f4d1-4386-be75-817a1da29996' ;
Now we have all the components, we can write our delete statement (because the Request Limits parameter needs to be removed for us to enrich all records. If you wanted to increase the Limit, you would do an update instead).
delete from dev4_repo.mta_param p where p.classname = 'PluginEnricherParam' and p.param_name = 'PARAM_REQUEST_LIMIT' and p.o_enricher in ( select uuid from dev4_repo.mta_enricher e -- where e.uuid = '1016af7b-f4d1-4386-be75-817a1da29996' ) ;
After running the update/delete query, refresh the plugin enricher definition in the Application Builder. You should see the parameter disappeared, and there's no other impact on the model. If it looks correct, deploy for the change to apply.
If you have an enricher cache, xDM will use the cache parameter instead of the enricher's parameters, which is why the enricher has greyed-out parameters in the App Builder.
These old params set at the enricher level still show up in the
mta_param table even if they're not used.
Technically updating/deleting only the cache parameter is sufficient. But to avoid any potential issues and for consistency, I would recommend deleting both the parameters at the enricher and the enricher cache.
The enricher cache uses a different class name. Instead of
PluginEnricherParam, you will need to filter the mta_param table on the classname
select * from dev4_repo.mta_param p where p.classname = 'EnricherCacheParam' and p.param_name = 'PARAM_REQUEST_LIMIT' ;
Here's an example of the delete statement you can use to remove the enricher cache plugins (use the update if you need to modify the parameter instead of deleting it and qualify the statement if you have more than one enricher cache with the same parameter).
delete from dev4_repo.mta_param p where p.classname = 'EnricherCacheParam' and p.param_name = 'PARAM_REQUEST_LIMIT' and p.o_enricher in ( select uuid from dev4_repo.mta_enricher e ;
Nice-to-have tip: Since the enricher's parameter is no longer used (because the enricher cache's parameters are active), you may consider a one-time cleanup effort of deleting the plugin parameter from the enricher in the DEV model and set up the parameter in the cache. This is not necessary. Deleting the param in the enricher won't affect anything, but for maintenance purposes, it would avoid future discussions if a developer one day wonders why the SQL scripts look at both cache and plugin params.
Important things to consider
- If deleting a plugin parameter, ensure it's not a mandatory parameter. Otherwise, you've introduced an error in your model.
- Remember to deploy the model change!
NOTE: the syntax in this article is for PostgreSQL. You may need to modify it for Oracle or SQL Server. I also didn't include the update statement, but you can imagine it's parallel to the delete statement.
If you have questions, please leave a reply for us to address them. If you're not sure how to do this, please check in with Semarchy support.