We're using AEM 18.104.22.168. Is it possible to customize configurations in our source code for individual workflow launchers on a per environment basis, similar to OSGI configs? The goal is that each Maven build will apply the custom settings to each workflow on a per environment basis. We'd like to avoid manually changing settings after deployment.
With OSGI configs, we have various config folders in our ui.apps project that might apply to individual servers (DEV, QA, etc.). Each server uses custom configurations based on naming conventions used for folder names and the server's run mode(s). It's easy and works great, but we haven't had any luck figuring out how to do something similar for workflows.
We saved the configuration for a sample AEM Workflow Launcher under this folder in the ui.content project:
It works great, but the same settings apply to all environments. In the .content.xml file, we want the enabled property set to true in our QA, CERT, and PROD environments, but set to false in our DEV environment and local sandboxes. We'd like to avoid enabling or disabling all workflow launchers per server, since we have other workflows that we always want enabled in all environments. Here's what our current .content.xml file looks like.
<?xml version="1.0" encoding="UTF-8"?>
Thanks in advance for any possible solutions you can share, and really appreciate you taking the time to ponder this.
I think I understand the reason why it wouldn't work because it's the same OOB OSGIproperty that you plan to configure with different values. One of the workaround is that you could extend the Launcher handler and register your custom properties/wrapper and pass on the environment specific values to the OOB code from the same approach shared above.
Appreciate you suggesting a possible alternative gauravb10066713. For now, we only have one affected workflow (maybe two), so writing/maintaining additional and possibly unsupported custom workflow code doesn't quite seem worth the trade-off of manually enabling/disabling the workflow launcher. We still might give your suggestion a shot if we have time, and if so, will let you know how it goes. Thanks again gauravb10066713.
Very logical idea, and I tried something similar before posting, but no dice. I even tried it again in case I missed something the first try, both with and without the square brackets for runModes value in .content.xml. Thanks so much gauravb10066713 for your awesome suggestions and time.
check the OOB config folders -
To me, if you would create structure like this, it should work fine -
For prod server, runmodes would be - author, prod and publish, prod
For dev server, runmodes would be - author, dev and publish, dev
In each config file, specify the custom properties/key-value pairs as required.
Would it suffice?
gauravb10066713, thanks again for commenting. We do use different runmodes on all our servers. Unlike regular osgi configs for stuff like com.day.cq.mailer.DefaultMailService.xml, the workflow launcher config is in one folder, and the file is named .content.xml. For our example workflow, it's:
It's not that we only want to run it or not run it on certain servers, it's that we'd like different configuration values on each server. That implies multiple config files. So runmode matters, but the problem is how do we provide multiple, different values via config files for various properties such as "conditions" or "excludeList"?
It's difficult to succinctly and clearly describe the issue, but hopefully this clarifies it a bit.
My solution is to use different runmodes per environment along with server type (author/publish). I assume we are on the same page here.
E.g. java -jar abc.jar -Dsling.run.modes=author, prod, someothercustomrunmode
You could configure different runmodes per environment - dev, qa, prod etc. and that should do the trick. I remember there is an option which says author+publish in launcher dashboard that means it allows to pass on multiple runmodes in some way.
Now what I'm not aware of is the syntax part that's why I mentioned try with either String or String type or check the /libs code regarding how you can pass multiple runmodes to this launcher configuration.
Hope that helps.
Hi gauravb10066713. The runModes property only limits where this single configuration gets applied for the specified workflow launcher. We're trying to use multiple configurations that are selectively applied to different servers. The runModes property might be part of the solution, but it doesn't help with the multiple configurations piece (unless there's more to it that I'm not seeing).
Thanks very much for your input.