Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-6454

Named ProcessEnginePlugins



    • Feature Request
    • Resolution: Fixed
    • L3 - Default
    • 7.6.0, 7.6.0-alpha4
    • 7.5.0
    • engine
    • None


      Because ProcessEngineConfiguration(Impl) offers many setters that are not grouped in an OOD pattern, we started to use ProcessEnginePlugins#preInit to set our values. So for example the DataSourcePlugin has getters/setters for datasource, dbUpdate, ... , the HistoryLevelPlugin configures the history level (and maybe additional HistoryEventListeners).

      We use this at K+N and the idea is to move the "Configuration" classes in the spring boot extension to the same pattern.

      When the plugin is applied to the engine on startup, we get a log-entry "applied plugin 'HistoryLevelPlugin' ...". So far so good.

      But: the name today is the SimpleClassName of the registered plugin. I want to control from within the plugin, what its name will be. Two reasons:

      • I might have a parameterized HistoryLevelPlugin(String level). So Its useful to know, if I registered "full" or "audit". By having control over the name, I could implement what I want to see in the log.
      • When using spring boot, I can register plugins just by defining available beans that implement ProcessEnginePlugin. Those beans could be anonymous, just writing `@Bean public ProcessEnginePlugin myPlugin() {}`. In these case I get a very ugly log message containing something like "plugin Plugin@12345extendedCglib...." registered, which is not very helping.


      • we must not change the ProcessEnginePlugin interface for backward compatibility. (shame, would we use java 8, we could provide a default method )

      So I propose:

      • A new Interface type NamedProcessEnginePlugin, extending the existing interface by "getName()".
      • extend the AbstractProcessEnginePlugin to return the class SimpleName as a default for getName()
      • when the log is written, and the plugin to be registered is not a NamedProcessEnginePlugin use the existing mechanism (simple class name), if it is a named plugin, use getName()
      • for engine-spring, we need an additional AbstractBeanNameAwareProcessEnginePlugin that uses springs beanName for getName() {still defaulting to SimpleClassName if not available).

      So now when I add plugins, I have control if the class name, the bean name or some custom name is logged.


      • When the


        This is the controller panel for Smart Panels app




              thorben.lindhauer Thorben Lindhauer
              jan.galinski@holisticon.de Jan Galinski
              0 Vote for this issue
              2 Start watching this issue